function linkChoose(i){
	for(k=1;k<=5;k++) {
		document.getElementById('but'+k).style.background = "url('images/button_blue.gif')";
	}
	if (i != 0) {
		document.getElementById('but'+i).style.background = "url('images/button_red.gif')";
	}
}
function echeck(str) {

		var at="@"
		var dot="."
		var lat=str.indexOf(at)
		var lstr=str.length
		var ldot=str.indexOf(dot)
		if (str.indexOf(at)==-1){
		   alert("כתובת אימייל לא חוקית")
		   return false
		}

		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr){
		   alert("כתובת אימייל לא חוקית")
		   return false
		}

		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr){
		   alert("כתובת אימייל לא חוקית")
		    return false
		}

		 if (str.indexOf(at,(lat+1))!=-1){
		   alert("כתובת אימייל לא חוקית")
		    return false
		 }

		 if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot){
		   alert("כתובת אימייל לא חוקית")
		    return false
		 }

		 if (str.indexOf(dot,(lat+2))==-1){
		   alert("כתובת אימייל לא חוקית")
		    return false
		 }
		
		 if (str.indexOf(" ")!=-1){
		   alert("כתובת אימייל לא חוקית")
		    return false
		 }

 		 return true					
	}

function ValidateForm(){

	var nameID=document.contact_us_frm.name
	var emailID=document.contact_us_frm.email
	var subjectID=document.contact_us_frm.subject
	var contact_messageID=document.contact_us_frm.contact_message
	var securityImageValueID=document.contact_us_frm.securityImageValue

	if ((nameID.value==null)||(nameID.value=="")){
//		alert("Please enter your name")
		alert("אנא הזן שם")
		nameID.focus()
		return false
	}
	if ((emailID.value==null)||(emailID.value=="")){
//		alert("Please enter your email")
		alert("אנא הזן כתובת אימייל")
		emailID.focus()
		return false
	}
	if (echeck(emailID.value)==false){
		alert("אנא הזן כתובת אימייל חוקית")
//		alert("Please enter a valid email")
		emailID.focus()
		return false
	}

	return true
 }
 
 function ValidateFastForm(){

	var nameID=document.fast_meeting_frm.fast_name
	var phoneID=document.fast_meeting_frm.fast_phone

	if ((nameID.value==null)||(nameID.value=="")){
//		alert("Please enter your name")
		alert("אנא הזן שם")
		nameID.focus()
		return false
	}
	if ((phoneID.value==null)||(phoneID.value=="")){
//		alert("Please enter your phone")
		alert("אנא הזן טלפון")
		phoneID.focus()
		return false
	}

	return true
 }
 
  function ValidateSearchForm(){

	var searchID=document.search_frm.Search_Value;

	if ((searchID.value==null)||(searchID.value=="")){
//		alert("Please enter search text")
		alert("אנא הזן טקסט לחיפוש")
		searchID.focus()
		return false
	}

	if (searchID.value.length<3) {
		alert ("Please insert text longer than 2 charecters");
		searchID.focus()
		return false
	}

	return true
 }