// JavaScript Document
function validate_signup(thisform)
{
	
	
	with(thisform)
	{
		
		if (trim(name.value)==''|| name.value=='Name')
		{
			//count.value=parseInt(count.value)+1;
			alert("Please enter your Name");
			name.value=trim(name.value);
		   name.focus();
		   return false;	
		}
		
		
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
		
			var address = document.signup.email.value;	
			
			if(reg.test(address) == false) 
			{ 
			
			alert('Please enter your Email Address');
			email.focus();
			email.select();
			return false;
			}
		if (trim(code.value)==''|| code.value=='Enter the code')
		  {
			alert("Please enter your code");
		   code.focus();
		   code.value="";
		   return false;	
		  }
	}
		thisform.submit();
}
function validate_login(thisform)
{
	
	thisform.submit();
}
function validate_quickcontact(thisform)

{
	
//	alert ("dasdasdad");
with(thisform)
{
//alert ("hai");
//	//return false;
		 //if(document.form1.count.value>=2)
//		{
//		
//		document.getElementById("cap").style.display="block";
//		document.getElementById("cap1").style.display="block";
//		document.getElementById("cap2").style.display="block";
//		}
		if (trim(name.value)==''|| name.value=='Name')
		{
			//count.value=parseInt(count.value)+1;
			alert("Please enter your Name");
			name.value=trim(name.value);
		   name.focus();
		   return false;	
		}
		var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/;
        var address = trim(thisform.email.value);
  
		if(reg.test(address) == false) 
		{ 
		//count.value=parseInt(count.value)+1;
      	alert('Please enter your Email Address');
	  	email.focus();
	  	email.select();
      	return false;
   		}
      	if (trim(q_phone.value)==''|| q_phone.value=='Phone')
		{
			//count.value=parseInt(count.value)+1;
			alert("Please enter your Phone Number");
		q_phone.focus();
		q_phone.value=trim(q_phone.value);
		return false;	
		}
		var ph = trim(thisform.q_phone.value);
		var res=IsPhoneNumber(ph);
		if(res==false)
		{
			//count.value=parseInt(count.value)+1;
			alert("Please enter correct Phone Number");
			q_phone.focus();
			q_phone.select();
			return false;		
		}
		if (trim(comments.value)==''|| comments.value=='Comments')
		{
			alert("Please enter your comments");
			comments.value=trim(comments.value);
		   comments.focus();
		   return false;	
		}
		
	
		if (trim(code.value)==''|| code.value=='Enter the code')
		{
			alert("Please enter your code");
		   code.focus();
		   code.value="";
		   return false;	
		}
	
	
		
		
	}
	thisform.submit();
}
function IsPhoneNumber(strString)
   //  check for valid numeric strings	
   {
   var strValidChars = "0123456789.- []()";
   var strChar;
   var blnResult = true;

   if (strString.length == 0)
   return false;

   //  test strString consists of valid characters listed above
   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
		 //alert("Enter a phone number");
         blnResult = false;
         }
      }
   return blnResult;
   }	


function IsNumeric(strString)
{
   var strValidChars = "0123456789.()-";
   var strChar;
   var blnResult = true;
   //if ((strString.length == 0) || (strString.length > 16) )  return false;

   for (i = 0; i < strString.length && blnResult == true; i++)
      {
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1) 
	  blnResult = false;
      }
   return blnResult;
}

function validate(thisform)
{
	thisform.submit();
}
function emptyvalidation(entered, alertbox)
{
	with (entered)
	{
		while (value.charAt(0) == ' ')
			value = value.substring(1);
		while (value.charAt(value.length - 1) == ' ')
			value = value.substring(0, value.length - 1);
		if (value==null || value=="")
		{
			if (alertbox!="") alert(alertbox);
			return false;
		}
		else return true;
	}
}
function trim(str)  
{  
 return str.replace(/^\s+|\s+$/g,'');  
} 
