 function check(form)
{


f = (eval(new String("22") + " + " + new String("5"))); 


var invalid6=new Array("!","@","#","$","%","^","&","*","(",")","+","=","'",'"',"`","?","/","|",".","{","}","[","]",";",":","~","<",">","0","1","2","3","4","5","6","7","8","9");
var invalidchar1= /\D/g;
var invalid5=new Array("!","@","#","$","%","^","&","*","=","'",'"',"`","?","|",".","{","}",";",":","~","<",">",",","q","w","e","r","t","y","u","i","o","p","a","s","d","f","g","h","j","k","l","z","x","c","v","b","n","m","Q","W","E","R","T","Y","U","I","O","P","A","S","D","F","G","H","J","K","L","Z","X","C","V","B","N","M" );
var invalid12=new Array(" ","!","@","#","$","%","^","&","*","=","'",'"',"`","?","|",".","{","}",";",":","~","<",">","+",",","-");
var invalid13=new Array(" ","!","@","#","$","%","^","&","*","=","'",'"',"`","?","|","{","}",";",":","~","<",">","+",",","-","_");
var invalid16=new Array("!","@","#","$","%","^","&","*","(",")","+","=","'",'"',"`","?","/","|","{","}","[","]",";",":","~","<",">","0","1","2","3","4","5","6","7","8","9");


//to check the name is not blank

var str56= document.form.name.value;

var len1=str56.length;

if(len1==0)
{
	
	alert("Please enter Your First Name");
	 document.form.name.focus();
	return false;
}
if (str56.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.name.value="";
  document.form.name.focus();    
 return false;// used to check empty field name
 }


if(len1!=0)
	{
	for(var i=0;i<=len1;i++)
	{
		chr=str56.charAt(i);
		for(var j=0;j<37;j++)
		{	
			if(invalid16[j]==chr)
			{
				alert("Special characters and numbers are not allowed.");
				 document.form.name.value="";
				 document.form.name.focus();
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if




//to check the lname is not blank

var str96= document.form.lname.value;

var len19=str96.length;
if (str96.substring(0,1)==" ")
 {
  alert("First character can't be a space");
  document.form.lname.value="";
  document.form.lname.focus();    
 return false;// used to check empty field name
 }
if(len19!=0)
	{
	for(var i=0;i<=len19;i++)
	{
		chr=str96.charAt(i);
		for(var j=0;j<37;j++)
		{	
			if(invalid16[j]==chr)
			{
				alert("Special characters and numbers are not allowed .");
				 document.form.lname.value="";
				 document.form.lname.focus();
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if
// to check the company name is not blank


str57= document.form.company.value;
var len2=str57.length;

if (str57.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.company.value="";
  document.form.company.focus();    
 return false;
 }
if(len2==0)
{
	
	alert("Please enter the Company  Name");
	 document.form.company.focus();
	return false;
}
// to check for username
var str90=document.form.username.value;
var len21=str90.length;

if (str90.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.username.value="";
  document.form.username.focus();    
 return false;// used to check empty field name
 }


if(len21==0)
{
	alert("Please enter Username");
	document.form.username.focus();
	return false;
}




if(len21!=0)
	{
	for(var i=0;i<=len21;i++)
	{
		chr=str90.charAt(i);
		for(var j=0;j<28;j++)
		{	
			if(invalid12[j]==chr)
			{
				alert("Special characters and space is not allowed except underscore sign");
				 document.form.username.value="";
				 document.form.username.focus();
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if





// to check for Designation
var str901=document.form.Designation.value;
var len211=str901.length;

if (str901.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.Designation.value="";
  document.form.Designation.focus();    
 return false;// used to check empty field name
 }



/*if(len211!=0)
	{
	for(var i=0;i<=len211;i++)
	{
		chr=str901.charAt(i);
		for(var j=0;j<28;j++)
		{	
			if(invalid12[j]==chr)
			{
				alert("Special characters and space is not allowed except underscore sign");
				 document.form.Designation.value="";
				 document.form.Designation.focus();
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if*/




// to check for password
var str91=document.form.password.value;
var len22=str91.length;

if (str91.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.password.value="";
  document.form.password.focus();    
 return false;// used to check empty field password
 }

if(len22==0)
{
	
	alert("Please enter Your Password");
	document.form.password.focus();
	return false;
}



if(len22!=0)
	{
	for(var i=0;i<=len22;i++)
	{
		chr=str91.charAt(i);
		for(var j=0;j<28;j++)
		{	
			if(invalid13[j]==chr)
			{
				alert("Special characters and space is not allowed.");
				 document.form.password.value="";
				 document.form.password.focus();
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if

// to check for reenter password
var str92=document.form.repass.value;
var len23=str92.length;
if(len23==0)
{
	
	alert("Please enter Your Re-enter Password");
	document.form.repass.focus();
	return false;
}

if ((document.form.password.value) != (document.form.repass.value) ) 
      {
         alert ("Please Re-enter your password");
        
        document.form.repass.focus();   
         return false;
      }

// to check the address is not blank

str58= document.form.address.value ; 
len3=str58.length;
if (str58.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.address.value="";
  document.form.address.focus();    
 return false;
 }
if(len3==0)
{
	
	alert("Please enter the Address");
	 document.form.address.focus();
	return ;
}

// to check the othercity 

str59= document.form.othercity.value;
len4=str59.length;
if (str59.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.othercity.value="";
  document.form.othercity.focus();    
 return false;// used to check empty field name
 }

 if(len4!=0)
	{
	for(var i=0;i<=len4;i++)
	{	chr=str59.charAt(i);
		for(var j=0;j<38;j++)
		{
			if(invalid6[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.othercity.value="";
				 document.form.othercity.focus();
				return false ;
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
   }//end of outer if
   

//to check the Area
if (document.form.list1.selectedIndex=="0" )
 {
 alert("Please Select Your Pincode ");
 document.form.list1.focus();    
 return false;
 }
 
 //to check the SubArea 
str555= document.form.list2.value;
var ind1=document.form.list2.selectedIndex;
 
  if (ind1=="-1")
	{
	alert("Select Your Place");
	document.form.list2.focus();  
	return false;

	}
 

 
 
//to check phone number

var str61=document.form.phone.value;
var len8=str61.length;
flag=true;
if (str61.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.phone.value="";
  document.form.phone.focus();    
 return false;// used to check empty field name
 }
 if(len8 != 0)
{
	for(var i=0;i<=len8;i++)
	{
		chr=str61.charAt(i);
		for(var j=0;j<76;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.phone.value="";
				 document.form.phone.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if



//to check phone1
var str611=document.form.phone1.value;
var len81=str611.length;
flag=true;
if (str611.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.phone1.value="";
  document.form.phone1.focus();    
 return false;// used to check empty field name
 }
 if(len81 != 0)
{
	for(var i=0;i<=len81;i++)
	{
		chr=str611.charAt(i);
		for(var j=0;j<76;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.phone1.value="";
				 document.form.phone1.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if



//to check residencephone

var str612=document.form.residencephone.value;
var len82=str612.length;
flag=true;
if (str612.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.residencephone.value="";
  document.form.residencephone.focus();    
 return false;// used to check empty field name
 }
 if(len82 != 0)
{
	for(var i=0;i<=len82;i++)
	{
		chr=str612.charAt(i);
		for(var j=0;j<76;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.residencephone.value="";
				 document.form.residencephone.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if


//to check mobilephone
var str6111=document.form.mobilephone.value;
var len811=str6111.length;
flag=true;
if (str6111.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.mobilephone.value="";
  document.form.mobilephone.focus();    
 return false;// used to check empty field name
 }
 if(len811 != 0)
{
	for(var i=0;i<=len811;i++)
	{
		chr=str6111.charAt(i);
		for(var j=0;j<76;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.mobilephone.value="";
				 document.form.mobilephone.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if




//to check pagerphone
var str6112=document.form.pagerphone.value;
var len812=str6112.length;
flag=true;
if (str6112.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.pagerphone.value="";
  document.form.pagerphone.focus();    
 return false;// used to check empty field name
 }
 if(len812 != 0)
{
	for(var i=0;i<=len812;i++)
	{
		chr=str6112.charAt(i);
		for(var j=0;j<76;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.pagerphone.value="";
				 document.form.pagerphone.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if



// to check fax 
var str62=document.form.fax.value;
var len9=str62.length;

if (str62.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.fax.value="";
  document.form.fax.focus();    
 return false;// used to check empty field name
 }

	if(len9!=0)
	{
	for(var i=0;i<=len9;i++)
	{
		chr=str62.charAt(i);
		for(var j=0;j<76;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				 document.form.fax.value="";
				 document.form.fax.focus();
				return  false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for
	
}//end of outer if



// to check email address

str70=document.form.email.value;
len7=str70.length;
flag=true;
if (str70.substring(0,1)==" ")
 {
 alert("First character can't be a space");
 document.form.email.value="";
 document.form.email.focus();    
 return false;// used to check empty field name
 }

if(len7==0 && flag)
{
	alert("Please enter your E-Mail Address");
	document.form.email.focus();
	
	flag=false;
	return false;
}
else
{
	if((str70.indexOf("@",0)<=0) || (str70.indexOf(".",0)<=0))
	{
		alert(str70+"  is not a valid E-Mail Id");
		document.form.email.value="";
		document.form.email.focus();	 	
		return false;
	}//end of if
}//end of else	


// to check website 
 var str71= document.form.website.value;
 var len10=str71.length;
   if (str71.substring(0,1)==" ")
 {
  alert("First character can't be a space");
  document.form.website.value="";
  document.form.website.focus();    
 return false;// used to check empty field name
 }
 if (len10!=0)
 {
 if (str71.indexOf(".",0)<=0)
	{
		alert(str71+"  is not a valid Website address");
		document.form.website.focus();	 	
		return false;
	}
 }
  



// to check the specialization  is not blank
 str92= document.form.ospecial.value;

if (str92.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.ospecial.value="";
  document.form.ospecial.focus();    
 return false;
 }

// to check the project desc  
str73= document.form.description.value ; 
len12=str73.length;
if (str73.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.description.value="";
  document.form.description.focus();    
 return false;
 }

// to check the location

str74= document.form.location.value ; 
len13=str74.length;
if (str74.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.location.value="";
  document.form.location.focus();    
 return false;
 }


// to check the value of project

var str75="";
str75=document.form.vproject.value;
var len14=str75.length;
flag=true;
if(str75.substring(0,1)==" ")
{
	alert("First Character cannot be a space.");
	document.form.vproject.value="";
	document.form.vproject.focus();
	
	return false;
}
if(len14!= 0)
{
	for(var i=0;i<=len14;i++)
	{
		chr=str75.charAt(i);
		for(var j=0;j<75;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				document.form.vproject.value="";
				document.form.vproject.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if

// to check the value of contract

var str76=document.form.vcontract.value;
var len15=str76.length;
if(str76.substring(0,1)==" ")
{
	alert("First Character cannot be a space.");
	document.form.vcontract.value="";
	document.form.vcontract.focus();
	
	return false;
}
if(len15!= 0)
{
	for(var i=0;i<=len15;i++)
	{
		chr=str76.charAt(i);
		for(var j=0;j<75;j++)
		{	
			if(invalid5[j]==chr)
			{
				alert("You have entered invalid characters");
				document.form.vcontract.value="";
				document.form.vcontract.focus();
				return false;
				
			}//end of if	
		}//end of inner for		
	}//end of outer for	
}//end of outer if

// to check the company name is not blank


str77= document.form.profile.value;
var len15=str77.length;

if (str77.substring(0,1)==" ")
 {
 alert("First character can't be a space");
  document.form.profile.value="";
  document.form.profile.focus();    
 return false;
 }
if(len15==0)
{
	
	//alert("Please enter brief description of your Business/Organisation");
	//document.form.profile.focus();
	//return false;
}



var subcatElement = document.forms[0].length ;
	 //alert(subcatElement);
	//alert(document.forms.elements);
	var totalCat="";
	var iElements=subcatElement;
	//alert(iElements);
	var szElementValue=new Array(iElements-1);
	for (iCount=0;iCount<iElements;iCount++)
	{
		var szElement= document.form.elements[iCount];
		// alert(szElement);
		if (szElement.type=="checkbox")
		{
			if (szElement.checked)
			{
				szElementValue[iCount]=szElement.value;
				 totalCat=szElementValue[iCount] + "," +  totalCat;
				//alert( totalCat);			
			}
		}
	}

var txtflag = "" ;     
  for(i=0;i<=7;i++)
   {
    vartxt = document.form.txtcategory[i].value ;    
     if( vartxt != "")
      {
         //alert(document.form.txtcategory[i].value);
         txtflag = "present" ;
      }            
    }      
    
      if(txtflag == "")
      {
         alert("please select category");  
         document.form.xxxx[0].focus();
         return false ; 
      }  
      
 
document.form.totcat.value =totalCat;
//alert(document.form.totcat.value);


document.form.method ="post" ;
document.form.action ="../registeration/register.asp" ;
document.form.submit() ;



//return true;
}
function findcat(form)
{
	var subcatElement = document.forms[0].length ;
	 //alert(subcatElement);
	//alert(document.forms.elements);
	var totalCat="";
	var iElements=subcatElement;
	//alert(iElements);
	var szElementValue=new Array(iElements-1);
	for (iCount=0;iCount<iElements;iCount++)
	{
		var szElement= document.form.elements[iCount];
		// alert(szElement);
		if (szElement.type=="checkbox")
		{
			if (szElement.checked)
			{
				szElementValue[iCount]=szElement.value;
				 totalCat=szElementValue[iCount] + "," +  totalCat;
				//alert( totalCat);			
			}
		}
	}

var txtflag = "" ;     
  for(i=0;i<=7;i++)
   {
    vartxt = document.form.txtcategory[i].value ;    
     if( vartxt != "")
      {
         //alert(document.form.txtcategory[i].value);
         txtflag = "present" ;
      }            
    }      
    
      if(txtflag == "")
      {
         alert("please select category");  
         document.form.xxxx[0].focus();
         // document.txtcategory.focus()     
         return false ; 
      }  
      
 
document.form.totcat.value =totalCat;
//alert(document.form.totcat.value);
return false;
}

