/* for nav pull-downs */
function showDiv(_id){
	div = document.getElementById(_id);
	div.style.display="block";
}
function hideDiv(_id){
	div = document.getElementById(_id);
	div.style.display="none";
}

/* for search box */
function submitOnEnter(evt) {
    evt = (evt) ? evt : event;
    var charCode = (evt.charCode) ? evt.charCode :
        ((evt.which) ? evt.which : evt.keyCode);
    if (charCode == 13 || charCode == 3) { //listen for enter keypress
        alert('Search function currently unavailable');
    } else {
        //do nothing
    }
}
/* simple color swapper */
function swapBG(_id,_color) {	
	var div = document.getElementById(_id);
	div.style.backgroundColor=_color;
}

/* shifter functions */
function shiftBG(_id) {	
	var div = document.getElementById(_id);
	switch(div.style.backgroundColor) {
		/*ie*/
		case "#ab4a9c": div.style.backgroundColor="#ffc50b"; break;
		case "#ffc50b": div.style.backgroundColor="#8ec6f4"; break;
		case "#8ec6f4": div.style.backgroundColor="#b3d234"; break;
		case "#b3d234": div.style.backgroundColor="#e34232"; break;
		case "#e34232": div.style.backgroundColor="#f4e847"; break;
		case "#f4e847": div.style.backgroundColor="#2cb740"; break;
		case "#2cb740": div.style.backgroundColor="#008eaf"; break;
		case "#008eaf": div.style.backgroundColor="#ec008c"; break;
		case "#ec008c": div.style.backgroundColor="#f26522"; break;
		case "#f26522": div.style.backgroundColor="#ab4a9c"; break;
		/*firefox*/
		case "rgb(171, 74, 156)": div.style.backgroundColor="#ffc50b"; break;
		case "rgb(255, 197, 11)": div.style.backgroundColor="#8ec6f4"; break;
		case "rgb(142, 198, 244)": div.style.backgroundColor="#b3d234"; break;
		case "rgb(179, 210, 52)": div.style.backgroundColor="#e34232"; break;
		case "rgb(227, 66, 50)": div.style.backgroundColor="#f4e847"; break;
		case "rgb(244, 232, 71)": div.style.backgroundColor="#2cb740"; break;
		case "rgb(44, 183, 64)": div.style.backgroundColor="#008eaf"; break;
		case "rgb(0, 142, 175)": div.style.backgroundColor="#ec008c"; break;
		case "rgb(236, 0, 140)": div.style.backgroundColor="#f26522"; break;
		case "rgb(242, 101, 34)": div.style.backgroundColor="#ab4a9c"; break;
		default: div.style.backgroundColor="#ab4a9c";		
	}
}
function shiftImg(_id) {
	var myTexts = new Array("joy_01.gif","joy_02.gif","joy_03.gif","joy_04.gif","joy_05.gif","joy_06.gif","joy_07.gif","joy_08.gif","joy_09.gif","joy_10.gif");
	var rand = Math.floor(Math.random()*myTexts.length);
	var img = document.getElementById(_id);
	img.src = "_images/"+myTexts[rand];
}
