//erabc.js
window.status = "Please Wait...";

function getCompEnv(){
	var screenRes = '';
	var cmptrEnv = 'U.A.=' + navigator.userAgent + ', OS=' + window.navigator.platform + ', CPU=' + window.navigator.cpuClass;
	if ( window.screen ){
		screenRes += window.screen.width; 
		screenRes += 'x'; 
		screenRes += window.screen.height;
	}else{
		screenRes = 'Unknown';
	}
	cmptrEnv += ', Resolution=';
	cmptrEnv += screenRes;
	return cmptrEnv;
}
// End getCompEnv

function findCurPageName(){
	var url=location.href;
	var lastSlash = url.lastIndexOf("/");
	var curPageName = url.substring(lastSlash+1,url.length);
	var dot = curPageName.indexOf(".");
	curPagePrefix = curPageName.substring(0,dot);
	return curPageName;
} // End findCurPageName

function doFootingA(userAgent){
	var pLine = '' +
		'<table class="footerA" width="100%" border="0" cellpadding="0" cellspacing="0" summary="page footing">' +
		'<tr><td align="center"><span class="footnote">For best viewing, always use the latest browser your computer\'s memory will handle.<br>' +
		'<a class="footerA" href="http://www.upsdell.com/BrowserNews/find.htm" target="_blank">Click here for FREE browser upgrades</a>.<br>' +
		'<span class="footnote">Please report any problems viewing this site to the ' +
		'<a class="footnote" href="mailto:' + g_WEBMASTERMAILTO  + '?subject=Re: Website=' + g_CLIENTURL + ', Page=' + findCurPageName() + ', ';
	pLine +=getCompEnv();
	pLine += '">Webmaster</a></span><br/><br/>';
	document.write(pLine);
}	//End doFootingA
function doFootingB(){
	var pLine = '';
	pLine +='<table width="100%" border="0" cellpadding="0" cellspacing="0" summary="page footing">';
  pLine +='<tr><td colspan="2"><img class="botline" src="./images/spacer.gif" width="100%" height="2" border="0" alt=""></td></tr>';
  pLine +='<tr><td><img src="./images/logo-eho.gif" width="38" height="38" border="0" alt="Equal Housing Opportunity"/></td>';
  pLine +='<td class="footer">&copy; '+g_COPYRIGHT+'<br/>';
  pLine +='Each ERA<sup><small>&reg;</small></sup> Office is Independently Owned and Operated.<br/>';
	pLine += 'Site last modified ' + g_sLASTUPDATE + ', Reviewed ' + g_sLASTREVIEW + '&nbsp;by ';
	pLine +='<a class="footer" href="' + g_WEBMASTERURL + '" target="_blank">' + g_WEBMASTERNM + '</a>&nbsp;' +	'&nbsp;&nbsp;&nbsp;&nbsp;';
	pLine +='<a class="footnote" href="mailto:' + g_WEBMASTERMAILTO  + '?subject=Re: Website=' + g_CLIENTURL + ', Page=' + findCurPageName() + ', ';
	pLine +=getCompEnv();
	pLine +='">Comments to Webmaster</a>';
	pLine +='</td></tr></table>';
	document.write(pLine);
}	//End doFootingB

function doBackDoor(pageName,pgWidth){
	var sCopy = '';
	if(parent.length == 0) {
		if(!pgWidth){pgWidth = '892';}
		sCopy += '<table width="892" align="center" cellspacing="0" cellpadding="2" border="0">';	
		sCopy += '<tr><td width="40" class="cTitle"><a href="index.html" target="_top" onmouseover="this.className=\'cButton1\';" onmouseout="this.className=\'cButton0\';" class="cButton0">Home</a></td>';
		sCopy += '<td width="892" class="cTitle">ERA Best Choice REALTORS&reg;, Sussex County, NJ - ' + pageName + '</td>';
		sCopy += '<td width="40" class="cTitle"><a href="index.html" target="_top" onmouseover="this.className=\'cButton1\';" onmouseout="this.className=\'cButton0\';" class="cButton0">Home</a></td></tr></table></td></tr><tr><td align="center">';
		sCopy += '</table>';
		document.write(sCopy);
	}
}	//End doBackDoor

function doLinkLine(){
	var pLine = '';
	pLine += '<br />';
//	pLine += '<p class="linkclass">';
//	pLine += '<a href="#" onmouseover="this.className=\'cButtonNavTop1\';" onmouseout="this.className=\'cButtonNavTop0\';" class="cButtonNavTop0"><img src="./images/spacer.gif" width="49" height="24" border="0" alt=""/></a></p>';
//	pLine += '<p class="linkclass">';
	pLine += '<p style="text-align:center;background-color:transparent;" class="linkclass"><a href="home.html">Home</a> | <a href="clearlist.php?listmode=1">Featured Listings</a> | <a href="mlsmenu.php?listmode=2">Search Multiple Listings</a> | <a href="mktanal.php">Market Analysis</a> | <a href="http://www.mortgageloan.com/calculator/" rel="nofollow" target="_blank">Calculators</a> | <a href="glossary.html">Glossary</a> | <a href="links.html">Resources</a> | <a href="http://www.realtor.com/home-finance/buyers-basics/home-buyers-basics.aspx" rel="nofollow" target="_blank">Buying</a> | <a href="http://www.realtor.com/home-finance/sellers-basics/home-sellers-basics.aspx" rel="nofollow" target="_blank">Selling</a> | <a href="http://www.realtor.com/home-finance/mortgages/default.aspx" rel="nofollow" target="_blank">Mortgage Advice</a> | <a href="about.html">Our Agents</a> | <a href="directions.html">Directions</a> | <a href="legal.html">Privacy &amp; Terms</a> | <a href="sitemap.html">Sitemap</a></p><br/>';	document.write(pLine);
} // End doLinkline

function doBusinessHours(){
	var sCopy = '';
	sCopy += '<table class="cHours" width="100%" align="center" cellspacing="0" cellpadding="0" border="0">';	
	sCopy += '<tr><td width="100%">';
	sCopy += '<p class="cHours">';
	sCopy += 'Office Locations<br/>';
	sCopy += '112 Route 23 South, PO Box 207, Hamburg, NJ 07419<br/>Phone:&nbsp; 973-823-1900&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax:&nbsp;973-823-1919<br/><br/>';
	sCopy += '59 Trinity Street, PO Box 207, Newton, NJ 07860<br/>Phone:&nbsp;973-383-3200&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Fax:&nbsp;973-383-9200<br/><br/>';

	sCopy += 'Summer Office Hours<br/>';
	sCopy += 'Monday thru Friday:&nbsp; 9:00am - 8:00pm, or by Appointment<br/>';
	sCopy += 'Saturday and Sunday:&nbsp; 9:00am - 6:00pm, or by Appointment<br/>';

/*	sCopy += 'Winter Office Hours<br/>';
	sCopy += 'Monday thru Friday:&nbsp; 9:00am - 5:00pm, or by Appointment<br/>';
	sCopy += 'Saturday and Sunday:&nbsp; 9:00am - 5:00pm, or by Appointment<br/>';
*/
	sCopy += '</p></a></td></tr>';
	sCopy += '</table>';

	document.write(sCopy);

}	//End doBusinessHours

function openPopupWindow(url, winWidth, winHeight, winName) {
  if (url.indexOf('nophoto.') != -1)
		return;
  if (url.indexOf('sku00000.') != -1)
		return;
	var W=winWidth;
	var H=winHeight;
	var X_unrounded=(screen.availWidth/2)-(winWidth/2);
	var Y_unrounded=(screen.availHeight/2) - (winHeight/2);
	
	var X=Math.round(X_unrounded); 
	var Y=Math.round(Y_unrounded);
	
	var popUpName = ''; 
	if(winName) popUpName = winName;	// If winName is available, use it
	else if(typeof g_PopUpName != 'undefined') popUpName = g_PopUpName;	// if popup name is still null and a global name is available, use it
	else popUpName = 'DEFLT';					// Default Window Name
	
	winWidth += 30;		// allow for scroll bar width
	winHeight += 30;	// allow for scroll bar height
	var winParms = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=' + winWidth + ',height=' + winHeight + ',Left=' + X + ',Top=' + Y + ',left=' + X + ',top=' + Y;

	var htmlcode='';
	htmlcode='<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"';
  htmlcode+='"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">';
  htmlcode+='<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en-US" lang="en-US">';
	htmlcode+='<head><title>&nbsp;</title>';
	htmlcode+='<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />';
	htmlcode+='<meta http-equiv="Content-language" content="en-US" />';
	htmlcode+='<body style="font-family:Arial,Verdana,Helvetica,Geneva,sans-serif;font-size:12px;font-weight:bold;background-color:#072507;color:#ffffff;margin:0px 4px 4px 4px;text-align:center;">';
	htmlcode+='Click Image to Close Window<br />';
	htmlcode+='<a href="javascript:window.close();"><img src="' + url + '" style="border:#009900 3px solid;" alt="" /></a>';
	htmlcode+='</body></html>';

	var ran_unrounded=Math.random()*100;									// Generate a random number from 1 - 100
	var ran_number=Math.round(ran_unrounded); 
	var randomname = popUpName+ran_number;								// Append the random number to the window name
	
	var winObj = window.open(url, randomname, winParms);	// Create window object
	winObj.document.writeln(htmlcode);										// Send the html code generated above to the window
	return;
}	// End openPopupWindow


function openRemote(url,winName,winWidth,winHeight,x,y) 
{
	var W=winWidth;
	var H=winHeight;
	var X_unrounded=(screen.availWidth/2)-(winWidth/2);
	var Y_unrounded=(screen.availHeight/2)-(winHeight/2);
	var X=Math.round(X_unrounded); 
	var Y=Math.round(Y_unrounded); 

//	var winParms = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + winWidth + ',height=' + winHeight';
	var winParms = 'toolbar=no,location=no,directories=no,status=1,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=' + winWidth + ',height=' + winHeight + ',Left=' + X + ',Top=' + Y + ',left=' + X + ',top=' + Y;

	var ran_unrounded=Math.random()*100;
	var ran_number=Math.round(ran_unrounded); 
	var randomName = winName+ran_number;

	var winObj = window.open(url,randomName,winParms);
	if(winObj.opener == null){
		winObj.opener = window;
	}
	return;
}	//End openRemote

window.status='';
