function ChangeLanguage() {
selectlang = document.lng.language;
destination = selectlang.options[selectlang.selectedIndex].value;
if (destination) location.href = destination;
}



function showDetails(which) {
if (document.getElementById) answerDiv = eval("document.getElementById('" + which + "').style")
else answerDiv = eval(which + ".style")
if (answerDiv.display=="none") answerDiv.display="block"
else answerDiv.display="none"
}



function validate(theForm) {
if (theForm.name.value == "") {
	alert("נא למלא שם");
	theForm.name.focus();
	return (false);
	}
if (theForm.email.value == "") {
	alert("נא למלא כתובת אימייל");
	theForm.email.focus();
	return (false);
	}
if (theForm.email.value.indexOf("@")<1 || theForm.email.value.indexOf(".")<1) {
	alert("נא למלא כתובת אימייל תקינה");
	theForm.email.focus();
	return (false);
	}
if (theForm.comments.value == "") {
	alert("נא למלא הודעתך");
	theForm.comments.focus();
	return (false);
	}
return (true);
}

function validate_eng(theForm) {
if (theForm.name.value == "") {
	alert("Please fill in your name");
	theForm.name.focus();
	return (false);
	}
if (theForm.email.value == "") {
	alert("Please fill in your email");
	theForm.email.focus();
	return (false);
	}
if (theForm.email.value.indexOf("@")<1 || theForm.email.value.indexOf(".")<1) {
	alert("Please fill in a valid email address");
	theForm.email.focus();
	return (false);
	}
if (theForm.comments.value == "") {
	alert("Please fill in your message");
	theForm.comments.focus();
	return (false);
	}
return (true);
}


function validateml(theForm) {
if (theForm.name.value == "") {
	alert("נא למלא שם");
	theForm.name.focus();
	return (false);
	}
if (theForm.email.value == "") {
	alert("נא למלא כתובת אימייל");
	theForm.email.focus();
	return (false);
	}
if (theForm.email.value.indexOf("@")<1 || theForm.email.value.indexOf(".")<1) {
	alert("נא למלא כתובת אימייל תקינה");
	theForm.email.focus();
	return (false);
	}
if (theForm.strCAPTCHA.value == "") {
	alert("נא למלא את המספרים שבתמונה");
	theForm.strCAPTCHA.focus();
	return (false);
	}
return (true);
}

function validateml_eng(theForm) {
if (theForm.name.value == "") {
	alert("Please fill in your name");
	theForm.name.focus();
	return (false);
	}
if (theForm.email.value == "") {
	alert("Please fill in your email");
	theForm.email.focus();
	return (false);
	}
if (theForm.email.value.indexOf("@")<1 || theForm.email.value.indexOf(".")<1) {
	alert("Please fill in a valid email address");
	theForm.email.focus();
	return (false);
	}
if (theForm.strCAPTCHA.value == "") {
	alert("Please fill in the picture numbers");
	theForm.strCAPTCHA.focus();
	return (false);
	}
return (true);
}






function trimAll(sString) {
while (sString.substring(0,1) == ' ') {
	sString = sString.substring(1, sString.length);
	}
while (sString.substring(sString.length-1, sString.length) == ' ') {
	sString = sString.substring(0,sString.length-1);
	}
return sString;
}




function validatesearch(theForm) {
var  my_search_fld = theForm.search_fld.value;
if (trimAll(my_search_fld) == "") {
	alert("נא להזין ערך לחיפוש");
	theForm.search_fld.focus();
	return (false);
	}
if (trimAll(my_search_fld).length<3) {
	alert("עליך להזין 2 תווים ומעלה");
	theForm.search_fld.focus();
	return (false);
	}
return (true);
}

function validatesearch_eng(theForm) {
var  my_search_fld = theForm.search_fld.value;
if (trimAll(my_search_fld) == "") {
	alert("Please fill in a search string");
	theForm.search_fld.focus();
	return (false);
	}
if (trimAll(my_search_fld).length<3) {
	alert("Search string should consist of more than 2 characters");
	theForm.search_fld.focus();
	return (false);
	}
return (true);
}