function preloadImages(){ //  Example: preloadImages('file.gif', 'http://www.x.com/y.gif');
	if(document.images){
		if(!document.imageArray) document.imageArray = new Array();
			var i,j = document.imageArray.length, args = preloadImages.arguments;
    
			for(i=0; i<args.length; i++){
				if (args[i].indexOf("#")!=0){
					document.imageArray[j] = new Image;
					document.imageArray[j++].src = args[i];
			}
		}
	}
}

function switchImage(imgName, imgSrc){
	if (document.images){
		if (imgSrc != "none"){
			document.images[imgName].src = imgSrc;
	    }
	}
}

function getPage(mypage,myname,w,h,scroll,winPos,location,dirs,status,menubar,toolbar,resize){
	
	if(winPos == "random") {
		LeftPosition = (screen.width)?Math.floor(Math.random() * (screen.width - w)):100;
		TopPosition = (screen.height)?Math.floor(Math.random() * ((screen.height - h) - 75)):100;
	
	}
	
	else if(winPos == "center") {
		LeftPosition = (screen.width)?(screen.width - w) / 2:100;
		TopPosition = (screen.height)?(screen.height - h) / 2:100;
	
	}
	
	else if ((winPos != "center" && winPos != "random") || winPos==null) {
		LeftPosition = (screen.width)?(screen.width - w) - 10:100;
		TopPosition = 5;
	
	}
	
	settings = 'width='+ w +',height='+ h +',top='+ TopPosition +',left='+ LeftPosition +',scrollbars='+ scroll +',location=' + location + ',directories=' + dirs + ',status=' + status + ',menubar=' + menubar + ',toolbar=' + toolbar + ',resizable=' + resize;
	popWin = window.open(mypage,myname,settings);

}



function valRequestInfoForm(){
	if (request.uName.value == ""){
		alert("Please enter your name.");
		document.request.uName.focus();
		return false;
	} else if (document.request.uEmail.value == ""){
		alert("Please enter your email address.");
		document.request.uEmail.focus();
		return false;
	} else if (document.request.uInstructions.value == ""){
		alert("What information are you requesting?");
		document.request.uInstructions.focus();
		return false;
	} else {
		return true;
	}
}
			
function valEventSubmitForm(){
	if (document.eventForm.txtEventTitle.value == ""){
		alert("Please fill in your Event Title.");
		document.eventForm.txtEventTitle.focus();
		return false;
	} else if (document.eventForm.txtStartDate.value == ""){
		alert("Please select the Start Date for your event.");
		document.eventForm.txtStartDate.focus();
		return false;
	} else if (document.eventForm.txtEndDate.value == ""){
		alert("Please select the End Date for your event.");
		document.eventForm.txtEndDate.focus();
		return false;
	} else if (document.eventForm.txtLocation.value == ""){
		alert("Please enter the name of the venue at which your event will be held.");
		document.eventForm.txtLocation.focus();
		return false;
	} else if (document.eventForm.txtAddress.value == ""){
		alert("Please enter the address of the venue hosting your event.");
		document.eventForm.txtAddress.focus();
		return false;
	} else if (document.eventForm.txtCity.value == ""){
		alert("Please enter the City in which your event is being held.");
		document.eventForm.txtCity.focus();
		return false;
	} else if (document.eventForm.txtState.value == ""){
		alert("Please enter the State in which your event is being held.");
		document.eventForm.txtState.focus();
		return false;
	} else if (document.eventForm.txtCountry.value == ""){
		alert("Please enter the Country in which your event is being held.");
		document.eventForm.txtCountry.focus();
		return false;
	} else if (document.eventForm.txtZipCode.value == ""){
		alert("Please enter the Zip Code in which your event is being held.");
		document.eventForm.txtZipCode.focus();
		return false;
	} else if (document.eventForm.txtBrief.value == ""){
		alert("Please enter a brief description of your event.");
		document.eventForm.txtBrief.focus();
		return false;
	} else if (document.eventForm.txtDescription.value == ""){
		alert("Please enter a description of your event.");
		document.eventForm.txtDescription.focus();
		return false;
	} else {
		return true;
	}
}	
function openVoyageur() {
	url = "dispatcher_detect.asp";
	userWidth = screen.availWidth;
	userHeight = screen.availHeight;

	if (userWidth < 1024) {
		if (userWidth < 800) {
			width = 620;
			height = 307;
		}
		else {
			width = 780;
			height = 386;
		}
	} else {
		width = 1000;
		height = 495;			 	
	}
		
	x = (640 - width)/2;
	y = (480 - height)/2;

	if (screen) {
		y = (screen.availHeight - height)/2;
		x = (screen.availWidth - width)/2;
	}
	if (screen.availWidth > 1800) { 
		x = ((screen.availWidth/2) - width)/2; 
	}
		
voyageur = window.open(url, 'voyageur', 'width='+width+', height='+height+', screenX='+x+', screenY='+y+', top='+y+', left='+x);
}
function openWindow(regionid,catid,b_id,cat_parent) {
	url= "detectFlash.asp?region_Id=" + regionid + "&buttonCatId=" + catid + "&bid=" + b_id + "&cat_parent=" + cat_parent + "&topMap=map_231JuneauCounty.swf";
	userWidth = screen.availWidth;
	userHeight = screen.availHeight;
	
	if (userWidth <= 1024)
			if (userWidth < 800) {
				width = 620;
				height = 307;
			}
			else {
				width = 780;
				height = 386;
			}
	else {
		width = 1000;
		height = 495;			 	
	}
		
    x = (640 - width)/2;
	y = (480 - height)/2;

    if (screen) {
        y = (screen.availHeight - height)/2;
        x = (screen.availWidth - width)/2;
    }
	if (screen.availWidth > 1800) { 
	x = ((screen.availWidth/2) - width)/2; 
    } 
newWin = window.open(url,'voyageur','width='+width+',height='+height+',screenX='+x+',screenY='+y+',top='+y+',left='+x);
}