/*--------------------------------------------------------
 connexions global site javascript created by Mat C, 3 Aug 06
---------------------------------------------------------*/

function preLoadImages() {
	imagesArray = new Array();
	n = 0;
	if (document.images) {
		for (i=0; i<document.images.length; i++) {
			if (document.images[i].src.indexOf("_off.png")>0) { 
				img_on = document.images[i].src;
				img_on = img_on.substring(0,img_on.length-8) + "_on.png";
				imagesArray[n] = new Image();
				imagesArray[n].src = document.images[i].src;
				imagesArray[n+1] = new Image();
				imagesArray[n+1].src = img_on; 
				n = n+2;
			}
		}
	}
}


function mouseOut(imgName) {
	if (document.images) {
		img_on = document.images[imgName].src;
		document.images[imgName].src = img_on.substring(0,img_on.length-6) + "off.png";
	}
}


function mouseOver(imgName) {
	if (document.images) {	
		img_on = document.images[imgName].src;
		document.images[imgName].src = img_on.substring(0,img_on.length-7) + "on.png";
	}
}

function checkSearch() {
	search_box = document.getElementById("search_box")
	if ((search_box.value == "")||(search_box.value == "Enter search")){
		alert('Please enter text to search for.');
		search_box.value = "";
		search_box.focus();
		return false;
	} else {
		return true;
	}
}

function clearBox(obj) {
	obj.value = "";
}