// JScript File
var CLT_oldWindowOnload;    
var CLT_div;
var CLT_interval;
var CLT_FLASH_INSTALLED = 0;
var CLT_FLASH = 0;
var CLT_Pos = 5;
var CLT_Scroll = true;
var CLT_xOf = 0;
var CLT_yOf = 0;
var CLT_ClickThrough = 0;
var CLT_Target = '_self';
var CLT_is;
var CLT_isIE3Mac = false;
var CLT_VisitID = '86475004';
var CLT_scrW = 0;
var CLT_scrH = 0;
var CLT_scrOfX = 0;
var CLT_scrOfY = 0;

//FLASH DATA IS HERE//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
var CLT_Server = 'http://www.myrealestateletters.com'
var CLT_Width = 200;
var CLT_Height = 290;
var CLT_FlashFileName = '/WritingSoftware.swf';

function CLT_CreateFlashObjText()
{
	CLT_FlashObjText	= '<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="' + CLT_Width + '" height="' + CLT_Height + '" id="CLT_Fl8" align="middle" />';
	CLT_FlashObjText	+= '<param name="movie" value="' + CLT_Server + CLT_FlashFileName + '" />';
	CLT_FlashObjText	+= '<param name="quality" value="high" />';
	CLT_FlashObjText	+= '<param name="wmode" value="transparent" />';
	CLT_FlashObjText	+= '<param name="loop" value="false" />';
	CLT_FlashObjText	+= '<param name="FlashVars" value="VisitID=' + CLT_VisitID + '&menuEntryType=bottom&ShowDebug=false&IsFireFox=false" />';
	CLT_FlashObjText	+= '<embed src="' + CLT_Server + CLT_FlashFileName + '" quality="high" wmode="transparent" loop="false" width="' + CLT_Width + '" height="' + CLT_Height + '" name="CLTPresentaion" align="middle" type="application/x-shockwave-flash" id="CLT_FO" />';
	CLT_FlashObjText	+= '</object />';
}
function CLT_CreateFlashObjTextNoFlash()
{

	CLT_FlashObjText	= '<style type="text/css">';
	CLT_FlashObjText	+= '<!-- a:link{ text-decoration:none;font-size: 12px; font-family: Verdana;font-weight: bold;color: #990000;} a:visited{ text-decoration:none;font-size: 12px; font-family: Verdana;font-weight: bold;color: #CCCCCC;} a:hover{ text-decoration:none;font-size: 12px; font-family: Verdana;font-weight: bold;color: #0033FF;} --></style>';
    CLT_FlashObjText	+= '<table width="157" border="1" cellpadding="0" cellspacing="0" bordercolor="#CCCCCC" bgcolor="#333333"><tr>';
    CLT_FlashObjText	+= '<td width="113" align="center" bgcolor="#CCCCCC"><span style="color: #666666;font-size: 18px;font-weight: bold;font-family: Tahoma, Verdana;">Dear User</span></td>';
    CLT_FlashObjText	+= '<td width="38" align="center" bgcolor="#CCCCCC" ><a href="#" onclick="javascript:hideNoFlash()"><span style="font-size: 18px; font-weight: bold; color: #990000;">&#215;</span> </a></td></tr><tr>';
    CLT_FlashObjText	+= '<td height="80" colspan="2"><div align="center" style="color: #CCCCCC;font-family: Tahoma, Verdana;font-size: 12px;">This page requires <br/>Flash Player 8 <br/>to enable you to see the video module.<br/>Click below to install. </div></td></tr><tr>';
    CLT_FlashObjText	+= '<td height="45" colspan="2" align="center"><a href="http://www.macromedia.com/go/getflashplayer" target="_blank">::INSTALL FLASH::</a> </td></tr></table>';


}
//ADDED FOR TEST ONLY/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////


if (navigator.plugins && navigator.plugins.length)
{
	x = navigator.plugins["Shockwave Flash"];
	if (x)
	{
		CLT_FLASH_INSTALLED = 2;
		if (x.description)
		{
			y = x.description;
			CLT_FLASH = y.charAt(y.indexOf('.')-1);
		}
	}
	else
		CLT_FLASH_INSTALLED = 1;
	if (navigator.plugins["Shockwave Flash 2.0"])
	{
		CLT_FLASH_INSTALLED = 2;
		CLT_FLASH = 2;
	}
}
else if (navigator.mimeTypes && navigator.mimeTypes.length)
{
x = navigator.mimeTypes['application/x-shockwave-flash'];
if (x && x.enabledPlugin)
		CLT_FLASH_INSTALLED = 2;
	else
		CLT_FLASH_INSTALLED = 1;
}
else
{
	// IE flash detection.

	CLT_FLASH = 0;
	for(var i=8; i>=8; i--)
	{
		try
		{
			var tempFlashObj = new ActiveXObject("ShockwaveFlash.ShockwaveFlash." + i);
			CLT_FLASH_INSTALLED = 2;
			if( i > CLT_FLASH )
			{
				CLT_FLASH = i;
			}
		}
		catch(e)
		{}
	}
}
//step001>//MAC IE3 check>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

if ((navigator.appVersion.indexOf("Mac") != -1) && (navigator.userAgent.indexOf("MSIE") != -1) &&  (parseInt(navigator.appVersion)==3))
{
	CLT_isIE3Mac = true;
}
else
{
	CLT_is = new CLT_Is(); 
}

//step002>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
if (parseInt(navigator.appVersion) < 4) 
{
	// This program requires a version 4 browser!
	onerror = CLT_ErrorHnd;
}
//step003>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
var CLT_scrW = 0;
var CLT_scrH = 0;
var CLT_scrOfX = 0;
var CLT_scrOfY = 0;

//if(CLT_FLASH_INSTALLED)
if((CLT_FLASH_INSTALLED > 0) && (CLT_FLASH = 8))   //changed
{
	if (typeof(CLT_DELAYEDSTART)!='undefined')
	{
		if(CLT_DELAYEDSTART)
		{
			CLT_oldWindowOnload = window.onload;
			window.onload = CLT_InitDelayed;             
		}
		else
		{
			CLT_InitNow();   
		}
	}
	else
	{
		CLT_InitNow();
	}     
//changes
}
	else
	{
		CLT_InitNow();
	}    
//changes

//step001 function>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function CLT_Is ()
{   
	var agt = navigator.userAgent.toLowerCase(); //browser identification string

	//browser version - object properties assignment
	this.major = parseInt(navigator.appVersion);
	this.minor = parseFloat(navigator.appVersion);

	this.ie      = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
	this.ie3     = (this.ie && (this.major < 4));
	this.ie4     = (this.ie && (this.major == 4) && (agt.indexOf("msie 4") != -1) );
	this.ie4up   = (this.ie && (this.major >= 4));
	this.ie5     = (this.ie && (this.major == 4) && (agt.indexOf("msie 5.0") != -1) );
	this.ie5up   = (this.ie4up && !this.ie4);


	// os id
	this.win   = ( (agt.indexOf("win") != -1) || (agt.indexOf("16bit") != -1) );
	this.mac68k = ((agt.indexOf("68k") != -1) || (agt.indexOf("68000") != -1));
	this.macppc = ((agt.indexOf("ppc") != -1) || (agt.indexOf("powerpc") != -1));
	this.mac = (this.mac68k || this.macppc || (agt.indexOf("mac") != -1));
}
//step002 function>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function CLT_ErrorHnd() 
{ 
	return true; 
}
//step003 functions>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

function CLT_InitDelayed()
{
	if (arguments.callee.done) return;
	arguments.callee.done = true;

//????????
	if(typeof(CLT_oldWindowOnload) == 'function')   
	{
		CLT_oldWindowOnload();
	}
//????????

	

		   if((CLT_FLASH_INSTALLED > 0) && (CLT_FLASH >= 8))
            { 
	                CLT_CreateFlashObjText();
             }
             else
            {
                    CLT_CreateFlashObjTextNoFlash();
            }  

		CLT_div = document.createElement('div'); 
		CLT_div.id = 'cltPresentation';
		CLT_div.style.height = CLT_Height + 'px'; 
		CLT_div.style.width = CLT_Width + 'px';
		CLT_div.style.zindex = '999';
	
		if(CLT_is.ie5up)
		{
			CLT_div.style.position = 'absolute'; 
			CLT_div.style.left = '0px'; 
			CLT_div.style.top = '0px'; 


			CLT_div.insertAdjacentHTML('beforeEnd', CLT_FlashObjText);
			document.body.appendChild(CLT_div);
			window.onscroll = CLT_Stay;                                                              
			window.onresize = CLT_Stay;
			CLT_interval = window.setInterval('CLT_Stay()', 1000);
		}
		else
		{
			CLT_div.style.position = 'fixed'; 
		
			if ((CLT_Pos == 1) || (CLT_Pos == 2) || (CLT_Pos == 3))
			{
				CLT_div.style.top = CLT_yOf.toString() + 'px';
			}
			else if ((CLT_Pos == 5) || (CLT_Pos == 6) || (CLT_Pos == 7))
			{
				CLT_div.style.bottom = CLT_yOf.toString() + 'px';
			}
			else
			{
				CLT_div.style.top = '40%';
			}

			if ((CLT_Pos == 1) || (CLT_Pos == 8) || (CLT_Pos == 7))
			{
				CLT_div.style.left = CLT_xOf.toString() + 'px';
			}
			else if ((CLT_Pos == 3) || (CLT_Pos == 4) || (CLT_Pos == 5))
			{
				CLT_div.style.right = CLT_xOf.toString() + 'px';
			}
			else
			{
				CLT_div.style.left = '40%';
			}

			if (CLT_ClickThrough == 1)
			{
				CLT_div.onclick = CLT_Click;
			}
			
			CLT_Embed = document.createElement('embed');
			CLT_Embed.setAttribute('type', 'application/x-shockwave-flash');
			CLT_Embed.setAttribute('width', CLT_Width);
			CLT_Embed.setAttribute('height', CLT_Height);
			CLT_Embed.setAttribute('id', 'CLT_FlashObject');   //the same name as defined in _CreateFlashObjText
			CLT_Embed.setAttribute('align', 'middle');
			CLT_Embed.setAttribute('quality', 'high');
			CLT_Embed.setAttribute('wmode', 'transparent');
			CLT_Embed.setAttribute('loop', 'false');
			CLT_Embed.setAttribute('name', 'BSDirect');          //the same name as defined in _CreateFlashObjText
			CLT_Embed.setAttribute('src', CLT_Server + CLT_FlashFileName);


			if(CLT_is.mac)
			{
				CLT_Embed.setAttribute('FlashVars', 'VisitID=' + CLT_VisitID + '&menuEntryType=bottom&ShowDebug=false&IsFireFox=false');
			}
			else
			{
				CLT_Embed.setAttribute('FlashVars', 'VisitID=' + CLT_VisitID + '&menuEntryType=bottom&ShowDebug=false&IsFireFox=true');
			}
			CLT_div.appendChild(CLT_Embed);
			document.body.appendChild(CLT_div);
		}
	
}
//>>>>>>>>>>>>>>>>>>>>>>>cont>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function CLT_Stay() 
{
	var scrW = 0;
	var scrH = 0;
	var scrOfX = 0;
	var scrOfY = 0;

	var CLT_Div = CLT_getRefToDivNest('cltPresentation');     //function   _getRefToDivNest
	if( !CLT_Div ) 
	{ 
		return; 
	} //presentation not loaded or <div> not supported
	
	if( CLT_Div.style ) 
	{ 
		CLT_Div = CLT_Div.style; 
	}
	
	
	if( typeof( window.innerWidth ) == 'number' ) 
	{ 
		scrW = window.innerWidth; 
		scrH = window.innerHeight; 
	} 
	else 
	{
		if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) 
		{
			scrW = document.documentElement.clientWidth;
			scrH = document.documentElement.clientHeight; 
		} 
		else 
		{
			if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) 
			{
				scrW = document.body.clientWidth; 
				scrH = document.body.clientHeight; 
			} 
		} 
	}
	
	if( typeof( window.pageYOffset ) == 'number' ) 
	{ 
		scrOfY = pageYOffset; 
		scrOfX = pageXOffset; 
	} 
	else 
	{
		if( document.body && ( document.body.scrollLeft || document.body.scrollTop ) ) 
		{ 
			scrOfY = document.body.scrollTop; 
			scrOfX = document.body.scrollLeft;
		} 
		else 
		{
			if( document.documentElement && ( document.documentElement.scrollLeft || document.documentElement.scrollTop ) ) 
			{ 
				scrOfY = document.documentElement.scrollTop; 
				scrOfX = document.documentElement.scrollLeft; 
			} 
		}
	}

	if ((scrW != CLT_scrW) || (scrH != CLT_scrH) || (scrOfX != CLT_scrOfX) || (scrOfY != CLT_scrOfY))
	{
		var oPix = document.childNodes ? 'px' : 0;

		CLT_scrW = scrW;
		CLT_scrH = scrH;
		CLT_scrOfX = scrOfX;
		CLT_scrOfY = scrOfY;
		
		if ((CLT_Pos == 1) || (CLT_Pos == 7) || (CLT_Pos == 8))
		{
			CLT_Div.left = ( CLT_xOf + ( CLT_Scroll ? CLT_scrOfX : 0 ) ) + oPix;
		}

		else if ((CLT_Pos == 2) || (CLT_Pos == 6) || (CLT_Pos == 9))
		{
			CLT_Div.left = ( CLT_xOf + (( CLT_scrW - CLT_Width ) / 2) + ( CLT_Scroll ? CLT_scrOfX : 0 ) ) + oPix;
		}

		else if ((CLT_Pos == 3) || (CLT_Pos == 4) || (CLT_Pos == 5))
		{
			CLT_Div.left = ( CLT_xOf + ( CLT_scrW - CLT_Width ) + ( CLT_Scroll ? CLT_scrOfX : 0 ) ) + oPix;
		}


		if ((CLT_Pos == 1) || (CLT_Pos == 2) || (CLT_Pos == 3))
		{
			CLT_Div.top  = (CLT_yOf + ( CLT_Scroll ? CLT_scrOfY : 0 ) ) + oPix;
		}

		else if ((CLT_Pos == 4) || (CLT_Pos == 8) || (CLT_Pos == 9))
		{
			CLT_Div.top  = ( CLT_yOf + ((CLT_scrH - CLT_Height ) / 2) + ( CLT_Scroll ? CLT_scrOfY : 0 ) ) + oPix;
		}

		else if ((CLT_Pos == 5) || (CLT_Pos ==6) || (CLT_Pos == 7))
		{
			CLT_Div.top  = ( CLT_yOf + ( CLT_scrH -CLT_Height ) + (CLT_Scroll ? CLT_scrOfY : 0 ) ) + oPix;
		}
	}
}
//>>>>>>>>>>cont >>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function CLT_getRefToDivNest( divID, oDoc ) 
{
	if( !oDoc ) 
	{ 
		oDoc = document; 
	}

	if( document.layers ) 
	{
		if( oDoc.layers[divID] ) 
		{ 
			return oDoc.layers[divID]; 
		} 
		else 
		{
			for( var x = 0, y; !y && x < oDoc.layers.length; x++ ) 
			{
				y = CLT_getRefToDivNest(divID,oDoc.layers[x].document); 
			}
			return y; 
		} 
	}

	if( document.getElementById ) 
	{ 
		return document.getElementById(divID); 
	}

	if( document.all ) 
	{ 
		return document.all[divID]; 
	}

	return document[divID];
}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function CLT_InitNow()
{
    if((CLT_FLASH_INSTALLED > 0) && (CLT_FLASH >= 8))
   { 
	CLT_CreateFlashObjText();
    }
   else
  {
    CLT_CreateFlashObjTextNoFlash();
  }  

	document.open();

	if(CLT_is.ie5up)
	{
		document.write( '<div id="cltPresentation" style="position:absolute";z-index:999;left:0px;top:0px;height:'+ CLT_Height +'px;width:'+ CLT_Width +'px;">'+ CLT_FlashObjText +'</div>' );

		window.onscroll = CLT_Stay;
		window.onresize = CLT_Stay;
		CLT_Stay();

	}
	else
	{
		
			document.write( '<div id="cltPresentation" style="position:fixed;z-index:999;height:'+ CLT_Height +'px;width:'+ CLT_Width +'px;' );
		
			if ((CLT_Pos == 1) || (CLT_Pos == 2) || (CLT_Pos == 3))
			{
				document.write('top:' + CLT_yOf.toString() + 'px;');
			}
			else if ((CLT_Pos == 5) || (CLT_Pos == 6) || (CLT_Pos == 7))
			{
				document.write('bottom:' + CLT_yOf.toString() + 'px;');
			}
			else
			{
				document.write('top:40%;');
			}

			if ((CLT_Pos == 1) || (CLT_Pos == 8) || (CLT_Pos == 7))
			{
				document.write('left:' + CLT_xOf.toString() + 'px;');
			}
			else if ((CLT_Pos == 3) || (CLT_Pos == 4) || (CLT_Pos == 5))
			{
				document.write('right:' + CLT_xOf.toString() + 'px;');
			}
			else
			{
				document.write('left:40%;');
			}

			if (CLT_ClickThrough == 1)
			{
				document.write('" onClick="CLT_Nav()">'+ CLT_FlashObjText +'</' + 'div>');
			}
			else
			{
				document.write('">'+ CLT_FlashObjText +'</' + 'div>');
			}
		
	} 
	document.close();
}
function hideNoFlash()
{

	if( document.layers ) 
	{
		if( document.layers["cltPresentation"] ) 
		{ 
			 document.layers["cltPresentation"].visibility = 'hidden'; 

		} 
	}

	if( document.getElementById ) 
	{ 
		 document.getElementById("cltPresentation").style.visibility = 'hidden'; 

	}

	if( document.all ) 
	{ 
		return document.all["cltPresentation"].visibility = 'hidden'; 

	}

}
//>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
function CLT_Nav()
{
	if(CLT_ClickThrough == 1)
	{
		if (typeof(CLT_Target)!='undefined')
		{
			myRef = window.open('http://www.livefaceonweb.com/?source=client&keyword=WritingSoftware', CLT_Target);
		}
		else
		{
			myRef = window.open('http://www.livefaceonweb.com/?source=client&keyword=WritingSoftware', '_self');
		}
	}
}