// JavaScript Document
<!--


// (C) 2003 CodeLifter.com
// Source: CodeLifter.com
// Do not remove this header

// Set the message for the alert box
am = "Right Click is disabled!";

// do not edit below this line
// ===========================
bV  = parseInt(navigator.appVersion)
bNS = navigator.appName=="Netscape"
bIE = navigator.appName=="Microsoft Internet Explorer"

function nrc(e) {
   if (bNS && e.which > 1){
      alert(am)
      return false
   } else if (bIE && (event.button >1)) {
     alert(am)
     return false;
   }
}

document.onmousedown = nrc;
if (document.layers) window.captureEvents(Event.MOUSEDOWN);
if (bNS && bV<5) window.onmousedown = nrc;





function validateForm(){
	
// THESE ARE THE VARIABLES	WITH DEFAULT VALUES
	form = document.regForm;
	var theMessage = "Following errors occured: \n-----------------------------------\n";
	var noErrors = theMessage;
	var screenname=form.userid.value;
	var pwd=form.pwdForm.value;
	var plen=pwd.length;
	var slen=screenname.length;
	var caps_status=false;
	var caps_status1=false;
	
	
//////check firstname field is empty //////////////////////////////////////////////////////////////

	if ( form.fname.value == "" )
		{ 
		theMessage = theMessage + "\n --> Enter your Full name?"; 
		}
	
///////////check userid field is empty and userid length///////////////////////////////////////////
	
		
	if ( form.userid.value != "" )
	{
		if((screenname.substring(0,1)<"a" || screenname.substring(0,1)>"z") && (screenname.substring(0,1)<"A" || screenname.substring(0,1)>"Z"))
		{
		theMessage = theMessage + "\n --> UserID should begin with an alphabetic character."; 
				
		}
		
		
		 if(form.userid.value.length <= 5)
		 {
		 theMessage = theMessage + "\n --> UserID is too short? (min. 6 characters)";  
		 }
		
	}
	else
	{
	theMessage = theMessage + "\n --> UserID field is empty?"; 
	}
	
/////////check userid field should not contain capital values//////////////////////////////////////

   for (var i = 1; i < slen; i++) 
	{
		var ch = screenname.substring(i, i + 1);
			if (  (ch < "a" || "z" < ch) &&  (ch < "0" || "9" < ch) ) 
			{
		
			caps_status=true;
						
			}
						
	}
		if(caps_status==true)
		   {
			theMessage = theMessage + "\n --> The UserID field  accepts only small letters and numbers and not blank spaces?";  
			}
	
	////////////////////////////////////////////////////////
	   
	   
	   
	   
	   
	   
	   
	   
	   
//////////check password field is empty and password length////////////////////////////////////////

	if ( form.pwdForm.value != "" )
	{
		 if(form.pwdForm.value.length <= 5)
		 {
		 theMessage = theMessage + "\n --> Password is too short ? (min 6 characters)";  
		 }
	}
	else
	{
	theMessage = theMessage + "\n --> Password field is empty?"; 
	}
	
/////////check password field should not contain capital values//////////////////////////////////////

	  for (var i = 1; i < plen; i++) 
		{
			var ch1 = pwd.substring(i, i + 1);
			if (  (ch1 < "a" || "z" < ch1) &&  (ch1 < "0" || "9" < ch1) ) 
			{
		
			caps_status1=true;
						
			}
						
		}
		if(caps_status1==true)
		   {
			theMessage = theMessage + "\n --> The Password field  accepts only small letters and numbers & not blank spaces?"; 
			}
	   
	   
	   
	   
	   
	   
	   
	   
	   
	
////////check Confirm passsword field is empty and both passwords are same or not//////////////////

	if ( form.confirmPwd.value != "")
	{
		if ( form.confirmPwd.value != form.pwdForm.value)
		{
			theMessage = theMessage + "\n --> Passwords typed do not match?";
		}
	}
	else
	{
			theMessage = theMessage + "\n --> Confirm Password Field is empty?"; 
	}
	

	
////////////////firmname///////////////////////
	if ( form.firm.value == "" )
		{ 
		theMessage = theMessage + "\n --> Enter Your Firm Name?"; 
		}
	

/////////////////////////////////////////////////
////////////////Designation///////////////////////
var listCheck = form.category.selectedIndex;
if (form.category.options[listCheck].value=="None") {
theMessage = theMessage + "\n --> Please Select your Category?";
}

/////////////////////////////////////////////////


////////////////Expertise///////////////////////
	if ( form.expertise.value == "" )
		{ 
		theMessage = theMessage + "\n --> Expertise Field is empty?"; 
		}
	

/////////////////////////////////////////////////


	
/////////////check phone number//////////////
	if ( form.phone.value == "" )
		{ 
		theMessage = theMessage + "\n --> Enter your Contact Number?"; 
		}
		else
		{
			if (isNaN(form.phone.value))
				{
				theMessage = theMessage + "\n --> Enter valid Contact number?"; 			
				}
		}
				
				
/////////////////////Address//////////////////////
	if ( form.address.value == "" )
		{ 
		
		theMessage = theMessage + "\n --> Enter Street Address?"; 
		}


/////////////////////City//////////////////////
if ( form.city.value == "" )
		{ 
		theMessage = theMessage + "\n --> Enter name of City?"; 
		}
		
		
		
		
/////////////////////State//////////////////////

var listCheck1 = form.state.selectedIndex;
if (form.state.options[listCheck1].value=="none") {
theMessage = theMessage + "\n --> Please Select State?";
}

/////////////////////////////////////////////////
		
		
		
		
/////////////////////Country//////////////////////		
		if ( form.country.value == "" )
		{ 
		theMessage = theMessage + "\n --> Enter Country Name?"; 
		}

///////////////PIN CODE ////////////////////

	if ( form.pin_code.value != "" )
	{ 
		if ( form.pin_code.value.length <= 5 ||  form.pin_code.value.length >=9 ||  isNaN(form.pin_code.value)){ theMessage = theMessage + "\n --> Invalid Pincode?"; }	
	}
	else
	{
	theMessage = theMessage + "\n --> Pin Code Field is empty?"; 
	}	
//////////////////////////////////////////////////////
////////////// validate an e-mail address//////////////////////////////////////////////////////////
if (!/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,4})+$/.test(form.email.value)){
	theMessage = theMessage + "\n --> Enter valid e-mail address?";
	
}
////////////////////////////////////////////////////

if ( form.strCAPTCHA.value == "" )
{
	theMessage = theMessage + "\n --> Please fill the Verification Code?"; 
}



	if (theMessage == noErrors) 
	{
	form.pwd1.value=form.pwdForm.value;
	form.captchacode.value=form.strCAPTCHA.value;
	form.strCAPTCHA.value="";
	form.pwdForm.value="";
	form.confirmPwd.value="";
	
		return true;
	} 
	else 
	{
		alert(theMessage);
		//form.fname.focus();
		return false;
	}
	}
//-->