﻿
function querySt(ji) {
    hu = window.location.search.substring(1);
    gy = hu.split("&");
    for (i = 0; i < gy.length; i++) {
        ft = gy[i].split("=");
        if (ft[0] == ji) {
            return ft[1];
        }
    }
}

function linkTo(url){
	location.href = url;
}

function popup(url, Width, Height, xPos, yPos, scroll) {
	var myNewWin = window.open(url, "NewWindow","toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars="+scroll+",resizable=no,copyhistory=no,width="+Width+",height="+Height);
}


function mnuOver(which,how){
	which.className=how;
}
function mnuOut(which,how){
	which.className=how;
}

function checkemail(formID,emailField,formAction) 
{
    var str = document.getElementById(emailField).value;
    var filter = /^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
    if (filter.test(str)) 
    {
        document.getElementById(formID).action = formAction;
        document.getElementById(formID).submit();
    }
    else 
    {
        alert("!נא להזין כתובת חוקית");
        document.getElementById(emailField).value = '';
        document.getElementById(emailField).focus();
        return false;
    }
}

function checkField(formID, fieldName, formAction) 
{
    var str = document.getElementById(fieldName).value;
    var labelName = document.getElementById(fieldName).title;
    if (str == '') 
    {
        alert('!נא למלא את השדה "' + labelName + '" לפני השליחה');
        document.getElementById(fieldName).focus();
        return false;
    }
    else 
    {
        if( formAction!='') document.getElementById(formID).action = formAction;
        document.getElementById(formID).submit();
    }
}