//psr.js
// MODULE LEVEL VARS
var m_sHIDELAYER = (document.layers ? 'hide' : 'hidden');
var m_sSHOWLAYER = (document.layers ? 'show' : 'visible');
navimgNames = new Array(
"home",
"services",
"about", 
"directions",
"contact",
"links",
"gallery"
)
if(!prevImgName)
{
	var prevImgName = "";
}
// preload_images
  var buttoncnt = navimgNames.length;
  var onbtn = new Array(buttoncnt);
  var offbtn = new Array(buttoncnt);
	var otherimgs = new Array(7);
	
  for(var i=0;i<buttoncnt;i++) 
  {
   offbtn[i] = new Image();
   offbtn[i].src = "./buttons/bn"+navimgNames[i]+"_off.jpg" ;
  }  
  for(var i=0;i<buttoncnt;i++) 
  {
   onbtn[i] = new Image();
   onbtn[i].src = "./buttons/bn"+navimgNames[i]+"_on.jpg";
  }
function setActivePg(imgName){
	if(prevImgName != imgName)
	{
		prevImgName = imgName;
	}
}
function imgOn(imgName)
{
	if (document.images)
	{
		for(var i=0;i<buttoncnt;i++) 
		{
			document.images[i].src = "./buttons/bn"+navimgNames[i]+"_off.jpg";
		}  
		document.images[imgName].src = "./buttons/bn"+imgName+"_on.jpg";
	}
}
function imgOff(imgName)
{
	imgOn(prevImgName);
}
function getLayer(id){
	
  if (document.all)			//   i.e. and Not "Opera")
   	return document.all[id];
  else if (document.layers)	//v4.76
		return document.layers[id];
	else if (document.getElementById(id))
		return document.getElementById(id);	//DOM Format (NN6)
	else
		return false;
}

function doBusinessHours(){
	var pLine = '<br />';
  pLine += '<tr><td width="100%"  class="pgfooting" align="center"> Open Daily 7:30am - 6:00pm</td></tr>';
  pLine += '<tr><td width="100%"  class="pgfooting" align="center"> Phone: 973-827-8881&nbsp;&nbsp;&nbsp;&nbsp;Fax: 973-827-9772</td></tr>';
  document.write(pLine);
}	// End doBusinessHours

function doLinkLine(){
	var pLine = '<br />';
	pLine +='<img src="./images/crcards2.gif" width="183" height="30" border="0" alt="We accept Visa and Mastercard" longdesc="Images of Visa and Mastercard" />';
	pLine +='<br /><br />';
	pLine +='<p style="text-align:center;background-color:transparent;" class="linkclass">';
	pLine +='<a href="index.html">Home</a> | ';
	pLine +='<a href="services.html">Services</a> | ';
	pLine +='<a href="about.html">About Us</a> | ';
	pLine +='<a href="directions.html">Directions</a> | ';
	pLine +='<a href="contact.html">Contact</a> | ';
	pLine +='<a href="links.html">Resources</a> | ';
	pLine +='<a href="gallery.html">Gallery</a> | ';
	pLine +='<a href="sitemap.html">SiteMap</a></p><br />';
	document.write(pLine);
}
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 = '';
	pLine +='<br/><span class="footnote">For best viewing, always use the latest browsers.<br/>';
	pLine +='<a class="footerA" href="http://www.upsdell.com/BrowserNews/find.htm" target="_blank">Click here for FREE browser upgrades</a>.<br/>';
	pLine +='<span class="footnote">Please report any problems viewing this site to the ';
	pLine +='<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%"  valign="top" cellpadding="0" cellspacing="0" border="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 align="left" valign="top"><img src="./images/logo_dca_sm.jpg" border="0" style="margin-right:5px;" alt="" /></td>';
	pLine +='<td class="footer" align="left" valign="top">&copy;&nbsp;' + g_COPYRIGHT + '.&nbsp;&nbsp;All rights reserved.';
	pLine +='<br/>Please report problems viewing this site as ';
	pLine +='<a class="footnote" href="mailto:'+g_WEBMASTERMAILTO + '?subject=Re: Website=' + g_CLIENTURL + ', Page=' + findCurPageName() + ', ';
	pLine +=getCompEnv();
	pLine +='">Comments to Webmaster</a><br/>';
	var sLine= 'Site last modified ' + g_sLASTUPDATE + '&nbsp;by ' +
		'<a class="footer" href="' + g_WEBMASTERURL + '" target="_blank">' + g_WEBMASTERNM + '</a>&nbsp; ' + g_WEBMASTERPH +	
		'<br/></td></tr></table>';
	pLine += sLine;
	document.write(pLine);
}	//End doFootingB

function doBackDoor(pageName,pgWidth){
	var sCopy = '';
	if(parent.length == 0) {
		if(!pgWidth){pgWidth = '563';}
		sCopy += '<table width="' + pgWidth + '" align="center" cellspacing="0" cellpadding="2" border="0">';	
		sCopy += '<tr><td width="40" class="cTitle"><a href="javascript:wheretoNext();" onmouseover="this.className=\'cButton1\';" onmouseout="this.className=\'cButton0\';" class="cButton0">Home</a></td>';
		sCopy += '<td align="center" width="' + pgWidth + '" class="cTitle">' + g_TITLE + ' - ' + pageName + '</td>';
		sCopy += '<td width="40" class="cTitle"><a href="javascript:wheretoNext();" onmouseover="this.className=\'cButton1\';" onmouseout="this.className=\'cButton0\';" class="cButton0">Home</a></td></tr></table></td></tr>';
		sCopy += '</table>';
		document.write(sCopy);
	}

}	//End doBackDoor

function wheretoNext(){
	if(window.name.indexOf("XXXXXXXX") == 0){
		window.close();
	}else{
		window.location.href="index.html";
	}
}

function openPopupWindow(filename, winWidth, winHeight, target) {
	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(target) popUpName = target;
	else if(g_PopUpName != 'undefined') popUpName = g_PopUpName;
	else popUpName = 'POPUP_';
		
//	var winParms = eval("'toolbar=no,location=no,directories=no,status=no,menubar=yes,scrollbars=yes,resizable=yes,copyhistory=yes,width=" + winWidth + ",height=" + winHeight + ",screenX="+X+",screenY="+Y+"'");
	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 winParms = 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,copyhistory=no,width=" + winWidth + ",height=" + winHeight';
//	winParms += '",screenX="' + X + '",screenY="' + Y + '"';
//	if(x) winParms += ',Left="' + x + '",Top="' + y + '"';

	var htmlcode;
	htmlcode="<!DOCTYPE HTML PUBLIC '-//W3C//DTD HTML 4.0 Transitional//EN'>";
	htmlcode+="<html><head><title>Click image to close window</title>";
	htmlcode+="<meta http-equiv='Content-Type' content='text/html'></head>";
	htmlcode+="<body bgcolor='#ffffff' text='#000000' leftmargin='0' topmargin='0' marginwidth='0' marginheight='0'>";
	htmlcode+="<a href=\"javascript:window.close();\"><img src='" + filename + "' border=\"0\" alt=\"\"></a></body></html>";
	
	var ran_unrounded=Math.random()*100;
	var ran_number=Math.round(ran_unrounded); 
	var randomname = popUpName+ran_number;
	
//	var winPopup = window.open("", randomname, winParms);
	var winPopup = window.open(filename, randomname, winParms);
	winPopup.document.write(htmlcode);
	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); 

//	window.open("./gallery/"+url,"REMOTEpopup","width="+W+",height="+H+",screenX="+X+",screenY="+Y+",left="+X+",top="+Y+",dependent=0,directories=0,location=0,menubar=0,personalbar=0,resizable=0,scrollbars=0,status=0,titlebar=0,toolbar=0")

//	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=no,menubar=no,scrollbars=yes,resizable=yes,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;
	}
//	if(x)	randomName.moveTo(x,y);

//	winObj.opener.name = "mainframe";	// sets new target <!--form target="mainframe" action="searcg.cgi"-->
//	winObj.moveTo(x,y);		// js ver 1.5

	return;
}	//End openRemote

self.status='';