function CheckForm(f){
	var bool=false;

	if( f.Username.value.length==0 || f.Username.value=="אימייל"){
		alert("הזן שם משתמש בבקשה");
		f.Username.focus();
		bool=false;	
	}else if( f.Password.value.length==0){
		alert("הזן סיסמה בבקשה");
		f.txtPassword.focus();
		bool=false;	
	}else{
		bool=true;
	}

	return bool;
			
}

function CheckEmail(src) {
	if( src.length>0 ){
		var emailReg = "^[\\w-_\.]*[\\w-_\.]\@[\\w]\.+[\\w]+[\\w]$";
		var regex = new RegExp(emailReg);
		return regex.test(src);
	}else{
		return false;
	}
}

function Send_Mail(){
	f=document.LoginForm;
	if( f.SendMail.value.length=0){
		alert('הזן דוא"ל בבקשה.')
		f.SendMail.focus();
	}else if(!CheckEmail(f.SendMail.value)){
		alert('הזן דוא"ל חוקי בבקשה.')
		f.SendMail.focus();
	}else{
		//f.action="<?=$_SERVER["PHP_SELF"]?>"
		f.submit();
	}
}

function dispaysendmail(){

	if (document.getElementById("regular").style.display=="none") {  
        document.getElementById("sendpass").style.display = "none";
		document.getElementById("regular").style.display = "";
	}else{            
		document.getElementById("regular").style.display = "none";
        document.getElementById("sendpass").style.display = "";
		document.getElementById("SendMail").value=document.getElementById("Username").value;
	}
}	 

function getCookie(c_name){
	//alert("document.cookie="+document.cookie+"\ndocument.cookie.length="+document.cookie.length);
if (document.cookie.length>0)
  {
  c_start=document.cookie.indexOf(c_name + "=")
  if (c_start!=-1)
    { 
    c_start=c_start + c_name.length+1 
    c_end=document.cookie.indexOf(";",c_start)
    if (c_end==-1) c_end=document.cookie.length
		//alert(unescape(document.cookie.substring(c_start,c_end)));
    return unescape(document.cookie.substring(c_start,c_end))
    } 
  }
return null
}

function checkCookie(){

	var cookies_support=getCookie('COOKIES_SUPPORT');
	if( cookies_support!=1 && cookies_support!="1" ){
				
		str="<TABLE bgcolor='#ff0000' style='border: solid 0px black'>";
		str=str+"<TR><TD style='font-size: 13px; color: white; font-weight: bold; padding-right: 10px; padding-left: 10px; padding-top: 7px; padding-bottom: 7px;'>אפשרות הדפדפן שלך עבור 'Cookies' לא מופעלת.<BR>אנא הפעל אותה על מנת שתוכל להנות משרותי האזור האישי.</TD></TR>";
		str=str+"</TABLE><BR>&nbsp;";
		document.getElementById("java_support").innerHTML=str;
		document.getElementById('java_support').style.visibility = 'visible';
		document.getElementById('java_support').style.display='block';

	}
}

function check_kones_restore(x){
	if( x.length=0){
		alert('הזן דוא"ל בבקשה.')
		return false;
	}else if(!CheckEmail(x)){
		alert('הזן דוא"ל חוקי בבקשה.')
		return false;
	}else{
		return true;
	}
}

function CheckHomeTypeID(id){
	if(id==33 || id==44 || id==34 ){
		if(document.getElementById('td_rooms')) document.getElementById('td_rooms').style.display='none'; 
		if(document.getElementById('td_until_rooms')) document.getElementById('td_until_rooms').style.display='none';
	}else{
		if(document.getElementById('td_rooms')) document.getElementById('td_rooms').style.display='';
		if(document.getElementById('td_until_rooms')) document.getElementById('td_until_rooms').style.display='';
	}

}


