function newImage(arg) {
	if (document.images) {
		rslt = new Image();
		rslt.src = arg;
		return rslt;
	}
	return false;
}

function changeImages() {
	if (document.images && (preloadFlag == true)) {
		for (var i=0; i<changeImages.arguments.length; i+=2) {
			document[changeImages.arguments[i]].src = changeImages.arguments[i+1];
		}
	}
}

var preloadFlag = false;
function preloadImages() {
	if (document.images) {
		Nav_Calender_over = newImage("../htmlimages/Nav_Calender_over.gif");
		Nav_ThingsToDo_over = newImage("../htmlimages/Nav_ThingsToDo_over.gif");
		Nav_Resources_over = newImage("../htmlimages/Nav_Resources_over.gif");
		Nav_TheCounties_over = newImage("../htmlimages/Nav_TheCounties_over.gif");
		preloadFlag = true;
	}
}

function businessSearch(formname, repostpage){
		if(repostpage.length > 0){
				document.getElementById(formname).action = repostpage				 
		}
		document.getElementById(formname).submit()
}

function pagerclick(newpage){
		
		var theform = document.getElementById("pagerform")
		var thepage = document.getElementById("pagenum")
		thepage.value = newpage
		
		theform.submit()
		
}

function changeMonth(){

		var theform = document.getElementById("monthchange")
		var themonth = document.getElementById("monthselect").options[document.getElementById("monthselect").selectedIndex].value
		
		if(themonth != -1){		
				theform.submit()
		}
}
function showform(){

	var UploadWindow =window.open("addEvent.php","NewWindow",
   "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,copyhistory=0,width=800,height=600");
   UploadWindow.location = "add_event.php"; 
}
function previousCounties()
{
	document.getElementById( "previousCounties" ).style.display = "none";
	document.getElementById( "moreCounties" ).style.display = "block";
	document.getElementById( "counties_page2" ).style.display = "none";
	document.getElementById( "counties_page1" ).style.display = "block";
	window.scrollTo( 0, 0 );
}
function nextCounties()
{
	document.getElementById( "previousCounties" ).style.display = "block";
	document.getElementById( "moreCounties" ).style.display = "none";
	document.getElementById( "counties_page2" ).style.display = "block";
	document.getElementById( "counties_page1" ).style.display = "none";
	window.scrollTo( 0, 0 );
}
