﻿
function submitPage()
{
    aObligatory = Array("Name", "Company", "Tel", "Email");
    aObligatoryTitles = Array('שם',' שם חברה',' מספר טלפון',' כתובת מייל ');
    for (i = 0 ; i < aObligatory.length ; i++)
    {
        e = document.getElementById(aObligatory[i]);
        if (e.value == "")
        {
            sMsg = "נא הזן את הפרטים הבאים:%s";
            sMsg = sMsg.replace("%s", aObligatoryTitles[i]);
            alert(sMsg);
            e.focus();
            e.select();
            return false;
        }
    }
    
    regexp = /^[a-zA-Z][\w\.-]*[a-zA-Z0-9]@[a-zA-Z0-9][\w\.-]*[a-zA-Z0-9]\.[a-zA-Z][a-zA-Z\.]*[a-zA-Z]$/;
    if (!regexp.test(document.Login.Email.value))
    {
        alert("ערך לא חוקי");
        document.Login.Email.focus();
        document.Login.Email.select();
        return false;
    }
    
    document.Login.phone.value = document.Login.AreaCode.value + "-" + document.Login.Tel.value;
    return true;
}

function clickSubmit()
{
    if (!submitPage()) return;
    window.open("goalpage.asp","goalpage","menubar=0,resizable=0,directories=0,toolbar=0,location=0,scrollbars=0,width=10,height=10");
    document.Login.submit();
}

function nofollow(n) {
	n = n.replace(/\^/, '@'); 
	n = n.replace(/\~/, 'mailto:');
	n = n.replace(/\`/, '.');
	n = n.replace(/\!/, 'http://');
	n = n.replace(/\++/, '.asp');
	document.location.href=n; 
}


