function P7_hideDiv(evt){var b,relT,mT=false;if(varHere==false){if(document.layers){b=evt.target;if(b.p7aHide){b.visibility="hidden";}else{routeEvent(evt);}}else if(document.all&&!window.opera){b=event.srcElement;while(b!=null){if(b.tagName=="DIV" && b.p7ahD){mT=true;break;}
b=b.parentElement;}
if(b!=null && !b.contains(event.toElement)){b.style.visibility="hidden";}}else if(document.getElementById){b=evt.currentTarget;relT=evt.relatedTarget;while(relT!=null){if(b==relT){mT=true;break;}
relT=relT.parentNode;}
if(!mT){b.style.visibility="hidden";}}
var v;if(b!=null){if(b.style){v=b.style.visibility;}else{v=b.visibility;}}}}
function P7_autoHide()
{var i,g,args=P7_autoHide.arguments;
for(i=0;i<args.length;i++)
{if((g=MM_findObj(args[i]))!=null)
{g.p7aHide=true;if(document.layers){g.captureEvents(Event.MOUSEOUT);}
g.onmouseout=P7_hideDiv;g.p7ahD=true;}}}
function MM_showHideLayers(){var i,p,v,obj,args=MM_showHideLayers.arguments;for(i=0;i<(args.length-2);i+=3){if((obj=MM_findObj(args[i]))!=null){v=args[i+2];if(obj.style)obj=obj.style;v=(v=='show')?'visible':(v=='hide')?'hidden':v;}
obj.visibility=v;
}}
//CHECK FOR NETSCAPE 4

if(document.layers && navigator.appName.indexOf('Netscape')>-1){
		var allTheCookies=document.cookie;
		var netscapeCookie=allTheCookies.indexOf('netscapeCookie');
	if(netscapeCookie==-1){
		var expires=new Date()
		expires.setTime(expires.getTime()+43200000)
		var expiryDate=expires.toGMTString()
		
		
		document.cookie="netscapeCookie="+1+";expires="+expiryDate;
		window.open("http://www.tollbrothers.com/netscapeUsers.html","","width=500,height=400");
	}
}

disable_email=false;
var pat_email2=/app=view_user/;
var pat_email=/app=my_toll_home/;
if(pat_email.test(document.location)==true || pat_email2.test(document.location)==true){
	disable_email=true;
}



function MM_preloadImages(){var d=document;if(d.images){if(!d.MM_p)d.MM_p=new Array();var i,j=d.MM_p.length,a=MM_preloadImages.arguments;for(i=0;i<a.length;i++)
if(a[i].indexOf("#")!=0){d.MM_p[j]=new Image;d.MM_p[j++].src=a[i];}}}	

function validateSaveName(){

var goOn=true;
var pattern=/[^\w+\s+\!]/;
var pattern2=/^\s/;
	if(document.forms.addLink.name.value==""){
		alert ("Please enter a name for your saved favorite");
		goOn=false;
	}
	if(pattern.test(document.forms.addLink.name.value)==true){
		alert ("Please use only letters, numbers, and spaces in the name");
		goOn=false;
	}
	if(pattern2.test(document.forms.addLink.name.value)==true){
		alert ("Please use only letters, numbers, and spaces in the name");
		goOn=false;
	}
	
	if(goOn==true){
	saveData();
	}
	
}

function varHereChange(what){
	varHere=what;
}

function validate(){if(document.forms.theForm.username.value.length==0){alert("Username not entered");return false;}
if(document.forms.theForm.password.value.length==0){alert("Password not entered");return false;}
if(document.forms.theForm.username.value.length > 25){alert("Username exceeds maximum length of 25");return false;}
if(document.forms.theForm.password.value.length > 10){alert("Password exceeds maximum length of 10");return false;}
return true;}
function MM_findObj(n, d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x && d.getElementById)x=d.getElementById(n);return x;}
function MM_reloadPage(init){if(init==true)with(navigator){if((appName=="Netscape")&&(parseInt(appVersion)==4)){document.MM_pgW=innerWidth;document.MM_pgH=innerHeight;onresize=MM_reloadPage;}}
else if(innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH)location.reload();}
MM_reloadPage(true);function MM_openBrWindow(theURL,winName,features){window.open(theURL,winName,features);}
function NewWindow(mypage, myname, w, h, scroll){var winl=(screen.width - w)/ 2;var wint=(screen.height - h)/ 2;winprops='height='+h+',width='+w+',top='+wint+',left='+winl+',scrollbars='+scroll+',resizable'
win=window.open(mypage, myname, winprops)
if(parseInt(navigator.appVersion)>=4){win.window.focus();}}
<!-- my_toll_home run once every page visit -->
var cookie_name="MTH_user";var user="default";var password="";<!-- identify if there is a cookie, and if it has a valid cookie name -->
if(document.cookie){<!-- 
var cookie_index=-1;cookie_index=document.cookie.indexOf(cookie_name);<!-- if there is a cookie, attepmt to parse username and password, and fil 'theForm' with appropriate values -->
if(cookie_index!=-1){var userinfo=GetCookie(cookie_name)
user=userinfo.substring(0,userinfo.indexOf("^"));password=userinfo.substring(userinfo.indexOf("^")+1,userinfo.length);if(document.forms.theForm){document.forms.theForm.username.value=user;document.forms.theForm.password.value=password;}}}
var value=0;<!-- my_toll_home functions -->
function findSaves(){var allCookies=document.cookie;
var allSaves=allCookies.indexOf("MTH_saves");if(allSaves!=-1){var start=allSaves+10;var end=allCookies.indexOf(";",start);if(end==-1)end=allCookies.length;value=allCookies.substring(start, end);value=unescape(value);
return true;}
return false;}
function makeDropDown(){

var locat=document.location;locat=escape(locat);

var wordsBottom='</td></tr><tr><td height="26"><img src="http://www.tollbrothers.com/2004_header/spacer.gif" width="1" height="26"></td><td><nobr><a href="http://homesearch.tollbrothers.com/homesearch/servlet/HomeSearch?app=my_toll_home&cols=2"><img src="http://www.tollbrothers.com/2004_header/MTH_bottom1.gif" width="210" height="26" border="0" ></a><a href="http://homesearch.tollbrothers.com/homesearch/servlet/HomeSearch?app=user_logout"><img src="http://www.tollbrothers.com/2004_header/MTH_bottom2.gif" height="26" border="0" ></a><a href="http://www.tollbrothers.com/my_toll_home/mth_faq.shtml"><img src="http://www.tollbrothers.com/2004_header/MTH_bottom3.gif" height="26" border="0" ></a></nobr></td></tr></table>'

var words='<table width="260" border="0" cellspacing="0" cellpadding="0"><tr><td><img src="http://www.tollbrothers.com/2004_header/spacer.gif" width="1" height="47"></td><td valign="middle"><img src="http://www.tollbrothers.com/2004_header/MTH_top.gif" width="325" height="47" usemap="#Map8" border="0"><div id="Layer2" style="position:absolute; width:255px; height:18px; z-index:6; left: 7px; top: 29px; color: #FFFFFF;">'



if(checkUser()&& findSaves()&& document.cookie.indexOf("LOGIN")!=-1){
	if(value.indexOf("|")!=-1)
	{
	newVals=value.split("|");
		if(newVals.length>=2){
			line1=newVals[1].split("^");line1Year=line1[3].substring(0,4);line1Day=line1[3].substring(8,10);line1Month=line1[3].substring(5,7);line1Date=line1Month+"/"+line1Day+"/"+line1Year;
			saveCount=newVals[0];
			if(saveCount>0){
				var numberShown=saveCount>=3 ? 3 :saveCount;//hasSaves='<!-- 2:Latest 3 of ___ saved favorites -->'
				hasSaves='<span class="latestsaves">My Latest '+numberShown+' of '+saveCount+' Saved Favorites</span>';
			}
			hasSaves+='</div></td></tr><tr> <td><img src="http://www.tollbrothers.com/2004_header/spacer.gif" width="1"></td><td background="http://www.tollbrothers.com/2004_header/MTH_center.gif" valign="top">'	
			hasSaves+='<table width="100%" border="0" cellpadding="0" cellspacing="0">'
			hasSaves+='<tr><td width="1" colspan="6"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="1" height="3"></td></tr>'
			hasSaves+='<tr><td width="5"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="5" height="1"></td>'
			hasSaves+='<td width="3"><img src="http://www.tollbrothers.com/2004_header/bullet.gif"></td>'
			hasSaves+='<td width="3"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="3" height="1"></td>'
			hasSaves+='<td align="left"><span class="latestfavorites_04"><a href="'+line1[2]+'" class="latestfavorites_04">'+line1[0]+'</a></td>'
			hasSaves+='<td align="right"  class="latestfavorites_04">'+line1Date+'</span></td>'
			hasSaves+='<td align="right" width="1"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="4" height="4"></td></tr>'
			hasSaves+='<tr><td width="1" colspan="6"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="5" height="3"></td></tr>'
		}

		if(newVals.length>=3){
			line2=newVals[2].split("^");line2Year=line2[3].substring(0,4);line2Day=line2[3].substring(8,10);line2Month=line2[3].substring(5,7);line2Date=line2Month+"/"+line2Day+"/"+line2Year;
			hasSaves+='<tr><td width="5"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="5" height="1"></td>'
			hasSaves+='<td width="1"><img src="http://www.tollbrothers.com/2004_header/bullet.gif"></td>'
			hasSaves+='<td width="1"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="3" height="1"></td>'
			hasSaves+='<td  class="latestfavorites_04" align="left"><span class="latestfavorites_04"><a class="latestfavorites_04" href="'+line2[2]+'">'+line2[0]+'</a></td>'
			hasSaves+='<td align="right"  class="latestfavorites_04">'+line2Date+'</span></td>'
			hasSaves+='<td align="right" width="1"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="4" height="4"></td></tr>'
			hasSaves+='<tr><td width="1" colspan="6"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="5" height="3"></td></tr>'
		}

		if(newVals.length>=4){
			line3=newVals[3].split("^");line3Year=line3[3].substring(0,4);line3Day=line3[3].substring(8,10);line3Month=line3[3].substring(5,7);line3Date=line3Month+"/"+line3Day+"/"+line3Year;
			hasSaves+='<tr><td width="5"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="5" height="1"></td>'
			hasSaves+='<td width="1"><img src="http://www.tollbrothers.com/2004_header/bullet.gif"></td>'
			hasSaves+='<td width="1"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="3" height="1"></td>'
			hasSaves+='<td align="left"><span class="latestfavorites_04"><a class="latestfavorites_04" href="'+line3[2]+'">'+line3[0]+'</a></td>'
			hasSaves+='<td align="right"  class="latestfavorites_04">'+line3Date+'</span></td>'
			hasSaves+='<td align="right" width="1"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="4" height="4"></td></tr>'
			hasSaves+='<tr><td width="1" height="5" colspan="6"><img src="http://www.tollbrothers.com/2003_header/spacer.gif" width="5" height="3"></td></tr>'
		}
		hasSaves+='</table>'
	

	if(document.all){
		document.all.mthLoggedIn.innerHTML=words+hasSaves+wordsBottom;}
	else if(document.getElementById){
		document.getElementById("mthLoggedIn").innerHTML=words+hasSaves+wordsBottom;}
	else if(document.layers){
		document.mthLoggedIn.document.open();document.mthLoggedIn.document.write(words+hasSaves+wordsBottom);document.mthLoggedIn.document.close();}
	}
}

else if(checkUser()&& document.cookie.indexOf("LOGIN")!=-1){

	var noSaves='<span class="latestsaves">My Latest 0 of 0 Saved Favorites</span></div></td></tr><tr> <td><img src="http://www.tollbrothers.com/2004_header/spacer.gif" width="1" height="47"></td>'

	noSaves+='<td  class="latestfavorites_04" background="http://www.tollbrothers.com/2004_header/MTH_center.gif" align="center" valign="middle"><Br>You currently have no saved favorites.<Br>Please roll over the<br>"Save This Page to my Favorites"<Br> link to begin saving<Br><Br></td></tr>'

	if(document.all){
		document.all.mthLoggedIn.innerHTML=words+noSaves+wordsBottom;}
	else if(document.getElementById){
		document.getElementById("mthLoggedIn").innerHTML=words+noSaves+wordsBottom;}
	else if(document.layers){
		document.mthLoggedIn.document.open();document.mthLoggedIn.document.write(words+noSaves+wordsBottom);document.mthLoggedIn.document.close();}
}

else{}

}























<!-- cookie functions -->
function GetCookie(name){var arg=name+"=";var alen=arg.length;var clen=document.cookie.length;var i=0;while(i < clen){var j=i+alen;if(document.cookie.substring(i, j)==arg)
return getCookieVal(j);i=document.cookie.indexOf(" ", i)+1;if(i==0)break;}
return false;}
function getCookieVal(offset){var endstr=document.cookie.indexOf(";", offset);if(endstr==-1)
endstr=document.cookie.length;return unescape(document.cookie.substring(offset, endstr));}
<!-- function checks for a valid user -->
function checkUser(){if(user=="default")return false;return true;}
<!-- function identifies if a user has an auto login cookie. if he is not, forward user to a log in page -->
function checkLogin(){var locat=document.location ? document.location :document.URL;if(checkUser()&& document.cookie.indexOf("LOGIN")==-1){
document.location.href="http://homesearch.tollbrothers.com/homesearch/servlet/HomeSearch?app=user_login&cookie=1&referer="+escape(locat)}}
var varHere=false;function varHereChange(what){varHere=what;}
<!-- function parses current url to determine what page user is on. the forwards user to save link java servlet with proper data-->
function saveData(){var l=document.location ? document.location :document.URL;l=l.toString();var forwardLoc=l;
while(l.indexOf("&")!=-1){amper=l.indexOf("&");l=l.substr(0,amper)+"%26"+l.substring(amper+1,l.length);}
while(l.indexOf("?")!=-1){qmark=l.indexOf("?");l=l.substr(0,qmark)+"%3f"+l.substring(qmark+1,l.length);}
while(l.indexOf("=")!=-1){qmark=l.indexOf("=");l=l.substr(0,qmark)+"%3d"+l.substring(qmark+1,l.length);}
if(l.indexOf("community_detail")!=-1){objecttype="fav_community";}
else if(l.indexOf("model_detail")!=-1){objecttype="fav_model";}
else if(l.indexOf("model_gallery")!=-1){objecttype="fav_image";}
else if(l.indexOf("model_panoramics")!=-1){objecttype="fav_tour";}
else if(l.indexOf("model_floorplan")!=-1){objecttype="fav_floorplan";}
else if(l.indexOf("model_video")!=-1){objecttype="fav_tour";}
else if(l.indexOf("community_lots")!=-1){objecttype="fav_siteplan";}
else if(l.indexOf("community_directions")!=-1){objecttype="fav_map";}
else if(l.indexOf("community_guide")!=-1){objecttype="fav_guide";}
else if(l.indexOf("community_brochure")!=-1){objecttype="fav_brochure";}
else if(l.indexOf("community_qds")!=-1){objecttype="fav_quick";}
else{objecttype="fav_other";}
window.open('http://homesearch.tollbrothers.com/homesearch/servlet/HomeSearch?app=save_data&datatype=URL&objecttype='+objecttype+'&name='+document.forms.addLink.name.value+"&data="+l,'','height=100,width=250,top=250,left=250');
location.href=forwardLoc;location.reload()}
function BD_checkMacIE(){if(navigator.appName.indexOf('Microsoft')>-1 && navigator.platform.indexOf('Mac')>-1){P7_autoHide('mthLoggedIn');}}
function BD_ahideNN4(){if(document.layers){P7_autoHide('mthLoggedIn');}}
function captureLocation(){var locat=document.location;document.cookie="url="+escape(locat);document.location.href="http://www.tollbrothers.com/my_toll_home/register.shtml";}
