// JavaScript Document

function echeck(str) 
	{
  		var at="@";
  		var dot=".";
  		var lat=str.indexOf(at);
  		var lstr=str.length;
  		var ldot=str.indexOf(dot);
  		if (str.indexOf(at)==-1)
  			{
     		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
     		return false;
  			}
 
  		if (str.indexOf(at)==-1 || str.indexOf(at)==0 || str.indexOf(at)==lstr)
  			{
     		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
     		return false;
  			}
 
  		if (str.indexOf(dot)==-1 || str.indexOf(dot)==0 || str.indexOf(dot)==lstr)
  			{
      		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
      		return false;
  			}
 
   		if (str.indexOf(at,(lat+1))!=-1)
   			{
      		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
      		return false;
   			}
 
   		if (str.substring(lat-1,lat)==dot || str.substring(lat+1,lat+2)==dot)
   			{
      		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
      		return false;
   			}
 
   		if (str.indexOf(dot,(lat+2))==-1)
   			{
      		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
      		return false;
   			}
  
   		if (str.indexOf(" ")!=-1)
   			{
      		//alert("Invalid E-mail ID");
			//document.getElementById("errEmail").innerHTML="Invalid email address";
      		return false;
   			}
    	return true; 
 	}

function chkscrfrm()
    {
	var telNoChkRegExp     = /^([0-9 ]+)$/;
	/*if(document.scrfrm.textfieldid.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your TemplateId.";
	  document.scrfrm.textfieldid.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}*/
		
    if(document.scrfrm.textfield.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your Name.";
	  document.scrfrm.textfield.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	if(document.scrfrm.textfield2.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your Company.";
	  document.scrfrm.textfield2.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	if(document.scrfrm.textfield7.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your Email.";
	  document.scrfrm.textfield7.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	if(echeck(document.scrfrm.textfield7.value)){
		//alert("Ok");
	
	}else{
		//alert("error");
        document.getElementById("from1").innerHTML ="Invalid  Email Address.";
		//document.frmnewregistration.errEmail.value="Invalid Email Address";
		document.scrfrm.textfield7.focus();
		return false;
	}
	
	if(document.scrfrm.textfield8.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your phone number.";
	  document.scrfrm.textfield8.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	
	if(!document.scrfrm.textfield8.value.match(telNoChkRegExp)){
	  document.getElementById("from1").innerHTML ="Please enter your contact phone number (only numeric values).";
	  document.scrfrm.textfield8.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	
	if(document.scrfrm.textfield9.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your Country.";
	  document.scrfrm.textfield9.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	
	if(document.scrfrm.selectproject.value == ""){
	  document.getElementById("from1").innerHTML ="Please enter your eBay Project.";
	  document.scrfrm.selectproject.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	
	if(document.scrfrm.textarea.value == ""){
	  document.getElementById("from1").innerHTML ="Please put details of your request in the message box.";
	  document.scrfrm.textarea.focus();
	  return false;
		}
	else
	{
        document.getElementById("from1").innerHTML ="";
		//document.frmnewregistration.errutelno.value="";			
	}
	}