// redirect non standards complient browsers
if (!document.getElementById) {
    window.location = 
	   "/browser_upgrade.php"
}


function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()');
		eval(imgObj+'.src = "'+imgSrc+'"');
	}
}
		
function changeImage(imgName,imgObj) {
	if(document.images) {
		document.images[imgName].src = eval(imgObj+'.src');
	}
}

function formFocus(id) {
	if(document.getElementById) {
		var formField = document.getElementById(id);
		formField.style.backgroundColor = "#9FE8FF";
	}
}
function formBlur(id) {
	if(document.getElementById) {
		var formField = document.getElementById(id);
		formField.style.backgroundColor = "#F9F9F9";
	}
}

// popup window code
var IE = navigator.appVersion.indexOf("MSIE")>0;
var msieIndex = navigator.appVersion.indexOf("MSIE") + 5;
var version = parseFloat(navigator.appVersion.substr(msieIndex,3))
var IE4 = IE && version>=4 && version<5;
var IE5 = IE && version>=5;
var Macintosh = navigator.userAgent.indexOf('Mac')>0;

function spawnWithScrollbars(URL,windowName,width,height) {
				// default amounts in case they are running an old browser
				var w = 800;
				var h = 600;
				if (document.all || document.layers || document.getElementById) {
				   w = window.screen.availWidth ;
				   h = window.screen.availHeight;
				}
				var leftPos = (w-width)/2, topPos = (h-height)/2;
 				if (Macintosh) {
 					if (IE4) { newheight = 17 + height; }
 					else { newheight = height; }
 				}
 				else { newheight = height; }
 				var msgWindow = window.open(URL, windowName, "scrollbars=yes,toolbar=no,location=no,status=yes,menubar=no,top=0,left=0,width="+width+",height="+newheight+",resizable=yes,top="+topPos+",left="+leftPos );
}

function spawn(URL,windowName,width,height) {
				// default amounts in case they are running an old browser
				var w = 480;
				var h = 340;
				if (document.all || document.layers || document.getElementById) {
				   w = window.screen.availWidth ;
				   h = window.screen.availHeight;
				}
				var leftPos = (w-width)/2, topPos = (h-height)/2;
 				if (Macintosh) {
 					if (IE4) { newheight = 17 + height; }
 					else { newheight = height; }
 				}
 				else { newheight = height; }	
 				window.open(URL, windowName, "toolbar=no,location=no,status=yes,menubar=no,top=0,left=0,scrollbars=no,width="+width+",height="+newheight+",resizable=no,top="+topPos+",left="+leftPos );
}