function rollOver( imageName, imageSrc ){
		document[imageName].src = imageSrc;
}


var timer,defimg,currentSub,tempSub,tempimg,tempsrc,currentimg,currentsrc;
pauselength = 750;


/*

	
	//if this has been clicked open already it is being shut
	if( thediv.style.display == "block"	){
		currentRewardDetail = "";
		
		showdetails = false;
	}
	
*/

function mover( str ){

	//rollout any current image if there is one:
	close_open_items();
	
	//clear timeout
	window.clearTimeout(timer);
	
	//mosueover the menu item
	
	imageSrc = "images/menu/" + str + "on.gif";
	imageName = str;
	rollOver( imageName, imageSrc, "" );
	if( document.getElementById(str+ "_submenu") ){
		thediv = document.getElementById(str + "_submenu");
		thediv.style.display = "block";
	}
	defimg = str;	//make it the default image now
	
	//hide the current submenu and rollout the temp images
	//if( tempSub != "" ){
		//hide( tempSub );
	//}
	
	//mouseout of the open menu image if there is one
	//and its not the current image
	//if( tempimg  != "" ){
		//if( document[ tempimg ] ){
			//if(tempimg != imageName){//dont mouseout if its the current image
			//	rollOver( tempimg, tempsrc, "" );	
			//}
		//}
	//}

	//show submenu if there is one
	//if( targSub != "" ){
		//show( targSub );
		//capture the name so you know what to shut off
		//tempSub = targSub;
	//}



}

function mout( str ){

	tempimg = str;
	tempsrc = "images/menu/" + str + "off.gif";	;
	
	//start timer - the timer will expire and close the submenu if not selected first
	timer = setTimeout( "closeTemp()", pauselength );


}

function sover(){
	window.clearTimeout(timer);
}

function sout(){
	timer = setTimeout( "closeTemp()", pauselength );
}

function closeTemp(){
	if( tempimg ){
		rollOver( tempimg, tempsrc, "" );
	}
	
	if( document.getElementById(tempimg + "_submenu") ){
			thediv = document.getElementById(tempimg + "_submenu");
			thediv.style.display = "none";
	}
}

var timer2,currSearcher;
pauselength2 = 500;

function open_searcher( str ){
	
	//close open items
	close_open_items();
	
	//hide the closed state
	thediv = document.getElementById("searcher_" + str + "_label_off");
	thediv.style.display = "none";
	currSearcher = str;
	
	//show the open state
	thediv = document.getElementById("searcher_" + str + "_label_on");
	thediv.style.display = "block";
	currSearcher = str;
	
}

function close_searcher( str ){

}

function close_open_items(){
	
	if( document.getElementById("searcher_" + currSearcher + "_label_on") ){
		thediv = document.getElementById("searcher_" + currSearcher + "_label_on");
		thediv.style.display = "none";
		
		thediv = document.getElementById("searcher_" + currSearcher + "_label_off");
		thediv.style.display = "block";
	}
	
	if( defimg ){
		defsrc = "images/menu/" + defimg + "off.gif";	
		rollOver( defimg, defsrc, "" );
		if( document.getElementById(defimg + "_submenu") ){
			thediv = document.getElementById(defimg + "_submenu");
			thediv.style.display = "none";
		}
	}
	
}

function open_searcher_link( showbg, str ){
	
	
	thediv = document.getElementById(str);
	if( showbg ){
		thediv.style.backgroundColor = "#90cae5";
	}
	window.clearTimeout(timer2);
	
}

function close_searcher_link( str ){
	
	thediv = document.getElementById(str);
	thediv.style.backgroundColor = "#f2f2f2";
	
	timer2 = setTimeout( "closeTempSearcher()", pauselength2 );
}

function closeTempSearcher(){

	//hide the open state
	thediv = document.getElementById("searcher_" + currSearcher + "_label_on");
	thediv.style.display = "none";
	
	//show the closed
	thediv = document.getElementById("searcher_" + currSearcher + "_label_off");
	thediv.style.display = "block";
	
}


currentmonth = 0;

function show_month( n ){
	
	
	thediv = document.getElementById("month_" + currentmonth);
	thediv.style.display = "none";
	
	thediv = document.getElementById("month_" + n);
	thediv.style.display = "block";
	currentmonth = n;
	
}