var state = 'none'; 

function showhide(layer_ref, sCallFunction) { //for showing and hiding DIVs

	if (state == 'block') { 
	state = 'none'; 
	} 
	else { 
	state = 'block'; 
	} 
	if (document.all) { //IS IE 4 or 5 (or 6 beta) 
	eval( "document.all." + layer_ref + ".style.display = state"); 
	} 
	if (document.layers) { //IS NETSCAPE 4 or below 
	document.layers[layer_ref].display = state; 
	} 
	if (document.getElementById &&!document.all) { 
	hza = document.getElementById(layer_ref); 
	hza.style.display = state; 
	} 
	
	if (sCallFunction!=""){eval(sCallFunction);}
} 

function Openme(newin, height, width) {
	NewWindow=window.open(newin,"NewWindow","resizable=yes,status=no,scrollbars=yes,width=" + width + ",height=" + height + ",top=15,left=15")
	window.NewWindow.focus();
}

function openthumb(newin) {
	NewThumbnail=window.open(newin,"NewThumbnail","resizable=yes,status=no,scrollbars=yes,width=800,height=500,top=15,left=15")
	window.NewThumbnail.focus();
}

function openImgZ(imglocation) {
	if(imglocation.indexOf(".pdf") >= 0){
		openthumb(imglocation);
	}
	else{
		openthumb("image_zoomed.asp?img=" + imglocation);
		//popImage("image_zoomed.asp?img=" + imglocation);
	}
}

function isValidEmail(VarString) {
if (VarString.search(/^\w+((-\w+)|(\.\w+))*\@[A-Za-z0-9]+((\.|-)[A-Za-z0-9]+)*\.[A-Za-z0-9]+$/) != -1)
	return true;
else
	return false;
}

function hideEmail() {
//customised with website owner's email address
	var s1 = "albert";
	var s2 = "@";
	var s3 = "albertjacob.net";
	var s4 = "?Subject=Enquiry%20from%20" + s3;
	var s5 = s1 + s2 + s3;
	document.write("<a href=" + "mail" + "to:" + s1 + s2 + s3 + s4 + ">" + s5 + "</a>");
}
