var isNN = (navigator.appName.indexOf("Netscape")!=-1);



//FRAME BUSTER
//if( top != self ) // nuke embedding frames
//	parent.parent.parent.parent.parent.parent.location = self.location


function goTab(dest) { 
if (document.getElementById(dest)) { document.getElementById(dest).focus(); }	
}

function gotoTab(dest) {
if(event.keyCode==9) {
goTab(dest);
return false; }
}

//function SetAgent(agentID, firstName, lastName)
//{
//getObjectByID('agentName').innerHTML = firstName + ' ' + lastName;
//getObjectByID('TextBoxAgentID').value = agentID;
//}

function hideit(elt)
{ getObjectByID(elt).style.visibility = "hidden";}

function showit(elt)
{ getObjectByID(elt).style.visibility = isNN ? "show" : "visible" }



function getObjectByID(id) {
if (document.getElementById) { 
 return document.getElementById(id);
} else if (document.all) { 
 return document.all[id];
} else if (document.layers) { 
 return document.layers[id];
} else { return false; }
}

function fnNewWindow( MyURL, MyProperties, MyWidth, MyHeight)
{
var newWindow;
var strProperties = "";

if (MyProperties == "")
	{
	if (MyWidth != "")
		strProperties = 'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=' + MyWidth;
	else
		strProperties = 'scrollBars=no,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=500';

	if (MyHeight != "")
		strProperties += ',height=' + MyHeight;
	else
		strProperties += ',height=500';
}
else
	strProperties = MyProperties
newWindow = window.open(MyURL, "", strProperties);
}


function fnMakeNewWindow( MyURL)
{
var newWindow;
newWindow = window.open(MyURL, "_blank");
}


function rollIn(imgName) {
 if (document.images && (flag == true)) {
 document[imgName].src = eval(imgName + "on.src");
 }
}

function rollOut(imgName) { // the normal onMouseOut function
 if (document.images){
 document[imgName].src = eval(imgName + "off.src");
 }
}
//=====================================ROLLOVER LINKS WITH ROLLOVER TEXT ===============================
//Public Domain javascripts from IRT.Org: http://developer.irt.org/script/133.htm

var dhtml = '',no = 0; 
if (navigator.appVersion.charAt(0) == "4") {
 if (navigator.appVersion.indexOf("MSIE") != -1)
 dhtml = 'IE';
 else
 dhtml = 'NN';
} 
function mover(text) {

var object = '';
if (document.layers) {
 eval('document.layers["' + object + 'b"].moveBelow(document.layers["' + object + 'a"])');
 eval('document.layers["' + object + 'b"].visibility="hide"');
 eval('document.layers["' + object + 'a"].visibility="show"');
 }
 else {
	if (dhtml == 'IE') {
		object= "rollovertext";
		eval(object + '.innerHTML = text');
	}else {
		object= "rollovertext";
		document.getElementById(object).innerHTML = text;
	}
 }
}

function mout(text) {
	var object = "rollovertext";
	text="&nbsp;";
	
 if (document.layers) {
 eval('document.layers["' + object + 'a"].moveBelow(document.layers["' + object + 'b"])');
 eval('document.layers["' + object + 'a"].visibility="hide"');
 eval('document.layers["' + object + 'b"].visibility="show"');
 }
 else {
		if (dhtml == 'IE') {
		eval(object + '.innerHTML = text');
	}else {
		document.getElementById(object).innerHTML = text;
	}
 }
}
function buildRolloverTextArea() {
	var strContent = ''

	if (document.layers) {
		strContent += '<ilayer width=\"100%\" id=rollovertext>\n" + "<layer class=textblue2 width=\"100%\" id=rollovertextarea>';
	} else {
		strContent += '<div class=textblue2 id=\"rollovertext\" name=\"rollovertext\">&nbsp;';
	}
	if (document.layers) {
		strContent +='&nbsp;</layer>\n</ilayer>';
 	} else {
 	strContent += '</div>';	
	}
 document.write(strContent)
}

function buildLink(text,msg,href,isActive) {
	//string variable to hold link HTML; class assigned to link
 var strContent = '';
 var strContentTest = '';
 var activeImg = '';

//Escape out apostrophes
	href=href.replace(/"/gi,'\'')
	 //DO WE NEED TO HILIGHT THE ACTIVE LINK?
 if (isActive == 'true') {
 } else {
 }
 
 if (document.layers) {
 document.write('<layer name="link' + no + 'a" visibility="hide"><a href="'+ href +'" onMouseOut="mout(\'link'+no+'\')">'+ msg +'<\/a><\/layer><layer name="link'+no+'b"><a href="'+href+'" onMouseOver="mover(\'link'+no+'\')">'+ msg +'<\/a><\/layer>');
 } else {
 document.write('<a href="' + href + '" onMouseOut="mout(\'' + msg + '\')" onMouseOver="mover(\''+ msg +'\')" id="link'+no+'" class=rollover>'+text+'<\/a>');
 }
 document.write('<br>');
 no+=1;
 document.write(strContent);
}

function buildLinkTB(text,msg,href,isActive) {
	//string variable to hold link HTML; class assigned to link
 var strContent = '';
 var strContentTest = '';
 var activeImg = '';

//Escape out apostrophes
	href=href.replace(/"/gi,'\'')
	 //DO WE NEED TO HILIGHT THE ACTIVE LINK?
 if (isActive == 'true') {
 } else {
 }
 
 if (document.layers) {
 document.write('<layer name="link' + no + 'a" visibility="hide"><a href="'+ href +'" onMouseOut="mout(\'link'+no+'\')">'+ msg +'<\/a><\/layer><layer name="link'+no+'b"><a href="'+href+'" onMouseOver="mover(\'link'+no+'\')">'+ msg +'<\/a><\/layer>');
 } else {
 document.write('<a href="' + href + '" id="link'+no+'" class=rollover>'+text+'<\/a>');
 }
 document.write('<br>');
 no+=1;
 document.write(strContent);
}

function buildLinkWithTarget(text,msg,href,isActive) {
	//string variable to hold link HTML; class assigned to link
 var strContent = '';
 var strContentTest = '';
 var activeImg = '';

//Escape out apostrophes
	href=href.replace(/"/gi,'\'')
	 //DO WE NEED TO HILIGHT THE ACTIVE LINK?
 if (isActive == 'true') {
 } else {
 }
 
 if (document.layers) {
 document.write('<layer name="link' + no + 'a" visibility="hide"><a href="'+ href +'" onMouseOut="mout(\'link'+no+'\')" target="_new">'+ msg +'<\/a><\/layer><layer name="link'+no+'b"><a href="'+href+'" onMouseOver="mover(\'link'+no+'\')">'+ msg +'<\/a><\/layer>');
 } else {
 document.write('<a href="' + href + '" onMouseOut="mout(\'' + msg + '\')" onMouseOver="mover(\''+ msg +'\')" id="link'+no+'" class=rollover target="_new">'+text+'<\/a>');
 }
 document.write('<br>');
 no+=1;
 document.write(strContent);
}


function buildPopupWithTarget(text,msg,href,isActive) {
	//string variable to hold link HTML; class assigned to link
 var strContent = '';
 var strContentTest = '';
 var activeImg = '';
 
 var optionSetA = 'scrollBars=yes,resizable=no,toolbar=no,menubar=no,location=no,directories=no,width=680,height=650';
 var optionSetB = 'scrollBars=yes,resizable=yes,toolbar=yes,menubar=yes,location=yes,status=yes,directories=no,width=825,height=600';

//Request a Home Buyers Guide
if (text == 'Request a Home Buyers Guide') {
	optionSetA = optionSetB;
}


//Escape out apostrophes
	href=href.replace(/"/gi,'\'')
	 //DO WE NEED TO HILIGHT THE ACTIVE LINK?
 if (isActive == 'true') {
 } else {
 }
 
 if (document.layers) {
// document.write('<layer name="link' + no + 'a" visibility="hide"><a href="'+ href +'" onMouseOut="mout(\'link'+no+'\')" target="_blank">'+ msg +'<\/a><\/layer><layer name="link'+no+'b"><a href="'+href+'" onMouseOver="mover(\'link'+no+'\')">'+ msg +'<\/a><\/layer>');
  document.write('<layer name="link' + no + 'a" visibility="hide"><a href="javascript:fnNewWindow(' + String.fromCharCode(39) + href + String.fromCharCode(39) + ',' + String.fromCharCode(39) + optionSetA + String.fromCharCode(39) + ', ' + String.fromCharCode(39) + String.fromCharCode(39) + ', ' + String.fromCharCode(39) + String.fromCharCode(39)+ ');" onMouseOut="mout(\'link' + msg + '\')" onMouseOver="mover(\'link'+ msg +'\')" id="link'+no+'" class=rollover>'+text+'<\/a>');
 } else {
 document.write('<a href="javascript:fnNewWindow(' + String.fromCharCode(39) + href + String.fromCharCode(39) + ',' + String.fromCharCode(39) + optionSetA + String.fromCharCode(39) + ', ' + String.fromCharCode(39) + String.fromCharCode(39) + ', ' + String.fromCharCode(39) + String.fromCharCode(39)+ ');" onMouseOut="mout(\'' + msg + '\')" onMouseOver="mover(\''+ msg +'\')" id="link'+no+'" class=rollover>'+text+'<\/a>');
 }
 document.write('<br>');
 no+=1;
 document.write(strContent);
}

