
//preload footer images
preload("footer_findout_off", "/images/footer/findout_off.gif");
preload("footer_findout_on", "/images/footer/findout_on.gif");
preload("footer_applyonline_off", "/images/footer/applyonline_off.gif");
preload("footer_applyonline_on", "/images/footer/applyonline_on.gif");

//preload arrow images
preload("arrow_left_off", "/images/mininav/arrow_left_off.gif");
preload("arrow_left_on", "/images/mininav/arrow_left_on.gif");
preload("arrow_right_off", "/images/mininav/arrow_right_off.gif");
preload("arrow_right_on", "/images/mininav/arrow_right_on.gif");

//function for preloading images
function preload(imgObj,imgSrc) {
	if (document.images) {
		eval(imgObj+' = new Image()')
		eval(imgObj+'.src = "'+imgSrc+'"')
	}
}

//function for changing images on mouseover
function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

//popup window for viewing an image or swf
function showMedia(imageName,winWidth,winHeight,titl,scrollbars) {  // v4.01
   	var posLeft = Math.floor( (screen.width - winWidth) / 2);
    var posTop = Math.floor( (screen.height - winHeight) / 2);
	newWindow = window.open("","newWindow","width="+winWidth+",height="+winHeight+",scrollbars="+scrollbars+",left="+posLeft+",top="+posTop);
	newWindow.document.write('<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">');
	newWindow.document.write('<html><title>'+titl+'</title><body bgcolor="#FFFFFF" leftmargin="0" topmargin="0" marginheight="0" marginwidth="0">'); 
	if (imageName.toString().indexOf('.swf') > 0 ){
		newWindow.document.write('<object classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0\" width=\"'+winWidth+'\" height=\"'+winHeight+'\">');
		newWindow.document.write('<param name=movie value=\"'+imageName+'\"><param name=quality value=high>');
		newWindow.document.write('<embed src=\"'+imageName+'\" quality=high pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash\" type=\"application/x-shockwave-flash\" width=\"'+winWidth+'\" height=\"'+winHeight+'\">');
		newWindow.document.write('</embed></object>');
	}else{
		newWindow.document.write('<img src=\"'+imageName+'\" width='+winWidth+' height='+winHeight+' alt=\"'+alt+'\">');
	}
	newWindow.document.write('</body></html>');
	newWindow.document.close();
	newWindow.focus();
}

bioVisible = false;
function toggleBio(){
	var id = 'bioBox';
	if (document.getElementById){
		document.getElementById(id).style.visibility = (bioVisible)?'hidden':'visible';
	}else if (document.all){
		document.all[id].style.visibility = (bioVisible)?'hidden':'visible';
	}else if (document.layers){
		document.layers[id].style.visibility = (bioVisible)?'hidden':'visible';
	}
	bioVisible = !bioVisible;
}

var popupWin = null;
function launchpolicy(url) {
	popupWin = window.open(url,"_new","toolbar=no,height=500,width=500,location=no,address=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,copyhistory=true"); 
	popupWin.focus();
}

var popupWin2 = null;
function launchpolicy2(url) {
	popupWin2 = window.open(url,"_new","toolbar=no,height=850,width=1000,location=no,address=no,directories=no,status=no,scrollbars=yes,resizable=yes,menubar=no,copyhistory=true"); 
	popupWin2.focus();
}

function launchVideo(vid, w, h){
	//this function is used by videos in the galleries
   	var posLeft = Math.floor( (screen.width - w) / 2);
    var posTop = Math.floor( (screen.height - h) / 2);
	videoWin = window.open("/video_viewer.asp?file="+vid+"&w="+w+"&h="+h,"_new","toolbar=no,height="+h+",width="+w+",location=no,address=no,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no,copyhistory=true,left="+posLeft+",top="+posTop); 
	videoWin.focus();
}

function launchTrailer(vid, w, h){
	//program intro videos popup window
	
	isNS6 = (!document.all && document.getElementById) ? true : false;
	if( isNS6 ) {
		//minimize height a little, for: moz, safari.
		h-=15;
	}

   	var posLeft = Math.floor( (screen.width - w) / 2);
    var posTop = Math.floor( (screen.height - h) / 2);
	videoWin = window.open(vid,"_new","toolbar=no,height="+h+",width="+w+",location=no,address=no,directories=no,status=no,scrollbars=no,resizable=yes,menubar=no,copyhistory=true,left="+posLeft+",top="+posTop); 
	videoWin.focus();
}

function launchVr(pg){
	// this one lanches the qtvr popups in the 
	// about us section
	var w = 535;
	var h = 385;
	var posLeft = Math.floor( (screen.width - w) / 2);
	var posTop = Math.floor( (screen.height - h) / 2);
	var jVr = window.open(pg, 'QuicktimeVr', "scrollbars=0,width="+w+",height="+h+",left="+posLeft+",top="+posTop);
	jVr.focus();
}

function overButton(o){
	o.style.backgroundColor = '#9F9F9F'; 
	o.style.cursor = 'pointer';
}

function outButton(o){
	o.style.backgroundColor = ''
	o.style.cursor = '';
}

