// JavaScript Document
var stateUrl="http://www.tollbrothers.com/homesearch/servlet/HomeSearch?app="
var communityUrl="http://www.tollbrothers.com/homesearch/servlet/HomeSearch?app=community_description&comm_num=";
var modelUrl="http://www.tollbrothers.com/homesearch/servlet/HomeSearch?app=model_description&plan_id=";


//tests for specified version of flash
//plugin==0 -they don't have latest, plugin==1 -they do have latest.
var plugin = (navigator.mimeTypes && navigator.mimeTypes["application/x-shockwave-flash"]) ? navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin : 0;
var flashVersionToCheckFor = 8;
if ( plugin ) {
	//put version to test for...
	plugin = parseInt(plugin.description.substring(plugin.description.indexOf(".")-1)) >= flashVersionToCheckFor;
}

else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0 
   && (navigator.userAgent.indexOf("Windows 95")>=0 || navigator.userAgent.indexOf("Windows 98")>=0 || navigator.userAgent.indexOf("Windows NT")>=0)) {
	document.write('<SCRIPT LANGUAGE=VBScript> \n');
	document.write('on error resume next \n');
	//put version to test for...
	document.write('plugin = ( IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+flashVersionToCheckFor+'")))\n');
	document.write('</SCRIPT\>\n');
}
//end flash detect
function tollPopup(tollUrlType, code) {
	var theUrl='';
	var x;
	if(tollUrlType=="community"){
		theUrl = communityUrl+code;
	}else if(tollUrlType=="model"){
		theUrl = modelUrl+code;
	}
	x=window.open(theUrl,'sorrentoPopUp');
	x.focus();
}
function openVideo(){
	var x;

	x=window.open("videoPopUp.html","sorrentoVideoWindow","width=525,height=370,status=no,toolbar=no");
	x.focus();
	
}
function popup(theUrl) {
	var x;
	x=window.open(theUrl,'sorrentoPopUp');
	x.focus();
}
function statePopUp(stateString){
	var x;
	x=window.open(stateUrl+stateString,'sorrentoPopUp');
	x.focus();
	
	
}
function insertFlashSection(o){
	if(plugin){
		document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,19,0" width="'+o.flashWidth+'" height="'+o.flashHeight+'"><param name="allowScriptAccess" value="sameDomain" /><param name="movie" value="'+o.flashUrl+'" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><embed src="'+o.flashUrl+'" quality="high" wmode="transparent" width="'+o.flashWidth+'" height="'+o.flashHeight+'" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" /></object>');
	}else{
		document.write('<img src="'+o.noFlashImage+'" alt="" border="0"><a id="getFlash" href="javascript:popup(\'http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\');">Click here to get the latest version of Flash which will allow you to see the slide show above.</a>');
	}	
}
function do_sIFR_FlashTextReplacement(){
	if(typeof sIFR == "function"){
		
			// H1 text replacement.
			sIFR.replaceElement(named({sWmode:"transparent", sSelector:"h1", sFlashSrc:"sIFR/trajan.swf?noCache="+Math.random(), sColor:"#853800", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
			// H2 text replacement.
			//sIFR.replaceElement(named({sWmode:"transparent", sSelector:"h2", sFlashSrc:"sIFR/trajan.swf?noCache="+Math.random(), sColor:"#853800", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:0, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
			// DT text replacement.
			sIFR.replaceElement(named({sWmode:"transparent", sSelector:"dt", sFlashSrc:"sIFR/trajan.swf?noCache="+Math.random(), sColor:"#e0bb87", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:8, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
			//
			sIFR.replaceElement(named({sWmode:"transparent", sSelector:"label", sFlashSrc:"sIFR/trajan.swf?noCache="+Math.random(), sColor:"#000000", sLinkColor:"#000000", sBgColor:"#FFFFFF", sHoverColor:"#CCCCCC", nPaddingTop:8, nPaddingBottom:0, sFlashVars:"textalign=left&offsetTop=0"}));
		}
	
}
