function Connect() {
if ( document.client.username.value=="" ){
	alert("חובה לציין שם משתמש");
	document.client.username.focus();
	return(false); }
if ( document.client.password.value=="" ){
	alert("חובה לציין סיסמא");
	document.client.password.focus();
	return(false); }
return(true);
}

function NewUser() {
if ( document.LEVEL2.first_name.value=="" ){
	alert("חובה לציין שם פרטי");
	document.LEVEL2.first_name.focus();
	return(false); }
if ( document.LEVEL2.last_name.value=="" ){
	alert("חובה לציין שם משפחה");
	document.LEVEL2.last_name.focus();
	return(false); }

if ( document.LEVEL2.phone.value=="" ){
	alert("חובה לציין מספר טלפון");
	document.LEVEL2.phone.focus();
	return(false); }
if ( document.LEVEL2.phone.value.length < 7 ){
	alert("מספר טלפון לא תקין!");
	document.LEVEL2.phone.focus();
	return(false); }

if ( document.LEVEL2.email.value=="" ){
	alert("חובה לציין כתובת דוא\"ל");
	document.LEVEL2.email.focus();
	return(false); }

if ( document.LEVEL2.username.value=="" ){
	alert("חובה לציין שם משתמש");
	document.LEVEL2.username.focus();
	return(false); }
if ( document.LEVEL2.password.value=="" ){
	alert("חובה לציין סיסמא");
	document.LEVEL2.password.focus();
	return(false); }
if ( document.LEVEL2.password.value.length <= 3 ){
	alert("סיסמא מינימום 3 תווים!");
	document.LEVEL2.password.focus();
	return(false); }

if ( document.LEVEL2.domain.value=="" ){
	alert("חובה לציין כתובת דומיין לחשבונך");
	document.LEVEL2.domain.focus();
	return(false); }
if ( document.LEVEL2.domain.value==".interserv.co.il" ){
	alert("חובה לציין סאב דומיין לחשבונך");
	document.LEVEL2.domain.focus();
	return(false); }

if ( document.LEVEL2.domain.value.indexOf('www.') != -1 || document.LEVEL2.domain.value.indexOf('http://') != -1){
	alert("אין לציין בכתובת הדומיין www. או http://");
	s = new String(document.LEVEL2.domain.value);
	s = s.replace("www.","");
	s = s.replace("http://","");
	document.LEVEL2.domain.value = s;
	document.LEVEL2.domain.focus();
	return(false); }

return(true);
}

function NewOrder() {
if ( document.OrderNow.first_name.value=="" ){
	alert("חובה לציין שם פרטי");
	document.OrderNow.first_name.focus();
	return(false); }
if ( document.OrderNow.last_name.value=="" ){
	alert("חובה לציין שם משפחה");
	document.OrderNow.last_name.focus();
	return(false); }

if ( document.OrderNow.phone.value=="" ){
	alert("חובה לציין מספר טלפון");
	document.OrderNow.phone.focus();
	return(false); }
if ( document.OrderNow.phone.value.length < 7 ){
	alert("מספר טלפון לא תקין!");
	document.OrderNow.phone.focus();
	return(false); }

if ( document.OrderNow.email.value=="" ){
	alert("חובה לציין כתובת דוא\"ל");
	document.OrderNow.email.focus();
	return(false); }

return(true);
}

function NewContact() {
if ( document.ContactNow.first_name.value=="" ){
	alert("חובה לציין שם פרטי");
	document.ContactNow.first_name.focus();
	return(false); }
if ( document.ContactNow.last_name.value=="" ){
	alert("חובה לציין שם משפחה");
	document.ContactNow.last_name.focus();
	return(false); }

if ( document.ContactNow.phone.value=="" ){
	alert("חובה לציין מספר טלפון");
	document.ContactNow.phone.focus();
	return(false); }
if ( document.ContactNow.phone.value.length < 7 ){
	alert("מספר טלפון לא תקין!");
	document.ContactNow.phone.focus();
	return(false); }

if ( document.ContactNow.email.value=="" ){
	alert("חובה לציין כתובת דוא\"ל");
	document.ContactNow.email.focus();
	return(false); }

return(true);
}

function Domain() {
if ( document.form.username.value=="" ){
	alert("חובה לציין שם משתמש");
	document.form.username.focus();
	return(false); }
if ( document.form.password.value=="" ){
	alert("חובה לציין סיסמא");
	document.form.password.focus();
	return(false); }
return(true);
}

function GetInfo() {
	var x;
	x = "info.php?id=" + document.OrderNow.pack.value;
	window.open (x,"Information","menubar=0,resizable=0,width=350,height=250");
}

function isNumberKey(evt)
{
         var charCode = (evt.which) ? evt.which : event.keyCode
         if (charCode > 31 && (charCode < 48 || charCode > 57))
            return false;

         return true;
}

function CheckPassword()
{
	var str;
	var level = 0;
	str = document.LEVEL2.password.value;
	if ( str.length >= 3 && str.length <= 5 )
		level = 1;
	if ( str.length > 5 && str.length <= 10 )
		level = 2;
	if ( str.length > 10 )
		level = 3;

	if ( level == 0 )
		document.getElementById('pass_status').src = "images/0.jpg";
	if ( level == 1 )
		document.getElementById('pass_status').src = "images/1.jpg";
	if ( level == 2 )
		document.getElementById('pass_status').src = "images/2.jpg";
	if ( level == 3 )
		document.getElementById('pass_status').src = "images/3.jpg";

}

function collapse(sh)
{
	if( document.getElementById(sh).style.display== "none" )
  		document.getElementById(sh).style.display="";
	else
   		document.getElementById(sh).style.display="none";
}
