function printPage(){
	if (document.print) {
		document.print();
		//history.back();
	} else {
		if (window.print) {
			window.print();
			//history.back();
		} else {
			var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
			document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
			WebBrowser.ExecWB(6, 2);
			//Use a 1 vs. a 2 for a prompting dialog box    
			WebBrowser.outerHTML = "";
			//history.back();
		}
	}
}
function emailPage(){
	sUrl = '/forms/form_email_friend.asp?strPageTitle=' + escape(document.title) + '&strURL=' + escape(location.href);
	location.href=sUrl;
}
function HighlightDDMenus(){
	aUrl = location.href.split('/');
	sUrl = aUrl[aUrl.length-1];
	sUrl = sUrl.toLowerCase();
	sUrl = sUrl.replace('&amp;','&');
	// alert(sUrl);
	
	for(i=0; i<document.forms.length;i++){
		for(t=0; t< document.forms[i].elements.length; t++){
			if(document.forms[i].elements[t].name =='Info for'){
				for(o = 0; o<document.forms[i].elements[t].options.length; o++){
					sVal = document.forms[i].elements[t].options[o].value.toLowerCase();
					sVal = sVal.replace('&amp;','&');
					if(sVal==sUrl){
						document.forms[i].elements[t].options[o].selected=true;
					}
				}
			}
		}
	}
}
function openInfoFor(f) {
	var selectBox = f.infofor;
	var sURL = selectBox.options[selectBox.selectedIndex].value;
	if(location.href.indexOf('.asp')>=0){
		// sURL = '/site/' + sURL; //NAD Commented out as this will cause failure on ground site.
	}
	location.href = sURL;
	return false;
}

function openDDSub(f) {
	var selectBox = f.ddsub;
	var sURL = selectBox.options[selectBox.selectedIndex].value;
	if(location.href.indexOf('.asp')>=0){
		// sURL = '/site/' + sURL; //NAD Commented out as this will cause failure on ground site.
	}
	location.href = sURL;
	return false;
}


function makePopups() {
	a = document.getElementsByTagName('a');
	for (i = 0; i<a.length; i++) {
		if (a[i].className == 'popup') a[i].onclick = Pop;
	}
}

function Pop() {
	switch(this.target) {
		case 'landscape': var dimensions = 'width=430,height=430'; break;
		case 'portrait' : var dimensions = 'width=350,height=510'; break;
	}
	var features = dimensions+",left=100,top=120,scrollbars=yes,toolbar=no,location=no,directories=no,status=no,menubar=no,resizable=no";
	window.open(this.href, this.target, features);
	return false;
}


var oPopupWin = null;

function popImg(uid, w, h){
	
	var iTitleBarHeight, iWindowBorderWidth;
	iTitleBarHeight = 24;
	iWindowBorderWidth = 4;
	var iScreenWidth, iScreenHeight;
	iScreenWidth = 800;
	iScreenHeight = 600;
	if (window.screen) {
	  if (window.screen.availWidth) {
		 // ok browser has the appropriate properties we need to centre it
		 iScreenWidth = window.screen.availWidth;
		 iScreenHeight = window.screen.availHeight;
	  }
	}
	var iWindowWidth = iWindowBorderWidth + w + iWindowBorderWidth;
	var iWindowHeight = iTitleBarHeight + h + iWindowBorderWidth;
	var iLeft = (iScreenWidth - iWindowWidth) / 2;
	var iTop = (iScreenHeight - iWindowHeight) / 2;

	var sSrc = document.getElementById(uid + '_src').innerHTML;
	var sAlt = document.getElementById(uid + '_alt').innerHTML;
	var sCaption = document.getElementById(uid + '_caption').innerHTML;
	var iImgWidth = document.getElementById(uid + '_width').innerHTML;   
	var iImgHeight = document.getElementById(uid + '_height').innerHTML;
   
   if (iImgWidth > iImgHeight) {
	   var sFormat = 'landscape';
   } else {
	   var sFormat = 'portrait';
   }
   
sHTML = '<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" \
"http://www.w3.org/TR/html4/loose.dtd"> \
<html lang="en"> \
<head> \
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1"> \
<meta name="language" content="english" /> \
<link href="/site_images/inc_lu/styles/css-links.css" rel="stylesheet" type="text/css">  \
<title>' + sAlt + '</title> \
<style type="text/css"> \
<!-- \
@import url("/site_images/inc_lu/styles/3-col.css"); \
--> \
</style> \
</head> \
<body style="background-color: #fff"> \
<div id="popup" class="' + sFormat + '"> \
<span> \
<a href="javascript:window.parent.close();"><img src="/site_images/inc_lu/gfx/X.gif" class="close" alt="close" width="16" height="14"></a> \
<a href="javascript:window.parent.close();">Close Window</a> \
</span> \
<img \
src="' + sSrc + '"  \
alt="' + sAlt + '"  \
width="' + iImgWidth + '"  \
height="' + iImgHeight + '"> \
<p>' + sCaption + '</p> \
<p><a href="javascript:window.parent.close();">Close Window</a></p> \
</div> \
</body> \
</html>';

	if (oPopupWin) {
		oPopupWin.close();
	}

	var sOptions = 'left='+iLeft+',top='+iTop+',screenX='+iLeft+',screenY='+iTop+',width='+w+',height='+h+',scrollbars=0,resizable=0,toolbar=0,location=0,directories=0,status=0,menubar=0,copyhistory=0';
	oPopupWin = window.open('', 'popupWin', sOptions);
	oPopupWin.document.write(sHTML);
	oPopupWin.document.close();
	if (window.focus) {oPopupWin.focus()}
}

function popTall(uid){
	 popImg(uid, 350, 510);
}

function popWide(uid){
	 popImg(uid, 430, 430);
}

