function imgOn(imgName) {
	if (document.images) {
    	document[imgName].src = eval(imgName + "on.src");
	}
}
//Function to deactivate images.
function imgOff(imgName) {
	if (document.images) {
    	document[imgName].src = eval(imgName + "off.src");
	}
}
function popUp(URL){
window.open(URL,'popUp','toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=yes,width=640,height=480');
}

//Function to activate popup.
function popUpAdv(URL, n, w, h, scrollYN, resizeYN){
window.open(URL, n,'toolbar=no,scrollbars=' + scrollYN + ',location=no,statusbar=no,menubar=no,resizable=' + resizeYN + ',width=' + w + ',height=' + h);
}

function popUpCenter(URL){
	var xSize,ySize,xPos,yPos;
	var newWinXSize,newWinYSize;
	
	//Replace these values with whatever you want
	newWinXSize=640;
	newWinYSize=480;
	xSize=screen.availWidth;
	ySize=screen.availHeight;
	
	xPos=(xSize-newWinXSize)/2;
	yPos=(ySize-newWinYSize)/2;
	//window.open(URL,'Popup Window','toolbar=no,scrollbars=no,location=no,statusbar=no,menubar=no,resizable=yes,width='+newWinXSize+',height='+newWinYSize+',top='+yPos+',left='+xPos);
	window.open(URL,'Popup','toolbar=no,scrollbars=yes,location=no,statusbar=no,menubar=no,resizable=yes,width='+newWinXSize+',height='+newWinYSize+',top='+yPos+',left='+xPos);
	/*
	//you can leave out the window.close()
	//function if you want to leave the
	//original window open.
	//you can change the other variables
	//to "yes" or "no" as appropriate.
	//just remember to keep the new
	//window definition on a single line
	//otherwise you'll throw an error.
	*/

}

function writeSource(div) {
	if (!document.getElementById) { return; }
	var o = document.getElementById(div);
	if (typeof(o) == "undefined" || o==null) { return; }
	var s = o.innerHTML;
	if (s==null || s.length==0) { 
		return;
		}
	else {
		var i;
		for(i=0;s.charAt(i)==" "||s.charAt(i)=="\n"||s.charAt(i)=="\r"||s.charAt(i)=="\t";i++) {}
		s = s.substring(i);
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)=="<") {
				s = s.substring(0,i) + "&lt;" + s.substring(i+1) ;
				}
			}
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)==">") {
				s = s.substring(0,i) + "&gt;" + s.substring(i+1) ;
				}
			}
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)=="\t") {
				s = s.substring(0,i) + "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;" + s.substring(i+1) ;
				}
			}
		for (i = s.length; i>0; i--) {
			if (s.charAt(i)=="\n") {
				s = s.substring(0,i) + "<BR>" + s.substring(i+1) ;
				}
			}
		s = s + "<BR>";
		}
	document.write('<A STYLE="font-family:arial; font-size:x-small; text-decoration:none;" HREF="#" onClick="var d=document.getElementById(\'jssource'+div+'\').style; if(d.display==\'block\'){d.display=\'none\';this.innerText=\'+ Show Source\';}else{d.display=\'block\';this.innerText=\'- Hide Source\';} return false;">+ Show Source</A><BR>');
	document.write('<SPAN ID="jssource'+div+'" STYLE="display:none;background-color:#EEEEEE"><TT>'+s+'</TT></SPAN>');
	}

function interstitialPopup(myurl) {
	var options = 'toolbar=no, directories=no, location=no, status=no, menubar=no, resizable=yes, scrollbars=no, width=836, height=430, left=100, top=100';
	OpenWin = this.open(myurl, "CtrlWindow", options);
	OpenWin.focus();
}
