/* grey.js */
/*
function CreateBookmarkLink(url,pgName,title) { 
var pLine='';
pLine='<p>document.title=' + document.title + '</p>';
document.write(pLine);
pLine='<p>location.href=' + location.href + '</p>';
document.write(pLine);
pLine='<p>location.protocol=' + location.protocol + '</p>';
document.write(pLine);
pLine='<p>location.host=' + location.host + '</p>';
document.write(pLine);
pLine='<p>location.hostname=' + location.hostname + '</p>';
document.write(pLine);
pLine='<p>location.port=' + location.port + '</p>';
document.write(pLine);
pLine='<p>location.pathname=' + location.pathname + '</p>';
document.write(pLine);
pLine='<p>location.search=' + location.search + '</p>';
document.write(pLine);
pLine='<p>location.hash=' + location.hash + '</p>';
document.write(pLine);


//pgName = "Webpage Title";   
// Blogger - Replace with <$BlogItemTitle$>  
// MovableType - Replace with <$MTEntryTitle$> url = "Webpage URL";  
// Blogger - Replace with <$BlogItemPermalinkURL$>   
// MovableType - Replace with <$MTEntryPermalink$>  
// WordPress - <?php bloginfo('url'); ?>	
	if (window.sidebar) { // Mozilla Firefox Bookmark	
//		window.sidebar.addPanel(title, url,"");	
		window.sidebar.addPanel(title, url, "");	
	} else if( window.external ) { // IE Favorite 		
		window.external.AddFavorite(url, pgName); 
	} else if(window.opera && window.print) { // Opera Hotlist		
		return true; 
	} 
}
*/
/*
//<script type="text/javascript">
//<!--
var url=location.href;
var lastSlash = url.lastIndexOf("/");
var curPage = url.substring(lastSlash+1,url.length);
//var dot = curPage.indexOf(".");
//curPage = curPage.substring(0,dot);
url = url.substring(0,lastSlash);
// url='http://www.dcawebdesign.com';

if (window.external) {											// IE Favorite 	
  document.write('<a href =      "javascript:CreateBookmarkLink(url,curPage)");">Add to Favorites</a>');   
} else  if (window.sidebar) {								// Mozilla Firefox Bookmark
  document.write('<a href =     "javascript:CreateBookmarkLink(url,curPage)");">Bookmark Page</a>'); 
} else if (window.opera && window.print) {	// Opera Hotlist	
  document.write('<a href =     "javascript:CreateBookmarkLink(url,curPage)");">Add Bookmark</a>'); 
} 
// -->
//</script>
*/
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="99%"  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">';
	pLine +='<img src="./images/spacer.gif" style="width:50px;height:2em;border:none;" 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 + ', Reviewed ' + g_sLASTREVIEW + '&nbsp;by ' +
		'<a class="footer" href="' + g_WEBMASTERURL + '" target="_blank">' + g_WEBMASTERNM + '</a>&nbsp; ' + 
		'<br/></td></tr></table>';
	pLine += sLine;
	document.write(pLine);
}	//End doFootingB
function openPopupWindow(url, winWidth, winHeight, winName) {
	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;		// Allowance for side scroll bar width
	winHeight += 30;	// Allowance for bottom 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">';
	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:#003366;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 + '" border="0" alt="" /></a></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); 

//	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
