/*
	Standards Compliant Rollover Script
	Author : Daniel Nolan
	http://www.bleedingego.co.uk/webdev.php
*/

function initRollovers() {
	if (!document.getElementById) return
	
	var aPreLoad = new Array();
	var sTempSrc;
	var aImages = document.getElementsByTagName('img');

	for (var i = 0; i < aImages.length; i++) {		
		if (aImages[i].className == 'imgover') {
			var src = aImages[i].getAttribute('src');
			var ftype = src.substring(src.lastIndexOf('.'), src.length);
			var hsrc = src.replace(ftype, '_o'+ftype);

			aImages[i].setAttribute('hsrc', hsrc);
			
			aPreLoad[i] = new Image();
			aPreLoad[i].src = hsrc;
			
			aImages[i].onmouseover = function() {
				sTempSrc = this.getAttribute('src');
				this.setAttribute('src', this.getAttribute('hsrc'));
			}	
			
			aImages[i].onmouseout = function() {
				if (!sTempSrc) sTempSrc = this.getAttribute('src').replace('_o'+ftype, ftype);
				this.setAttribute('src', sTempSrc);
			}
		}
	}
}

window.onload = initRollovers;

/*
	Popup window
*/
function PopIt(filename, h, w) {
     popupname = "popDialog"
     popup = window.open(filename,popupname,"height="+h+",width="+w+",scrollbars=yes")
     popup.focus()
}


/*
	Popup window (resizeable)
*/
function PopItResize(filename, h, w) {
     popupname = "popDialogRes"
     popup = window.open(filename,popupname,"height="+h+",width="+w+",scrollbars=yes,resizable=yes")
     popup.focus()
}

/*
	Popup window (calculators - resizable)
*/
function PopItCalc(filename, h, w) {
     popupname = "popDialog2"
     popup = window.open(filename,popupname,"height="+h+",width="+w+",scrollbars=yes,resizable=yes")
     popup.focus()
}

/*
	Popup window
*/
function PopItNoScroll(filename, h, w) {
     popupname = "popDialogNS"
     popup = window.open(filename,popupname,"height="+h+",width="+w+",scrollbars=no")
     popup.focus()
}

/* 
	On the PlanningServices.Home page, there are two popups.  each popup contains a link to find a financial planner - to load the dorado site, back in the main window.  This popup script gives a name to the parent window, so that when the link in the popup is clicked, the desired page loads in the parent window.
*/
function popUpParent(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=500,left = 100,top = 100');");
}