function RefemailExists()
		 	{
				
				email=document.getElementById("refemailid").value;
				ajaxEngine.registerRequest('addAction', "actions/registerAction.asp");
	  			ajaxEngine.sendRequest('addAction', "email="+email,"id=refForm");
				return false;
			}

function redPage()
		 	{
			//alert(msgId.innerHTML);
			if(msgId.innerHTML=="loginForm") //login of customer
				{
					loading.style.display="none";
					if(msg.innerHTML=="1")
						alert("Invalid userName");							
					else if(msg.innerHTML=="2") 
						alert("Invalid Password");
					else
					document.loginForm.submit();	
				}
			else if(msgId.innerHTML=="ecchkemail") //check email existancein Edit post resume
					{
						//loading.style.display="none";
						if(msg.innerHTML=="1")
						{
							//alert("anitha in ecchemail");
							alert("emailID already Exists, Please enter another Email ID");
							document.custreg.cemail.focus();
						}	
						else
							{
								formsub();
							}						
					}
				else if(msgId.innerHTML=="regcust")  // registration of customer in registration
					{	
						loading.style.display="none";
						//alert("anitha in regcust");
						if(msg.innerHTML=="1")
						{	
							alert("EmailID already Exists, Plz enter email ID");
							document.getElementById("cemail").focus();						
						}
						else
						{
							//alert("email exist");
							formsub();
						}
					}	
					
			else if(msgId.innerHTML=="ecust")  // registration of customer
					{	
					//alert("anitha in regcust");
						if(msg.innerHTML=="1")
						{	
							alert("EmailID already Exists, Plz enter email ID");
							document.getElementById("cemail").focus();						
						}
						else
						{
							//alert("email exist");
							formsub();
						}
					}
			else if(msgId.innerHTML=="reguname")  // Username of customerin registration
					{
						loading.style.display="none";	
						//alert("anitha in reguname");
						if(msg.innerHTML=="1")
						{	
							alert("User Name already Exists, Plz enter User Name");
							document.getElementById("cuname").focus();						
						}
						else
						{
							//alert("user name");
							emailExists();							
						}
					}
					
				
				else if(msgId.innerHTML=="euname")  // Existing Username of customer in edit cust details
					{	
						//alert("anitha in euname");
						if(msg.innerHTML=="1")
						{	
							alert("User Name already Exists, Plz enter User Name");
							document.getElementById("cuname").focus();						
						}
						else
						{
							//alert("user name");
							emailExists();							
						}
					}	
					
					
					else if(msgId.innerHTML=="regeuname")  // Username of customer
					{	
						if(msg.innerHTML=="1")
						{	
							alert("User Name already Exists, Plz enter User Name");
							document.getElementById("cuname").focus();						
						}
						else
						{
							if(document.custreg.oldemail.value != document.custreg.cemail.value )
							{
								//alert("inheif");
								emailExists();							
							}
						}
					}					
					
			else if(msgId.innerHTML=="location")
				{
					var quoteString=msg.innerHTML;
					var mytool_array=quoteString.split("$");
					var part_num=0;
					var part_num1=1;
					var part_num2=1;
					//alert(part_num);
					//alert(part_num1);
					//alert(part_num2);
					rloading.style.display="none";
					totOpt=document.forms['custreg'].locat.options.length;
					//alert(totOpt);
					 while (part_num1 < totOpt )
					{
						document.forms['custreg'].locat.options[part_num2]=null;
						part_num1=part_num1+1;
					}					
					while (part_num < mytool_array.length)
					 {
 //						alert("anitha");
						var mytool_array1=mytool_array[part_num].split("#");
						//alert("second");
						part_num+=1;
						//alert(mytool_array1[0]);
						//alert(mytool_array1[1]);
						document.forms['custreg'].locat.options[part_num]=new Option(mytool_array1[1],mytool_array1[0]);
						//alert(document.forms['custreg'].locat.options[part_num]);
					 }
					 	//alert(part_num);
						//alert(mytool_array.length);
					 if (part_num>1)
					 {
					 	document.forms['custreg'].locat.options[part_num+=1]=new Option("other","0");					 
					 }
					 else
					 {
					 	document.forms['custreg'].locat.options[part_num]=new Option("other","0");					 
					 }
				}
				//alert("anitha");
				else if(msgId.innerHTML=="elocation")
				{
					//alert("anitha");
					var quoteString=msg.innerHTML;
					var mytool_array=quoteString.split("$");
					var part_num=0;
					var part_num1=1;
					var part_num2=1;
					//alert(part_num);
					//alert(part_num1);
					//alert(part_num2);
					uloading.style.display="none";
					totOpt=document.forms['custedit'].locat.options.length;
					 while (part_num1 < totOpt )
					{
						document.forms['custedit'].locat.options[part_num2]=null;
						//alert("first");
						part_num1=part_num1+1;
					}					
					while (part_num < mytool_array.length)
					 {
						var mytool_array1=mytool_array[part_num].split("#");
						//alert("second");
						part_num+=1;
						//alert(mytool_array1[0]);
						//alert(mytool_array1[1]);						
						document.forms['custedit'].locat.options[part_num]=new Option(mytool_array1[1],mytool_array1[0]);
						//alert(document.forms['custedit'].locat.options[part_num]);
					 }
					  if (part_num>1)
					 {
					 	document.forms['custedit'].locat.options[part_num+=1]=new Option("other","0");					 
					 }
					 else
					 {
					 	document.forms['custedit'].locat.options[part_num]=new Option("other","0");					 
					 }					 
				}
				else if(msgId.innerHTML=="addreg") 
				{
					rloading.style.display="none";
					//alert("inaddreg");
					//alert(msgId.innerHTML);
					var destString=msg.innerHTML;
					var mytool_array=destString.split("$");					
					//alert(mytool_array[0]);
					if(mytool_array[0]!="0")
						{
							alert(mytool_array[1]);							
							document.custreg.cuname.value="";
							document.custreg.cpwd.value="";
							document.custreg.cconfirmpwd.value="";
							document.custreg.cname.value="";
							document.custreg.cemail.value="";							
							document.custreg.confirmemail.value="";
							document.custreg.country.selectedIndex=0;
							document.custreg.ocon.value="";						
							document.custreg.locat.selectedIndex=0;							
							document.custreg.othloc.value="";
							document.custreg.land1.value="";
							document.custreg.land2.value="";
							document.custreg.land3.value="";							
							document.custreg.mobile.value="";
							document.custreg.expinyears.selectedIndex=0;
							document.custreg.expinmonths.selectedIndex=0;							
							document.custreg.keysills.value="Enter your Key Skills here separated by commas.";
							document.custreg.rheadline.value="";
							document.custreg.functinalarea.selectedIndex=0;
							document.custreg.othfarea.value="";
							document.custreg.industrytype.selectedIndex=0;
							document.custreg.othitype.value="";
							document.custreg.ug.value="";
							document.custreg.othug.value="";
							document.custreg.pg.value="";
							document.custreg.postpg.value="";							
							if (document.frmSend.attach1.value!="")
							{
								document.frmSend.submit();
							}
						}									
				}
				else if(msgId.innerHTML=="updreg") 
				{
					//alert("inupdatereg");
					//alert(msgId.innerHTML);
					uloading.style.display="none";
					var destString=msg.innerHTML;
					var mytool_array=destString.split("$");					
					//alert(mytool_array[0]);
					if(mytool_array[0]!="0")
						{
							alert(mytool_array[1]);							
							document.custedit.cuname.value="";
							document.custedit.cpwd.value="";
							//document.custedit.cconfirmpwd.value="";
							document.custedit.cname.value="";
							document.custedit.cemail.value="";							
							//document.custedit.confirmemail.value="";
							document.custedit.country.selectedIndex=0;
							document.custedit.ocon.value="";						
							document.custedit.locat.selectedIndex=0;							
							document.custedit.othloc.value="";
							document.custedit.land1.value="";
							document.custedit.land2.value="";
							document.custedit.land3.value="";							
							document.custedit.mobile.value="";
							document.custedit.expinyears.selectedIndex=0;
							document.custedit.expinmonths.selectedIndex=0;							
							document.custedit.keysills.value="Enter your Key Skills here separated by commas.";
							document.custedit.rheadline.value="";
							document.custedit.functinalarea.selectedIndex=0;
							document.custedit.othfarea.value="";
							document.custedit.industrytype.selectedIndex=0;
							document.custedit.othitype.value="";
							document.custedit.ug.value="";
							//document.custedit.othug.value="";
							document.custedit.pg.value="";
							document.custedit.postpg.value="";
							if (document.frmSend.attach1.value!="")
							{
								document.frmSend.submit();
							}							
						}	
				}					
			}	 