function clickclear(thisfield, defaulttext) {
if (thisfield.value == defaulttext) {
thisfield.value ="";
}
}
function clickrecall(thisfield, defaulttext) {
if (thisfield.value == "") {
thisfield.value = defaulttext;
}
}


function nametype(name1){



document.getElementById('fname').value = name1.value;

}



function emailtype(email1){



document.getElementById('email').value = email1.value;

}



function lnametype(lname){



document.getElementById('lname').value = lname.value;

}
function companytype(company){



document.getElementById('company').value = company.value;

}

function passtype(pass){
document.getElementById('pass').value = pass.value;
}

function cpasstype(cpass){



document.getElementById('cpass').value = cpass.value;

}

function BotBootInputtype(BotBootInput){



document.getElementById('BotBootInput').value = BotBootInput.value;

}
function promtype(prom){



document.getElementById('prom').value = prom.value;

}


function loginemailtype(email1){
document.getElementById('loginemail').value = email1.value;
}

function loginpasstype(pass){
document.getElementById('loginpass').value = pass.value;
}



function trim(stringToTrim) {
	return stringToTrim.replace(/^\s+|\s+$/g,"");
}
var CODE = Math.floor(Math.random()*1000000);
    function DrawBotBoot()
    {
       	document.write("<label class='captchafont'>");
		document.write(CODE);
		document.write("</label>");
    }    
    function ValidBotBoot(){
        var d = document.getElementById('BotBootInput').value;
        if (d == c) return true;        
        return false;
    }
    


function isValidEmail(str) {

   return (str.indexOf("@") > 0);

}
function IsNumeric(sText)

{
   var ValidChars = "0123456789.";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }
function alltrim(str) 
{
                return str.replace(/^\s+|\s+$/g, '');
 }



function validContactForm()
{
	//var user_is_a_human = document.getElementById('BotBootInput').value;
if(alltrim(document.getElementById('fname').value) == "" )
	{
		alert("Please enter your first name.");
		document.getElementById('fname').focus();
		return false;
	}	
	if(alltrim(document.getElementById('lname').value) == "" )
	{
		alert("Please enter your last name.");
		document.getElementById('lname').focus();
		return false;
	}	

//	if(alltrim(document.getElementById('company').value) == "" )
//	{
//		alert("Please enter your Company .");
//		document.getElementById('company').focus();
//		return false;
//	}	
	var strValue = document.getElementById('email').value;
	var strFilter = /^([0-9a-z]([-.\w]*[0-9a-z])*@(([0-9a-z])+([-\w]*[0-9a-z])*\.)+[a-z]{2,6})$/i;
	if (!strFilter.test(strValue))
	{
  	 alert("Please enter a valid email address.");
	 document.getElementById('email').focus();
   	return false;
	}
	
	 if(document.getElementById('pass').value=="" || document.getElementById('pass').value==null)
  	{
  		alert("Please enter your password");
  		document.getElementById("pass").focus();
		return false;
  	}

	 if(document.getElementById('cpass').value=="" || document.getElementById('cpass').value==null)
  	{
  		alert("Please enter your confirm password");
  		document.getElementById("cpass").focus();
		return false;
  	}
	if(document.getElementById('pass').value!=document.getElementById('cpass').value)
  	{
				alert("Password Confirmation Error!! Reconfirm Your Password");
  				document.getElementById("pass").value="";
  				document.getElementById("cpass").value="";
  				document.getElementById("pass").focus();
				return false;
	}
/*
	var captchaValue = document.getElementById('BotBootInput').value;
	if(user_is_a_human == "" )
	{
		alert("Please Enter Captcha Code");
		document.getElementById('BotBootInput').focus();
		return false;
	}
	else if(user_is_a_human != CODE )
	{
		alert("Captcha Code Does Not Match");
		document.getElementById('BotBootInput').focus();
		return false;
	}

	
*/
//alert(document.form1.textfield2.value.length);	 

	
}
// JavaScript Document
