function ResetForm()
{
    document.form1.name.value = "";
    document.form1.email.value = "";
    document.form1.domain.value = "";
    document.form1.phone.value = "";
    document.form1.username.value = "";
    document.form1.priority.value = "";
    document.form1.subject.value = "";
    document.form1.comment.value = "";	
}

function ResetForm2()
{
    document.form1.company.value = "";
    document.form1.firstname.value = "";
    document.form1.lastname.value = "";
    document.form1.address.value = "";
    document.form1.phone.value = "";
    document.form1.fax.value = "";
    document.form1.email.value = "";
    document.form1.url.value = "";	
}

function reseller_validation()
{
		if(!isFilled(document.form1.company.value)){
			document.form1.company.focus();				
			alert ("Company Name required.");			
			return false;
		
		}else if(!isFilled(document.form1.firstname.value)){
			document.form1.firstname.focus();				
			alert ("First Name required.");			
			return false;
		
		}else if(!isFilled(document.form1.email.value)){
			document.form1.email.focus();				
			alert ("Email required.");			
			return false;
				
		}else if(!isEmail(document.form1.email)){						
			return false;				
		
		}else{			
			return true;
		}	
}

function quote_validation()
{
		if(!isFilled(document.form1.name.value)){
			document.form1.name.focus();				
			alert ("Name required.");			
			return false;

		}else if(!isFilled(document.form1.email.value)){
			document.form1.email.focus();				
			alert ("Email required.");			
			return false;
				
		}else if(!isEmail(document.form1.email)){						
			return false;				
		
		}else{			
			return true;
		}	
}

function custom_validation()
{
		if(!isFilled(document.form1.name.value)){
			document.form1.name.focus();				
			alert ("Name required.");			
			return false;

		}else if(!isFilled(document.form1.email.value)){
			document.form1.email.focus();				
			alert ("Email required.");			
			return false;
				
		}else if(!isEmail(document.form1.email)){						
			return false;				
		
		}else{			
			return true;
		}	
}

function contact_validation()
{
		if(!isFilled(document.form1.name.value)){
			document.form1.name.focus();				
			alert ("Name required.");			
			return false;

		}else if(!isFilled(document.form1.email.value)){
			document.form1.email.focus();				
			alert ("Email required.");			
			return false;
				
		}else if(!isEmail(document.form1.email)){						
			return false;		
		
		}else{			
			return true;
		}	
}

function support_validation()
{
		if(!isFilled(document.form1.name.value)){
			document.form1.name.focus();				
			alert ("Name required.");			
			return false;

		}else if(!isFilled(document.form1.email.value)){
			document.form1.email.focus();				
			alert ("Email required.");			
			return false;
				
		}else if(!isEmail(document.form1.email)){						
			return false;			
		
		}else{			
			return true;
		}	
}

	function isFilled(txt) {	

	if (txt!='')

		for (i=0;i<txt.length;i++) {

			if (txt.charAt(i)!=' ') 

				return true

		}	

	return false

	}

	function isNum(txb) {		

		if (isNaN(Number(txb))) {			

			return false

		}

	return true

	}

 function isEmail(txb)

 {

	var txt

	var i  

  

    txt = txb.value

    if (txt != "") 

    {

   

	  invalidChars = " /:,;"

	     

	for (i=0; i<invalidChars.length; i++)

	   {

	      badChar = invalidChars.charAt(i)

	      if (txt.indexOf(badChar,0) != -1) {

			txb.focus()

			 

			alert("Invalid Characters in Email field")

			return false

	      }

	   }

              

	atPos = txt.indexOf("@",1)

	if (atPos == -1) {

		txb.focus()

		  

		alert("Invalid Email Address")

		return false             

	}

       

   if (txt.indexOf("@",atPos+1) != -1) {

		txb.focus()

		 

		alert("Invalid Email Address, More Than one '@' found")

		return false

    }

    periodPos = txt.indexOf(".",atPos)

    if (periodPos == -1) {

      txb.focus()

        	



      alert("Invalid Email Address")

      return false

                 }

                   

    if (periodPos+3 > txt.length) {

        txb.focus()

          

        alert("Invalid Email Address")

        return false

                     }                                

                      }

                      return true
                         }


