function CheckForm()
{
	
if(document.form1.id.value=="")
{
alert(" ID is required. ");
document.form1.id.focus();
return false;
}

if(document.form1.password.value=="")
{
alert(" Password is required. ");
document.form1.password.focus();
return false;
}

if(document.form1.name.value=="")
{
alert(" Name is required. ");
document.form1.name.focus();
return false;
}

if (document.form1.email.value=="")
{
alert(" E-mail is required. ");
document.form1.email.focus();
return false;
}

if(!checkmail(document.form1.email))
{
document.form1.email.focus();
return false;
} 

if(document.form1.c1.checked)
{
   if (document.form1.country1.value=="")
   {
        alert(" Please specify your country. ");
        document.form1.country1.focus();
        return false;
   }
}

else
{
   if(document.form1.country.value=="0")
   {
        alert(" Please select your country. ");
        document.form1.country.focus();
        return false;	
   }
}

if (document.form1.phone.value=="")
{
return true;
}

if(!checkPhone(document.form1.phone))
{
document.form1.phone.focus();
return false;
} 

if (document.form1.fax.value=="")
{
return true;
}

if(!checkFax(document.form1.fax))
{
document.form1.fax.focus();
return false;
} 

if (document.form1.website.value=="")
{
return true;
}

if(!checkWebsite(document.form1.website))
{
document.form1.website.focus();
return false;
} 


}


function checkmail(myEmail) {
if (/^[\w-]+(\.[\w-]+)*@[\w-]+(\.[\w-]+)+$/.test(myEmail.value)){
return (true)
}
alert(" Please enter a valid e-mail address. ")
return (false)
}

function checkPhone(strPhone) {
if (/^(\+[1-9][0-9]*(\([0-9]*\)|-[0-9]*-))?[0]?[1-9][0-9\- ]*$/.test(strPhone.value)){
return (true)
}
alert(" The phone number is invalid. ")
return (false)
}

function checkFax(strFax) {
if (/^(\+[1-9][0-9]*(\([0-9]*\)|-[0-9]*-))?[0]?[1-9][0-9\- ]*$/.test(strFax.value)){
return (true)
}
alert(" The Fax number is invalid. ")
return (false)
}

function checkWebsite(strWebsite) {
if (/(http|ftp|https):\/\/[\w\-_]+(\.[\w\-_]+)+([\w\-\.,@?^=%&amp;:/~\+#]*[\w\-\@?^=%&amp;/~\+#])?/.test(strWebsite.value)){
return (true)
}
alert(" The web site is invalid. ")
return (false)
}

