function validReg()
{


  for(i=0;i<11;i++)
 {

  if ( i!=3  && i!=4 && i!=6 && i!=8 && i!=9 && i!=10 )
    {
  
     val=document.frmReg.elements[i].value
     if(val=="")
       {
	   	  
	  	alert("Please insert all required data");		
	    document.frmReg.elements[i].focus();		
	    document.frmReg.elements[i].select();
		
	    return false
	    }//if
	 
	 }//if
	 
	 
	 
 }//for
return true;

   }//fun
   

//-------------------------------------------------------------------//
function validSel(y)
{
	
		  x=y.selectedIndex;
		  if (x==0)
		  {
			alert("Please insert all required data");		
	        y.focus();	
			 return false;
	   
		  }
		   return true;
	 
}


//------------------------------------------------------------------//

 function validMail(y)
{

if(y.value.length>0)
{
	atIndex=y.value.indexOf("@");
	dotIndex=y.value.indexOf(".");
	
	
	if (atIndex== "-1" || dotIndex== "-1" || (dotIndex-atIndex==1) )
	{
	  alert("Please enter a valid email.");
	  y.focus();
	  return (false);
	}
	
	
	
	
}

return true;

}
//-----------------------------------------------------------------//


function validEmptyGeneral(x)
{

if(x.value == "" || x.value == 0)
	{
	alert("Please insert all required data")
	x.select
	x.focus()
	return false;
	}
	
	return true;
}//whene call it  validateEmptyGeneral(formName.elementName)

//--------------------------------------------------------------------//


function validNum(y)
{
	

 val=y.value ;

if (val!="")

{
   
    str="0123456789 ";
    len=y.value.length;
	//alert(len)

   for(x=0;x<len;x++ )
      {
        if(str.indexOf(y.value.charAt(x))==-1)
        {
         alert("please Insert Number Only\n(don't include characters,space,'-','/')")
         y.focus();
		 y.select()
      
         return false;
       }//if
 
   }//for
   
 }//if
 
 
 return true;
 }

//--------------------------------------------------------------//

function validYear(x)
{
val=x.value ;
if (val!="")
{
  if(x.value.length!=4)
   {
     alert("Year must be 4 digits")
     x.focus();
     x.select();
     return false;
    }//if
 }//if
 return true;
 
 }//fun

//-----------------------------------------------------------------

function validChar(x)
{
	
str="0123456789"

val=x.value
len=val.length


for(i=0;i<len;i++)
  {
  ch=val.charAt(i)
  if(str.indexOf(ch)!=-1)
    {
	alert("Please enter a valid name")
	x.focus()
	x.select()
	return false
    }
  }

  return true
}

//-------------------------------------------------------------

function checkLogin(ID)
{


 if (ID==0)
   {
    alert("You Must Login First");
    return false
   }

return true

}

//===========================checkRad========================


function checkRad(obj)
{
len=obj.length
if(len==null)
{
if(obj.checked)
  return true;
alert (" You Must Choose Account Type")
return false;
}
else
{
for(i=0;i<len;i++)
 {
  if(obj[i].checked)
  {
 
return true;

    
  }
  }
 
 alert (" You Must Choose Account Type")
  return false;
  
}
}




//==================================================================


function confirmPass()
{
	
	val=document.frmReg.password.value
	val2=document.frmReg.password2.value
	
	
	if (val!=val2)
	
	
	  {
		
		alert("password and Confirm Password must be identical")
		
	    document.frmReg.password2.focus()
	    document.frmReg.password2.select()
	    return false;
	  }
	  return true;
}


//-------------------------------------------------//


function validLen()
{

	
	len1=document.frmReg.username.value.length;
   len2=document.frmReg.password.value.length;
	
	
	if (len1<4 || len1>12  )
	{
		alert("username must be 4 to 12 characters");
		
	    document.frmReg.username.focus();
	    document.frmReg.username.select();
	    return false;
	}
	
	if (len2<4 || len1>12)
	{
		alert("password must be 4 to 12 characters");
		
	    document.frmReg.password.focus();
	    document.frmReg.password.select();
	    return false;
	}
	
	
	return true;
	
}

//--------------------------------------------------------

function otherValid()
{
	
	 if (document.frmReg.countryID.value =="")
   {
    alert("Please insert all required data")
    document.frmReg.countryID.focus()
    return false;
   }
   
//	if (document.frmReg.cityID.value =="" && document.frmReg.cityOther.value=="")
 //  {
  //  alert("Please insert all required data")
   // document.frmReg.cityID.focus()
  //  return false;
  // }
   
  





return true;
}
//----------------------------------------------------//


function validNumber()
{
 if (validNum(frmReg.phone1)&&validNum(frmReg.phone2)&&validNum(frmReg.mobile)&&validNum(frmReg.fax)&&validNum(frmReg.zipCode))
  {
  return true;
  }

  else
  {
  return false;
  }


}
///------------------OnBlur--OnFocus Functions---------------/////
function valOnBlur(ID,spanID,page,xID)
{
document.getElementById(spanID).innerHTML=""


if(document.getElementById(ID).value!=""&& document.getElementById(ID).value.length >3 &&document.getElementById(ID).value.indexOf(" ")==-1)
{
	
	if (ID=="username" )
	{
		
		if (page=="train")
		
		showHint(document.getElementById(ID).value,'../valid.asp','seeker','usr',xID)
		
		else
		
		showHint(document.getElementById(ID).value,'valid.asp','seeker','usr',xID)
			
    }
 
}
else
{
	 document.getElementById(spanID).innerHTML="Please enter a valid "+ID+""
}



}
///////////////////////////////////////////

function valOnFocus(spanID)
{
document.getElementById(spanID).innerHTML="4 to 12 characters (A-Z, a-z, 0-9, no spaces)" ;
}
///////////////////////////////////////

function onBlurPass()
{
    val=document.frmReg.password.value
	val2=document.frmReg.password2.value
	
	
	if (val!=val2)
	
	
	  {
		
		document.getElementById("pass2").innerHTML="Check your password"
	   
	  }
	  
	  else
	{
		document.getElementById("pass2").innerHTML=""
	}
	  
}
/////////////////////////////////////////////////

function onBlurEmail()
{
	
	
	if(document.frmReg.email.value.length>0)
     {
	if (document.frmReg.email.value.indexOf("@")== "-1" || document.frmReg.email.value.indexOf(".")== "-1")
	{
		document.getElementById("mail").innerHTML="Please enter a valid email."
	
	
	}
	
	  else
	{
		document.getElementById("mail").innerHTML=""
	}
    }

}



/////////////////////////////

function validSpChar(y)
{
	
	
	if(y.value.length>0)
  {
	if (y.value.indexOf("'")!= "-1" || y.value.indexOf(".")!= "-1" || y.value.indexOf(" ")!= "-1" )
	{
	alert("Please enter a valid "+y.name);
	y.focus();
	return (false);
	}
	
	
}

return true;
}


function disEnab(d,e)
{
	  
   d.disabled="true";     
   e.disabled=false;
   
  
   
}



//===================================
function checkd(y)
{
len=y.length
if(len==null)
{
if(y.checked)
  return true;
alert (" Choose  First ")
return false;
}
else
{
for(i=0;i<len;i++)
 {
  if(y[i].checked)
  {
 
if(confirm(" Are You Sure You Want To Delete "))
{ return true;}
else
{ return false;}

    
  }
  }
 
  alert (" Choose  First ")
  return false;
  
}
}
//=============================================
function ConfirmDel()
{
 	if(confirm(" Are You Sure You Want To Delete "))
   { return true;}
  else
   { return false;}
}
//==================================================
function srCheckEmpty()
{

  
   val=document.frmSearch.searchtxt.value
   if(val=="")
     {
	 alert("Please enter some keywords to search.")
	 document.frmSearch.searchtxt.focus()
	 document.frmSearch.searchtxt.select()
	 return false
	 }
  
 
   return true
}
////////////////////////////////////////////////////
function checkNumb()
{
len1=document.frmSearch.searchtxt.value.length;

 if (len1<3)
  {
     alert("Search text must be 3 characters at least.")
	 frmSearch.searchtxt.focus();
	 frmSearch.searchtxt.select();
	 return false
   }
   
 frmSearch.submit();
   return true
}
///////////////////////////////////////////////////////
function validation()
{
if(srCheckEmpty()&&checkNumb())
{

  frmSearch.submit()
  return true;
 
 }
 else{

  return false;
  }
}
