//script


function imgPopup(imgSrc) { 
window.open('/hagada/html/themes/Rhuknet/style/fileview.htm?'+imgSrc, 'imgWindow','width=150,height=150,resizable=1');
}

function WinOpen(PageToLoad,Names,w,h,t,s)	{
window.open(PageToLoad,Names,'width=' + w + ',height=' + h + ',toolbar=' + t + ',location=no,directories=no,status=yes,menubar=no,scrollbars='+ s + ',resizable=yes');
}


function SwapVis(id){
if (document.getElementById(id).style.display == ""){
show = "none";
}
else{
show = "";
}
document.getElementById(id).style.display = show;
}

function ValidateForm(form) {

if (form.subject.value=="") {
alert("חובה לכתוב את שמך");
form.subject.focus();
return false;
}
if (!isValidEmail(form.email.value)) {
alert("כתובת הדואר שהקשת אינה תקינה");
form.email.focus();
return false;
}
if (form.comment.value=="") {
alert("חובה לכתוב תגובה");
form.comment.focus();
return false;
}
if (form.security_code.value=="") {
alert("חובה להעתיק את הקוד");
form.security_code.focus();
return false;
}
document.getElementById('btnSubmit').disabled=true;
return true;
}

function ValidateForm1(form) {

if (form.subject.value=="") {
alert("חובה לרשום את שמך");
form.subject.focus();
return false;
}
if (!isValidEmail(form.email.value)) {
alert("כתובת הדואר שהקשת אינה תקינה");
form.email.focus();
return false;
}
if (form.comment.value=="") {
alert("חובה לכתוב תגובה");
form.comment.focus();
return false;
}
if (form.security_code.value=="") {
alert("חובה להעתיק את הקוד");
form.security_code.focus();
return false;
}
document.getElementById('btnSubmit').disabled=true;
return true;
}		

function isValidEmail (email) {
if (email == '') return true;

invalidChars = ' /;,:';

for (i=0; i < invalidChars.length; i++) {
badChar = invalidChars.charAt(i);
if (email.indexOf(badChar,0) > -1) return false;
}

atPos = email.indexOf('@', 1);
if (atPos == -1) return false;
if (email.indexOf('@', atPos + 1) != -1) return false;

periodPos = email.indexOf('.', atPos);
if (periodPos == -1) return false;
if (periodPos+3 > email.length) return false;

return true;
}		
