﻿function onAnswerClick (clickedRB) {
	document.getElementById (clickedRB.name + "_" + clickedRB.value).style.display = "block";
	document.getElementById (clickedRB.name + "_" + Math.abs (Number (clickedRB.value)-1)).style.display = "none";
}
function debug (_str) {
	document.getElementById ("debug").innerHTML += _str + "<br />";
}
function openWindow(theURL,winName,features, myWidth, myHeight, isCenter) {
		if(window.screen)if(isCenter)if(isCenter=="true"){
		var myLeft = (screen.width-myWidth)/2;
		var myTop = (screen.height-myHeight)/2;
		features+=(features!='')?',':'';
		features+=',left='+myLeft+',top='+myTop;
	}
	window.open(theURL,winName,features+((features!='')?',':'')+',width='+myWidth+',height='+myHeight);
}
function openGlossary() {
	openWindow('glossary.html','Glossary','', '375', '405', true);
}
/*function isTel(e){	
	var strCheck = '0123456789-';
	var whichCode = (window.Event) ? e.which : e.keyCode;	
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) >-1 ) return  true;
		else return false;
	}
}
function isMail(e){	
	var strCheck = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-_.@';
	var whichCode = (window.Event) ? e.which : e.keyCode;		
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) == -1 ) return false;
		else return true;
	}
}
function isNmbr(e){	
	var strCheck = '0123456789';
	var whichCode = (window.Event) ? e.which : e.keyCode;	
	if (whichCode != 0){
		if (whichCode == 13) return true;
		key = String.fromCharCode(whichCode);
		if (strCheck.indexOf(key) >-1 ) return  true;
		else return false;
	}
}*/

function validateForm(){
	Fname=document.form1.Fname.value;
	if (Fname==""){
		msg="יש למלא שם פרטי";
		alert(msg);
		document.form1.Fname.focus();
		return;
	}
	Lname=document.form1.Lname.value;
	if (Lname=="") {
		msg="יש למלא שם משפחה";
		alert(msg);
		document.form1.Lname.focus();
		return;
	}	
		
	/*
	Email=document.form1.Email.value;
	if (Email=='') {
		msg= "יש למלא דוא''ל";
		alert(msg);
		document.form1.Email.select();
		return;
	}	
	if ((Email.indexOf("@")<2) || (Email.lastIndexOf(".")<=(Email.indexOf("@")+2) || ((Email.length<8)) || (Email.charAt(0) == "-" || Email.charAt(0) == "_" || Email.charAt(0) == "@" || Email.charAt(0) == "-" || Email.charAt(0) == "_" || Email.charAt(0) == "."))) {
		msg= "יש למלא דוא''ל תקין";
		alert(msg);
		document.form1.Email.select();
		return;
	}
	Phone=document.form1.Phone.value;
	if (Phone=="") {
		msg="יש למלא טלפון";
		alert(msg);
		document.form1.Phone.select();
		return;
	} 
	*/
	
	
	City=document.form1.City.value;
	if (City=="") {
		msg="יש למלא עיר";
		alert(msg);
		document.form1.City.focus();
		return;
	}
	
	Adress=document.form1.Adress.value;
	if (Adress=="") {
		msg="יש למלא כתובת";
		alert(msg);
		document.form1.Adress.focus();
		return;
	}
	num=document.form1.num.value;
	if (num=="") {
		msg="יש למלא מספר בית";
		alert(msg);
		document.form1.num.focus();
		return;
	}
	Zip=document.form1.Zip.value;
	if (Zip.length < 5) {
		msg="יש למלא מיקוד";
		alert(msg);
		document.form1.Zip.focus();
		return;
	}
	document.form1.Adress.value = Adress + " " + num;
	document.form1.submit();
}