function checkRegData(rootDir)
	{
		$("#regpagesubmit").attr("disabled",true).css('opacity', 0.5);
		
		var ajaxaction = "CheckCampsByPostRegData";
		
		var postString = $("form#frmmain").serialize()+"&ajaxaction="+ajaxaction;	
		
		$.post(rootDir+"ajaxcon.php", postString, function(data){
				
				$("div#someImpCamps").html(data);
				
				//alert($("#div_email").html() + " / " + $("#cityStateDiv").html());
				
				if($("#div_email").html() == "invalid")
					{
						//alert("Email");
						return false;
					}
				if($("#cityStateDiv").html() == "Invalid postCode")
					{
						//alert("ZIP");
						return false;
					}
		
				$("#regpagesubmit").attr("disabled",false).css('opacity', 1);
			});
			
	}

function page1CampCheck(id, urlID)
	{
		//alert($(this).checked);
		if($("#"+id+"[@name:check]:checked").val() > 0)
			{
				$("#quesDiv_"+urlID).show();
				
				
			}
		else
			{
				$("#quesDiv_"+urlID).hide();
//				alert("false");
			}
			
		//alert($("#"+id+"[@name:check]:checked").val() + " id: " + id);
	}

var count_radio;

function checkMobilePhone(mobileNumber)// length 11,  start with 07,8,9   trip all space once number cantrepeate more then 7
	{
		
      if(mobileNumber != "" && mobileNumber != 0)
		{

if(isNaN(mobileNumber))
	    {
			 return false;
		}
	    else 	
	     {
			 var str_value = mobileNumber;
			 
			 str = mobileNumber;
             str = str.length;
             
             var i=0;
			 var flage=0;
			 while(i < 2)
			  {
				 if(i==0 && str_value.charAt(i)!=0)
				 {
					flage=1;
					break;
				 }
				else if(flage==0 && i==1 && str_value.charAt(i)!=7)
				 {
				   	flage=1;
					break;
				 }
 
				i++;
			  }
			  
			  if(flage==1 || str!=11)
			   {
				 return false;
			   }
			   
             }
		 }
		else
			return false;

	return true;		
	}
	


function change_img(it, id, url)
{
	window.open('process_index2.php?custid='+url);
}


function checkHomePhone(phoneNumber)
	{
		
		
		if(isNaN(phoneNumber))
			{				
				 return false;
			}
			
		  else 	
			 {
				 
				 var str_value	=	phoneNumber;
				 str			=	phoneNumber;
				 str			=	str.length;
				 var i			=	0;
				 var flage		=	0;
			 
				 var f_2=0;				 
				 if(str_value.indexOf('000000')>=0 || str_value.indexOf('111111')>=0 || str_value.indexOf('222222') >=0|| str_value.indexOf('333333')>=0 || str_value.indexOf('444444')>=0|| str_value.indexOf('555555') >=0|| str_value.indexOf('666666')>=0 || str_value.indexOf('777777') >=0|| str_value.indexOf('888888') >=0|| str_value.indexOf('999999')>=0)
				 {
					 flage=1;
					 return false;
				 }
				 
			 while(i < 2)
			  {
				
				if(i==0 && str_value.charAt(i)==0)
				 {
				  f_2=1;
				 //break;
				 }
				 else if(i==0 && str_value.charAt(i)!=0)
				 {
					flage=1;
					break; 
				 }
				 
				if(f_2==1 && i==1 && (str_value.charAt(i)==1  || str_value.charAt(i)==2))
				 {
					
				 }
				 else if(f_2==1 && i==1)
				 {
					 flage=1;
					break;
				 }
 
				i++;
			  }
			  
			  if(flage==1 || str!=11)
			   {
				 return false;
 			   }
         }
	
	return true;
	
	}
function checkCampsValues()

	{
		var selectedItems = new Array();
		var myCheck = true;
		var mycname = "";
		var mycCheck	=	"";
		var mycvalue	=	"";
		$("input[@name='campIDS[]']:checked").each(function() {
			// ---------- checking for phones in creatives ------------------------------
			if($(this).val() >= 1)
			{
			//alert($(this).val())
			mycname		=	"campHomePhone_"+$(this).val();
				// ---------- checking for phones in creatives ------------------------------
			if($("#"+mycname)[0])
				{
					mycvalue	=	$("#"+mycname).val();
					mycCheck	=	checkHomePhone(mycvalue);
					if(mycCheck == false)
					{
						alert("Please enter HomePhone correctly");	
						$("#"+mycname).focus();
						myCheck = false;
						return false;
					}
				}
			mycname		=	"campMobilePhone_"+$(this).val();
			if($("#"+mycname)[0])
				{
					mycvalue	=	$("#"+mycname).val();
					mycCheck	=	checkMobilePhone(mycvalue);
					if(mycCheck == false)
						{
							alert("Please enter MobilePhone correctly");	
							$("#"+mycname).focus();
							myCheck = false;
							return false;
						}
				}
				var i = 1;
				while(i < 15)
					{
						var fieldName = $(this).val()+"_field"+i;
						
						
						if($("#"+fieldName)[0])
							{
								
								if($("#"+fieldName).val() == ""  ||  $("#"+fieldName).val() == "YYYY-MM-DD")	
									{
										alert("Please fill the details");
										//alert("RETUTN FALSE")
										$("#"+fieldName).focus();
										myCheck = false;
										return false;
									}
							}
					i++;
					}
			}
		});
		//$("input[@name='CampIDS[]']:checked").each(function() {
			//alert("MyCamp = ".$(this).val());
		//});
	if(myCheck == false)
		return false;	
	else
		return true;	
		return false;
	}

function check()
{	

	if(document.frmmain.title && $("#isCumpulsory_title").html() == "*")
	{
	if(document.frmmain.title.value =="" || document.frmmain.title.value=="~Select")
		{
			alert("Please Select A Title");
			document.frmmain.title.focus();
			return false;
		}
	}
	
	if(document.frmmain.firstName && $("#isCumpulsory_firstName").html() == "*")
	{
		if(document.frmmain.firstName.value=="")
			{
			alert("Please Enter First Name");
			document.frmmain.firstName.focus();
			return false;
			}
			
			if(!isNaN(document.frmmain.firstName.value))
			{
				alert("Your First Name appears to be in-correct");
				document.frmmain.firstName.focus();
				return false;
			}
			
			
			// If the element's string matches the regular expression it is all letters

			var alphaExp = /^[a-zA-Z]+$/;
				if(!document.frmmain.firstName.value.match(alphaExp))
				{
					alert("Your First Name appears to be in-correct");
					document.frmmain.firstName.focus();
					return false;
				}

	}  // end first Name
	
	if(document.frmmain.lastName && $("#isCumpulsory_lastName").html() == "*")
	{
		if(document.frmmain.lastName.value=="")
			{
				alert("Please Enter Last Name");
				document.frmmain.lastName.focus();
				return false;
			
			}
			
		if(!isNaN(document.frmmain.lastName.value))
			{
				
				alert("Your Last Name appears to be in-correct");
				document.frmmain.lastName.focus();
				return false;

			}
			
			var len	= document.frmmain.lastName.value;
			var len_lname=len.length;
			if(len_lname<=2)
			{
				alert("Your Last Name appears to be in-correct");
				document.frmmain.lastName.focus();
				return false;
			}
			
			
			
	}
				//$$$$$$$$$$$$$$$$$$$$ Email $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$4
	
	if(document.frmmain.email && $("#isCumpulsory_email").html() == "*")
	{
		
	if(document.frmmain.email.value=="")
			   
		{
				alert("Please Enter Correct Email.");
				document.frmmain.email.focus();
				return false;
		}
			
			else
				
			{
					var str=document.frmmain.email.value;
					var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
					
					if (!filter.test(str))
							
						   {
								alert("Please enter valid email address.");
								document.frmmain.email.focus();
								return false;
							}
						
/*					
			  		else
					
							{
								if(document.getElementById('div_email').innerHTML == "Email Exists")
							
									{
							
										alert("Email Already Exists");
										return false;
						
									}
				
							}*/
			}
		}


		if(document.frmmain.password && $("#isCumpulsory_password").html() == "*")
		{
			if(document.frmmain.password.value== "")
			
				{
					alert("Please Enter the correct Password");
					document.frmmain.password.focus();
					return false;
				}
		}

	
	if(document.frmmain.gender && $("#isCumpulsory_gender").html() == "*")
	{
		if(document.frmmain.gender.value=="")
		{
		alert("Please Select Your Gender");
		document.frmmain.gender.focus();
		return false;
		}
	}

	if(document.frmmain.Day)
	{
	if(document.frmmain.Day.value=="")
			{
				alert("Please Select  Day Of Birth");
				document.frmmain.Day.focus();
				return false;
			}
	}
	
	
	if(document.frmmain.Month)
	{
	if(document.frmmain.Month.value== "")
		{
			alert("Please Select  Month Of Birth");
			document.frmmain.Month.focus();
			return false;
		}
	}
			
	if(document.frmmain.Year)
	{
		if(document.frmmain.Year.value== "")
			{
				alert("Please Select Year Of Birth");
				document.frmmain.Year.focus();
				return false;
			}
	}
	if(document.frmmain.address1 && $("#isCumpulsory_address1").html() == "*")
	{
		if(document.frmmain.address1.value == "")
			{
				alert("Please Enter the correct Address");
				document.frmmain.address1.focus();
				return false;
			}
	}
	if(document.frmmain.address2 && $("#isCumpulsory_address2").html() == "*")
	{
		if(document.frmmain.address2.value == "")
			{
				alert("Please enter the correct Address");
				document.frmmain.address2.focus();
				return false;
			}
	}
	
	if(document.frmmain.city && $("#isCumpulsory_city").html() == "*")
	{
		if(document.frmmain.city.value== "")
			
			{
				alert("Please enter the correct Town");
				document.frmmain.city.focus();
				return false;
			}
			
			if(!isNaN(document.frmmain.city.value))
			{
				
				alert("Your Town appears to be in-correct");
				document.frmmain.city.focus();
				return false;

			}
			
			var len	= document.frmmain.city.value;
			var len_city=len.length;
			
			if(len_city<=2)
			{
			alert("Your town appears to be in-correct");
			document.frmmain.city.focus();
			return false;
			}
			
			
			
				var alphaExp = /^[a-zA-Z ]+$/;
				if(!document.frmmain.city.value.match(alphaExp))
				{
					alert("Your town appears to be in-correct");
					document.frmmain.city.focus();
					return false;
				}

			
	}


	if(document.frmmain.state && $("#isCumpulsory_state").html() == "*")
	{
		if(document.frmmain.state.value== "")
			
			{
				alert("Please Enter the correct County");
				document.frmmain.state.focus();
				return false;
			}
			
			if(!isNaN(document.frmmain.state.value))
			{
				
				alert("Your County appears to be in-correct");
				document.frmmain.state.focus();
				return false;

			}
			
			
			var len	= document.frmmain.state.value;
			var len_state=len.length;
			
			if(len_state<=2)
			{
			alert("Your County appears to be in-correct");
			document.frmmain.state.focus();
			return false;
			}
			
			
				var alphaExp = /^[a-zA-Z ]+$/;
				if(!document.frmmain.state.value.match(alphaExp))
				{
					alert("Your County appears to be in-correct");
					document.frmmain.state.focus();
					return false;
				}


			
	}

			
			//$$$$$$$$$$$$$$$$$$$$ Post Code $$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$$4
	if(document.frmmain.postCode && $("#isCumpulsory_postCode").html() == "*")
	{
		if(document.frmmain.postCode.value=="")
		{
			alert("Please Enter the correct Post Code");
				document.frmmain.postCode.focus();
				return false;
		}
			else
				{
							var postcode = document.frmmain.postCode.value;
							var len = postcode.length;
							if(len<6 || len>8 || postcode.indexOf(" ")== -1)
							{
								alert("Your Post Code appears to be in-correct");
								document.frmmain.postCode.focus();
								return false;
							}
							else
							{/*
								
							var count = 0 ;
							var str = postcode.split(" ");
							var begin=str[0];
							var last=str[1];
							if(last.length==3 && (begin.length== 2 || begin.length== 3 || begin.length== 4))
							{
							validchars1="1234567890";
							validchars2="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
							validchars3="1234567890abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
							if(((validchars1.indexOf(last.charAt(0))<0)||(validchars3.indexOf(last.charAt(1))<0)||(validchars2.indexOf(last.charAt(2)))<0) )
							{
								count+=0;
							}
							else 
							{
								count+=1;
							}
							
							if(begin.length==4)
							{
							 if(((validchars2.indexOf(begin.charAt(0))<0)||(validchars2.indexOf(begin.charAt(1))<0)||(validchars3.indexOf(begin.charAt(2)))<0)||(validchars3.indexOf(begin.charAt(3))<0))
								{			 
									count+=0;
								 }
								else 
								{
								count+=1;
								}
							}
							
							if(begin.length==3)
							{
								if(((validchars2.indexOf(begin.charAt(0))<0)||(validchars3.indexOf(begin.charAt(1))<0)||(validchars1.indexOf(begin.charAt(2)))<0))
								{			 
									count+=0;
								 }
								else 
								{
									count+=1;
								}
								
								
							}
							
							else if(begin.length==2)
								{
									if(((validchars2.indexOf(begin.charAt(0))<0)||(validchars1.indexOf(begin.charAt(1)))<0))
									{			 
										count+=0;
									 }
									else 
									{
									count+=1;
									}
									
								 }
							
							if(count!=2)
								{
									 alert("Your Post Code appears to be in-correct");
									 document.frmmain.postCode.focus();
									 return false;
								}
							 }
							else
								{
									alert("Your Post Code appears to be in-correct");
									document.frmmain.postCode.focus();
									return false;
								}
							
						   */}
		   
				}
		
		}


	if(document.frmmain.homePhone && $("#isCumpulsory_homePhone").html() == "*")
	{
		var str_homePhone=$("#homePhone").val();
		if(checkHomePhone(str_homePhone)==false)
		{
			alert ("Invalid Home Phone");
			$("#homePhone").focus();
			return false;
		}

	
	
	}
	
	if(document.frmmain.landlineProvider && $("#isCumpulsory_landlineProvider").html() == "*")
	{
		if(document.frmmain.landlineProvider.value=="" || document.frmmain.landlineProvider.value=="~Select")
			{
			alert("Please Select landlineProvider");
			document.frmmain.landlineProvider.focus();
			return false;
			}
	}
	//naveennnnnnnnnnnnnnnnn
	if(document.frmmain.mobilePhone )
	{
		
		var str_mobile=$("#mobilePhone").val();	
		if(($("#isCumpulsory_mobilePhone").html() == "*") || (str_mobile!='0' && str_mobile!='07'))
		{
		if(checkMobilePhone(str_mobile)==false)
		{
			alert ("Invalid Mobile Phone");
			$("#mobilePhone").focus();
			return false;
		}
		}

	}
	

	if(document.frmmain.homeStatus && $("#isCumpulsory_homeStatus").html() == "*")
	{
		if(document.frmmain.homeStatus.value=="" || document.frmmain.homeStatus.value=="~Select")
			{
			alert("Please Select Home Owner");
			document.frmmain.homeStatus.focus();
			return false;
			}
	}
	
	if(document.frmmain.occupation && $("#isCumpulsory_occupation").html() == "*")
	{
		if(document.frmmain.occupation.value=="" || document.frmmain.occupation.value=="~Select")
			{
			alert("Please Select Occupation");
			document.frmmain.occupation.focus();
			return false;
			}
	}

	if(document.frmmain.annualIncome && $("#isCumpulsory_annualIncome").html() == "*")
	{
		if(document.frmmain.annualIncome.value=="" || document.frmmain.annualIncome.value=="~Select")
			{
			alert("Please Select annualIncome");
			document.frmmain.annualIncome.focus();
			return false;
			}
	}


	if(document.frmmain.maritalStatus && $("#isCumpulsory_maritalStatus").html() == "*")
	   {

		if(document.frmmain.maritalStatus.value=="" || document.frmmain.maritalStatus.value=="~Select")
			{
			alert("Please Select Your Marital Status");
			document.frmmain.maritalStatus.focus();
			return false;
			}
	   }

	if(document.frmmain.peopleLiving && $("#isCumpulsory_peopleLiving").html() == "*")
	{
	if(document.frmmain.peopleLiving.value=="" || document.frmmain.peopleLiving.value=="~Select")
			{
			alert("Please Select People Living Status");
			document.frmmain.peopleLiving.focus();
			return false;
			}
	}


	if(document.frmmain.underEighteen && $("#isCumpulsory_underEighteen").html() == "*")
	{
		if(document.frmmain.underEighteen.value=="" || document.frmmain.underEighteen.value=="~Select")
			{
			alert("Please Select UnderEighteen Status");
			document.frmmain.underEighteen.focus();
			return false;
			}
	}
	
	if(document.getElementById('terms'))
		{
			if(document.getElementById('terms').checked == false)
				{
					alert("Please check terms and privacy policy");
					return false;	
				}
		}
	
	if($("#cityState"))
	{
		if ($("#cityState").val()=="")
		{
			alert ("Please enter valid postCode");
			return false;
		}
	}
	else
	{
		alert ("Please enter valid postCode");
		return false;
	}
	
	
return true;	
}

/*

	
function preloadimages()
	{
		alert("IN SINE " + preloadimages.arguments.length)
		for (i = 0; i < preloadimages.arguments.length; i++)
			{
				myimages[i] 		= new Image();
				myimages[i].src 	= preloadimages.arguments[i];
				
				alert("IN"+ preloadimages.arguments[i])
			}
	}*/
/*	
function ravi(GiftId,image_name,mystyle,giftname,giftmagepadd)
	{
	
	if(headerchange == "Yes")
		{
			var i = 1;
			while(i <= headersplits)
				{
					document.getElementById('header_'+i).src = "images/header_"+i+"_"+giftmagepadd+".jpg";
					
					i++;
				}
			document.getElementById('submit').src = "images/button_"+giftmagepadd+".jpg";	
		}
							
		document.getElementById('myGiftID').value = GiftId;
		document.getElementById('formHeading').innerHTML = giftname;
		prevContent = document.getElementById('middle_right').innerHTML;
		
		//document.getElementById('middle_right').innerHTML = '<a onclick="back_to__images()" style=color:red>back</a><img src="'+image_name+'">';/
		
		document.getElementById('middle_right').innerHTML = '<input type="button" value="Back" onclick="back_to__images()" id="back_button"/><img src="'+image_name+'"><div id="gift_description"></div>';
		document.getElementById('gift_description').innerHTML = document.getElementById('hid_gift_desc_'+GiftId).value;
		document.getElementById('').href = "styles/"+mystyle;
	}*/
/*
function back_to__images()
	{	
	
	if(headerchange == "Yes")
		{
			var i = 1;
			while(i <= headersplits)
				{
					document.getElementById('header_'+i).src = "images/header_"+i+".jpg";
					i++;
				}
				
			document.getElementById('submit').src = "images/button.jpg";	
		}
		
		document.getElementById('myGiftID').value = "";
		document.getElementById('formHeading').innerHTML = "Select the prize and enter the draw";
		document.getElementById('middle_right').innerHTML = prevContent;
		document.getElementById('').href = "styles/homepage.css";
		
	}
	*/


function load_form(myGiftID)
	{
		
		
			var posturl	= "registration_form1.php?fromlogin=yes";
			$.ajax({
			  type:"POST", 
			  url:posturl,
			  data:{},
			  dataType:"html",
			  success:function ( data ) { 
				
				$("div#form").html(data);		 
				$("input#myGiftID").val(myGiftID);
			  } ,
			  
			  error:function(xhr,err,e){ alert( "Error: " + err ); }
			}); // $.ajax()
		
	}
	
function Login_Now(str)
	{
		$("#Login_error_mesage").html("").show(); 
		
		var email 			=	$("input#loginEmail").val();
		var password 		=	$("input#loginPassword").val();
		
		
		//alert("Helloo");
		//alert($("input#whattodoNow").val());
		
		if($("input#whattodoNow").val() == "Forgot") 
		{
			var ajaxaction	=	'chkRegFieldName';
			//alert("IN");
			$.post("ajaxcon.php", {ajaxaction:ajaxaction, email:email}, function(data){
																				 
				$("#Login_error_mesage").html(data);
			});
			
			return false;
		
		}
		else
		{
		
		if($("input#search_btn"))
		{
		var search_btn 		=	$("input#search_btn").val();
		var page 		=	$("input#page").val();
		var search_str		=	$("input#search").val();
		}
		
		if(email == "")
			{
				alert("Please enter email");
				return false;
			}
			
		
		if(password == "")
			{
				alert("Please enter password");
				return false;
			}
			
		var posturl = "";	
		
		if(str == "home")
			posturl			=	"process_login.php";
		else
			posturl			=	"../process_login.php";
			
		
		//alert(posturl);
		
				$.ajax({
				  type:"POST", 
				  url:posturl,
				  data:{email:email,password:password},
				  dataType:"html",
				  success:function ( data ) { 
				  //alert(data);
					if(data.indexOf("Refresh") >= 0)
						{
							
							if($("input#search_btn") && (search_str=="" || search_str=="undefined"))
							window.location.href = "\?loggedIn";
							else
							window.location.href = "\?loggedIn&search="+search_str+"&search_btn="+search_btn+"&page="+page;
							
						}
					else
						{
							if(str == "home")
							{
								//alert(data);
								$("input#loginEmail").focus();
								$("#Login_error_mesage").html( data ); 
								
							}
							else
							{
								$("#Login_error_mesage").html( data ); 
							}
						}
				  
				  } ,
				  
				  error:function(xhr,err,e){ alert( "Error: " + err ); }
				}); // $.ajax()
				
		}
		
		return false;
	}


function my_submit2(cat_id,prize)
	{
		
		var myFlag = check();
		
		//var myFlag = true;
		
			if(myFlag == false)
				return false;
	

			//var campCheckFlag = checkCampsValues();
			
			var campCheckFlag = true;
			
			//alert(campCheckFlag)
			if(campCheckFlag == false)
				return false;
		
		
		//if(document.getElementById("hidden_count") != null){
			
		var radio_len = document.getElementById("hidden_count").value;
		var chk_all_radio_not_chek=0;
		var yes_length=0;
		
		$("input[@name='campIDS[]']:checked").each(function() {
			
			yes_length++;
			
		});
		
		//alert(yes_length);
		
		
		if(yes_length<0)
			{
				alert("Please Click Atleast Two Yes Option");
				return false;
			}
		
		
		var myPostData  = $('form#frmmain').serialize();
		
		//alert(myPostData);
		
		 var postUrl = "";
  
  if(cat_id == "")
  	 postUrl = "process_index1.php?js=yes";
	else
		postUrl = "../process_index1.php?js=yes";
		
		//alert(postUrl);
		
		$.post(postUrl, myPostData, function(data) {
											 //alert("hjh")
														 
				//alert(data);
				if(data.indexOf("DONESECOND") != -1)
					{
					 if(cat_id == "")
						 window.location.href = "thanks.html";
						else 
							window.location.href = "../"+cat_id+"/"+prize+"-2-2.html";
					}
				else
					{	
					
						//alert("page2")
					  	//alert("OKK");
					  
					}											 
																	
		
		});
		
		/*for(i=0; i<radio_len; i++){
			alert(i);
			var getradio = document.getElementById("radCampIds_"+i).getElementsByTagName("input");
			
			if(getradio[0].checked == false && getradio[1].checked == false){
				chk_all_radio_not_chek=1;
			//	return false;
			}
			
			if(getradio[0].checked == true){
				yes_length=yes_length+1;
				
			}
		}   // end for loop
		

		if(chk_all_radio_not_chek==1)
		{
		alert("Please select radio button");
		return false;
		}
		
			if(document.getElementById('terms') == null)
	{	
		
				if(radio_len>4)
			{

				if(yes_length<2)
					{
						alert("Please Click Atleast Two Yes Option");
						return false;
					}
	}
			}
	}*/
		
		//alert("OVER")
		
		return false;
	}



function forgotpassword()
{
	if(cat_id == "")
  	 prefix = "";
	else
		prefix = "../";
		
	
	if(document.getElementById('ForgetEmail').value == "")
		{
			alert("Please Enter Correct Email");
			//$("#submit").attr("disabled",false).css('opacity', 1);
			return false;
		}
	
	$("#forgot_error").html("<center><b>Please Wait.....</b><img src='"+prefix+"'images/loaderA32.gif'><center>");
	
	
	
	var email 		=	$("#ForgetEmail").val();
	
	var ajaxaction	=	'chkRegFieldName';
	
	$.post("ajaxcon.php", {ajaxaction:ajaxaction, email:email}, function(data){
		$("#forgot_error").html(data);
	});
	
}


function defaultImg(id,imag,path,rootDir)
{
 var myimage = rootDir+path+imag;
 
		var ajaxaction	=	'updateRegImage';
		var myIpath = rootDir+"upload_crop.php?ii="+rootDir+"&custID="+id;
		
	if(opener.document.getElementById("custThumbImage"+id))
	{
		opener.document.getElementById("custThumbImage"+id).innerHTML = "Please wait...";
	}
		
		var str = '<img src="'+myimage+'" alt="" style="cursor:pointer" onclick="window.open(\''+myIpath+'\',\'winthedraw\',\'height=500,width=600,top=100,left=200\')"/>';
	
	
	if(opener.document.getElementById("custThumbImage"+id))
	{
		opener.document.getElementById("custThumbImage"+id).innerHTML = str;
	}
	
	$.post("ajaxcon.php", {ajaxaction:ajaxaction, id:id,imag:imag}, function(data){
	
	window.close();
		//$("#forgot_error").html(data);
	});

}




function my_submit(cat_id,prize)
{
	
	var prevVal = $("#divSubmit").html();
	
	var myFlag = check();
	
	if(myFlag == false)
		{
			//$("#divSubmit").html(prevVal);
			return false;
		}
	
	if($("#div_email").html() == "invalid")
		{
			alert("Please enter a valid email address");
			return false;
		}
		
	if($("#cityStateDiv").html() == "Invalid postCode")
		{
			alert("Please enter a postCode");
			return false;
		}
	
	
	$("#divSubmit").html("Please wait...");
	//else
		//$("#regpagesubmit").attr("disabled",false).css('opacity', 1);
				
				/*if(document.getElementById("hidden_count") != null){
				var radio_len = document.getElementById("hidden_count").value;
				var chk_all_radio_not_chek=0;
				var yes_length=0;
				for(i=0; i<radio_len; i++){
					//alert("yes_length" + yes_length);
					var getradio = document.getElementById("check_radio"+i).getElementsByTagName("input");
					if(getradio[0].checked == false && getradio[1].checked == false){
						chk_all_radio_not_chek=1;
					//	return false;
					}
					
					if(getradio[0].checked == true){
						yes_length=yes_length+1;
						
					}
				}   // end for loop
				
				if(chk_all_radio_not_chek==1)
				{
				alert("Please select radio button");
				return false;
				}
			
			}		*/		
			
	var myPostData  = $('form#frmmain').serialize();
			
			//alert("str : "+myPostData);
			
	
  //alert(myPostData);
  var postUrl = "";
  
  if(cat_id == "")
  	 postUrl = "process_index.php?js=yes";
	else
		postUrl = "../process_index.php?js=yes";
		
		$.post(postUrl, myPostData, function(data) {
											 
				//alert(data)
				if(data.indexOf("Done") != -1)
					{
						if(cat_id == "")
							{
								//window.location.href = "register-1.html";
								window.location.href = "Auto/Win-a-Ford-Ka.html";
							}
						else	
							window.location.href = "../"+cat_id+"/"+prize+"-1.html";
					}
				else
					{	
						
						if(data.indexOf("Please fill all cumpulsory fields") != -1)
						{
							alert("Please fill all cumpulsory fields");
							$("#divSubmit").html(prevVal);
							return false;
						}
						else if(data.indexOf("Duplicate") != -1)
						{
							alert("Email Duplicate");
							$("#divSubmit").html(prevVal);
							return false;
						}
						else
						{
							alert("Some Error Occured ; \n\n Please contact site admin");
							$("#divSubmit").html(prevVal);
							return false;
						}
						//alert("page2")
					  	//alert("OKK");
					  	
						//$("div#submit_result").html( data ); 
					  //$("#submit").attr("disabled",false).css('opacity', 1);
					  
					  
					}											 
																	
		//$("#msg"+qid).html(data);												
		
		});
			
			
		
			
			

return false;
}


function email_check(cat_id)
	{
		var posturl = "";

		if(cat_id == "")
			postUrl = "check_email.php";
		else
			postUrl = "../check_email.php";
				
		var email 	=	$("input#email").val();
			$.ajax({
			  type:"POST", 
			  url:postUrl,
			  data:{ email:email},
			  dataType:"html",
			  success:function ( data ) { 
			 
				if(data.indexOf('Available') >= 0)
					{
						$("#regpagesubmit").attr("disabled",false).css('opacity', 1);
					}
				else
					$("#regpagesubmit").attr("disabled",true).css('opacity', 0.5);
					
			  $("div#div_email").html( data ); 
			  
			  if(data == "Duplicate")
			  
					click_options("LoginDup",cat_id);	
			  
			  } ,
			  error:function(xhr,err,e){ alert( "Error: " + err ); }
			}); // $.ajax()

	
	}

function setFocusOnEmailLogin()
	{
	 $('#LoginEmail').focus();
	}
	
function click_options(choice , cat_id)	
	{
		$("div#form").html("");
		var prefix = "";
		if(cat_id != "")
			prefix = "../";
		
		var posturl = "";
		
		if(choice == "Login")
				{
					$("input#regpagesubmit").hide();
					posturl = prefix+"login.php?cat_id="+cat_id+"&rp="+prefix;
					$.post(posturl, {choice:choice}, function(data) {
					
					$("div#enter_textpart_sub").html( "If you are a new member. <a style='cursor:pointer; color:#FF0000' onclick=\"click_options(\'Register\',\'"+cat_id+"\')\"> Click Here </a>" ); 
					
					$("div#form").html( data ); 
					 	 setTimeout("setFocusOnEmailLogin()",500);
									 
		
					});
					
					/*$.ajax({
					  type:"POST", 
					  url:posturl,
					  data:{choice:choice},
					  dataType:"html",
					  success:function ( data ) { 
					  $("div#form").html( data ); 
					 	 setTimeout("setFocusOnEmailLogin()",500);
					 // $('input.focus:LoginPassword').focus();
					  
					  } ,
					  error:function(xhr,err,e){ alert( "Error: " + err ); }
					}); // $.ajax()*/
					
					
					//document.getElementById("shw_camp").style.display = 'none'
					//document.getElementById("button").style.display = 'none'
				// $('#LoginPassword').focus();
				}
			else if(choice == "Register")
				{
					$("input#regpagesubmit").show();
					posturl = prefix+"registration_form1.php?fromlogin=yes&cat_id="+cat_id+"&rp="+prefix;
					//alert(posturl);
					//var posturl = "../registration_form1.php?fromlogin=yes";
				
					$.ajax({
					  type:"POST", 
					  url:posturl,
					  data:{},
					  dataType:"html",
					  success:function ( data ) { 
					  $("div#form").html( data );
					  
					  $("div#enter_textpart_sub").html( "If you are already a member. <a style='cursor:pointer; color:#FF0000' onclick=\"click_options(\'Login\',\'"+cat_id+"\')\"> Click Here </a>" );
					  
					  } ,
					  error:function(xhr,err,e){ alert( "Error: " + err ); }
					}); // $.ajax()
					
				document.getElementById("shw_camp").style.display = '';
				document.getElementById("button").style.display = ''
				
				}
				
			else if(choice == "forget")
				{
						$("input#regpagesubmit").hide();
						
						posturl = prefix+"forget_password.php?fromlogin=yes&cat_id="+cat_id+"&rp="+prefix;
						//var posturl			=	"../forget_password.php";
					$.ajax({
						  type:"POST", 
						  url:posturl,
						  data:{},
						  dataType:"html",
						  success:function ( data ) { 
							
								$("div#form").html( data ); 
						  
						  } ,
						  
						  error:function(xhr,err,e){ alert( "Error: " + err ); }
						}); // $.ajax()	
					
				document.getElementById("shw_camp").style.display = 'none'
				document.getElementById("button").style.display = 'none'
				
				}
				
			else if(choice == "LoginDup")
				{
				$("input#regpagesubmit").hide();
				posturl = prefix+"login.php?type1=DUP&cat_id="+cat_id+"&rp="+prefix;
				//var posturl = "../login.php?type1=DUP";
				
					$.ajax({
					  type:"POST", 
					  url:posturl,
					  data:{choice:choice},
					  dataType:"html",
					  success:function ( data ) { 
					  $("div#form").html( data ); 
					 	 setTimeout("setFocusOnEmailLogin()",500);
					 // $('input.focus:LoginPassword').focus();
					  
					  } ,
					  error:function(xhr,err,e){ alert( "Error: " + err ); }
					}); // $.ajax()
					
					
					document.getElementById("shw_camp").style.display = 'none'
					document.getElementById("button").style.display = 'none'
				// $('#LoginPassword').focus();
				}	
			
		//alert("testing");	
	
	}
	
	
	

function check_contact()
{	
if(document.frmmain.firstName)
	{
		
	if(document.frmmain.firstName.value =="")
		
		{
			alert("Please Enter The Name");
			document.frmmain.firstName.focus();
			return false;
		
		}
		
	}
		
	if(document.frmmain.email)
	{
	if(document.frmmain.email.value=="")
			   
		{
				alert("Please Enter Correct Email.");
				document.frmmain.email.focus();
				return false;
		}
			
			else
				
			{
					var str=document.frmmain.email.value;
					var filter=/^([\w-]+(?:\.[\w-]+)*)@((?:[\w-]+\.)*\w[\w-]{0,66})\.([a-z]{2,6}(?:\.[a-z]{2})?)$/i;
					
					if (!filter.test(str))
							
						   {
								alert("Please enter valid email address.");
								document.frmmain.email.focus();
								return false;
							}
						
					

			}
		}



if(document.frmmain.homePhone)
	{
		
	if(document.frmmain.homePhone.value =="")
		
		{
			alert("Please Enter homePhone ");
			document.frmmain.homePhone.focus();
			return false;
		
		}
		
		if(isNaN(document.frmmain.homePhone.value))
			
			{
				 alert("Please enter home phone in number ");
				 document.frmmain.homePhone.focus();
				 return false;
			}
		
	}



if(document.frmmain.message1)
	{
		
	if(document.frmmain.message1.value =="")
		
		{
			alert("Please Enter Message");
			document.frmmain.message1.focus();
			return false;
		
		}
		
	}
	

	}



function perform_inaction(CampID)
{
	
$("#div_creative_"+CampID).hide("slow");	
	
}


	function perform_action(mycheck,CampID,ShowCreative,Units)
		{
			/*if(mycheck.checked == true)
				{
					var value = parseInt($("input#CountChecked").val()) + 1;
					$("input#CountChecked").val(value);
				}	
			else
				{
					var value = parseInt($("input#CountChecked").val()) - 1;
					$("input#CountChecked").val(value);	
				}	*/
		
		/*if($("input#CountChecked").val() >= 1)
			$("#submit").attr("disabled",false).css('opacity', 1);
		else
			$("#submit").attr("disabled",true).css('opacity', 0.4);
		*/		
			if(ShowCreative == "Y")
				{
					if(mycheck.checked == true)
						{
							$("#div_creative_"+CampID).show("slow");
							
							if($("#campTitle_"+CampID))
								$("#campTitle_"+CampID).val($("#title").val());
							
							if($("#campFirstName_"+CampID))
								$("#campFirstName_"+CampID).val($("#firstName").val());
							
							if($("#campLastName_"+CampID))
								$("#campLastName_"+CampID).val($("#lastName").val());
							
							if($("#campEmail_"+CampID))
								$("#campEmail_"+CampID).val($("#email").val());
							
							if($("#campCity_"+CampID))
								$("#campCity_"+CampID).val($("#city").val());
								
							if($("#campState_"+CampID))
								$("#campState_"+CampID).val($("#state").val());
							
							if($("#campAddress1_"+CampID))
								$("#campAddress1_"+CampID).val($("#address1").val());
								
							if($("#campAddress2_"+CampID))
								$("#campAddress2_"+CampID).val($("#address2").val());
							
							if($("#campPostCode_"+CampID))
								$("#campPostCode_"+CampID).val($("#postCode").val());
							
							if($("#campDay_"+CampID))
								$("#campDay_"+CampID).val($("#Day").val());
							
							if($("#campMonth_"+CampID))
								$("#campMonth_"+CampID).val($("#Month").val());
							
							if($("#campYear_"+CampID))
								$("#campYear_"+CampID).val($("#Year").val());
							
							if($("#campHomePhone_"+CampID))
								$("#campHomePhone_"+CampID).val($("#homePhone").val());
								
								if($("#campCountry_"+CampID))
								$("#campCountry_"+CampID).val($("#country").val());
								
								if($("#campMaritalStatus_"+CampID))
								$("#campMaritalStatus_"+CampID).val($("#maritalStatus").val());
								
								if($("#campHomeStatus_"+CampID))
								$("#campHomeStatus_"+CampID).val($("#homeStatus").val());
								
								if($("#campMobilePhone_"+CampID))
								$("#campMobilePhone_"+CampID).val($("#mobilePhone").val());

								
								if($("#campOccuptation_"+CampID))
								$("#campOccuptation_"+CampID).val($("#occupation").val());


							
						}
					else
						$("#div_creative_"+CampID).hide("slow");	
				}
			else
				{
					/*var posturl 		= "process_campaigns.php";
					$.ajax({
					  type:"POST", 
					  url:posturl,
					  data:{CampID:CampID,Units:Units},
					  dataType:"html",
					  success:function ( data ) { 
					
						if(data == "Done")
							$("#SpanCamp_"+CampID).html( data );
					  } ,
					  
					  error:function(xhr,err,e){ alert( "Error: " + err ); }
					}); // $.ajax()*/
				}	
						
		}	
		
		
///////

//////



// is for showiing the subquestions of a particular event
function showSubQuestions(myObj , fieldName , questionID , campID)
	{
			var fieldValue	= myObj.value;;
		
			$.post("../get-subques-process.php", {fieldValue:fieldValue, fieldName:fieldName, questionID:questionID , campID:campID}, function(data) { 
				
				var mydata = data.split('||||||||||');
				
				if(mydata[1] != "NoSubQues")
				{
					$("#sub_question_"+questionID).css("display", "inline");
					$('#sub_question_'+questionID).html(mydata[1]);
				}
				
				if(mydata[0].indexOf('Y') == -1)
					{
						$("#"+fieldName+"_"+questionID).css("background","#FDBCB5");
					}
				else 
					$("#"+fieldName+"_"+questionID).css("background","#BBFFBB");
				
		});
			
	}
	
function my_submit3()
{
	var campID = "";
	var flag = 1;
	
	
	//======== CUMPULSORY CAMP ============================================
	$("input.hiddenCampsQuestionIds").each(function (index)
	{
		
		campID = $(this).val();
		
		
		$("select.ClassMyCampJSValidate_"+campID).each(function (index)
		{
			//alert("select " + $(this).name + " Val : >>>" + $(this).val() + $(this).get(0).type);
			if($(this).val() == "" || $(this).val() == "~Select" || $(this).val() == "~select")
				{
					$(this).focus();
					$(this).css("background","#FDBCB5");
					flag = 2;
					
					//alert(flag)
				}
					
		});
		
		
		
		$("input.ClassMyCampJSValidate_"+campID).each(function (index)
		{
			//alert("input " + $(this).name + " Val : >>>" + $(this).val() + $(this).get(0).type);
			
			if($(this).val() == "" || $(this).val() == " ")
				{
					$(this).focus();
					$(this).css("background","#FDBCB5");
					flag = 2;
					
					//alert(flag)
				}
			
		});
		
		
	});
	
	//alert("flag Cum : " + flag);
	
	if(flag == 2)
		return false;
		
	//alert(flag);
	//======== END CUMPULSORY CAMP ============================================
	/*$("QcampIDS").each(function() {
		alert($(this).val())
	});*/
	
	//return false;
	
	//alert("OTHER CAMP NOT CUMPULSORY");
	
	var isCampNeedsAllData = 0;
	
	$("input.hiddenNotCumCampIDs").each(function (index)
	{
		isCampNeedsAllData = 0;
		campID = $(this).val();
		
		//alert("campID :  " + campID);
		
		$("select.ClassMyCampJSValidate_"+campID).each(function (index)
		{
			//alert("select " + $(this).name + " Val : >>>" + $(this).val() + $(this).get(0).type);
			if($(this).val() == "" || $(this).val() == "~Select" || $(this).val() == "~select")
				{
					//$(this).focus();
					//$(this).css("background","#FDBCB5");
					//isCampNeedsAllData = 2;
				}
			else
				{
					isCampNeedsAllData = 2;
				}
					
		});
		
		/*$("input.ClassMyCampJSValidate_"+campID).each(function (index)
		{
			alert("input " + $(this).name + " Val : >>>" + $(this).val() + $(this).get(0).type);
			
			if(($(this).val() == "" || $(this).val() == " ") && $(this).get(0).type != "checkbox")
				{
					//$(this).focus();
					//$(this).css("background","#FDBCB5");
					//isCampNeedsAllData = 2;
				}
			else
				{
					isCampNeedsAllData = 2;
				}	
			
		});*/
		
				
				$("select.ClassMyCampJSValidate_"+campID).each(function (index)
				{
				
				//alert(" COLOR isCampNeedsAllData:  " + isCampNeedsAllData)
				
				if($(this).val() == "" || $(this).val() == "~Select" || $(this).val() == "~select")
					{
						if(isCampNeedsAllData == 2)
						{
							$(this).focus();
							$(this).css("background","#FDBCB5");
							flag = 2;
						}
						else
						{
							$(this).focus();
							$(this).css("background","#FFFFFF");
						}
						
					}
				});
			
				
				
				$("input.ClassMyCampJSValidate_"+campID).each(function (index)
				{
					//alert("isCampNeedsAllData:  " + isCampNeedsAllData)
					
					if($(this).val() == "" || $(this).val() == " ")
						{
							if(isCampNeedsAllData == 2)
							{
								$(this).focus();
								$(this).css("background","#FDBCB5");
								flag = 2;
							}
							else
							{
								$(this).focus();
								$(this).css("background","#FFFFFF");
							}
						}
				});
				
				//alert("LOP FLAG : " + flag);
				
			
	});	
	
	
	//alert("FLINAL : " + flag);
		//return false;


	if(flag == 2)
		return false;
	else
		return true;
	
}

function forgot_pass(type)
{
	$("#Login_error_mesage").html("").hide(); 
	var str = "";
	
	if(type == 1) // login
	{
		$("#login_text_main_fg").show();
		str = '<a style="cursor:pointer" onclick="forgot_pass(\'2\')" title="Forgot your password">Forgot your password?</a> &nbsp; | &nbsp;   <a href="register.html" title="Join Now">Join Now</a>';
		
		$("#forgote_box_txt").html(str);
		$("#whattodoNow").val("Login");
	}
	else
		{
			$("#login_text_main_fg").hide();
			str = '<a style="cursor:pointer" onclick="forgot_pass(\'1\')" title="Login">Login </a> &nbsp; | &nbsp;   <a href="register.html" title="Join Now">Join Now</a>';
			$("#forgote_box_txt").html(str);
			$("#whattodoNow").val("Forgot");
		}
	
}

function registerNow()
{
	window.location.href='../register.html';
}

function setCategoryID(id,path,redirectTo)
{
	
	var u = path+"ajaxcon.php";
	//alert("klk");
	$.post(u, {idd:id,ajaxaction:'setCatID'}, function(data) {
													   
		window.location.href = redirectTo;		  //alert("klk");
	
});
	
}



function get_dialog_Message(acttype, cat_id)
{
var ajaxaction	=	acttype;

if(cat_id == "")
	posturl			=	"ajaxcon.php";
else
	posturl			=	"../ajaxcon.php";
			

$.post(posturl, {ajaxaction:ajaxaction}, function(data){
	
$("div#dialog_div_content div#dialog_div_dialogMessage").html(data);



});



}


$(document).ready(function() {	

	//select all the a tag with name equal to modal
	$('a[name=modal]').click(function(e) {
		//Cancel the link behavior
		e.preventDefault();
		
		//Get the A tag
		var id = $(this).attr('href');
	
		//Get the screen height and width
		var maskHeight = $(document).height();
		var maskWidth = $(window).width();
	
		//Set heigth and width to mask to fill up the whole screen
		$('#dialog_div_mask').css({'width':maskWidth,'height':maskHeight});
		
		//transition effect		
		$('#dialog_div_mask').fadeIn(1000);	
		$('#dialog_div_mask').fadeTo("slow",0.8);	
	
		//Get the window height and width
		var winH = $(window).height();
		var winW = $(window).width();
              
		//Set the popup window to center
		$(id).css('top',  winH/2-$(id).height()/2);
		$(id).css('left', winW/2-$(id).width()/2);
	
		//transition effect
		$(id).fadeIn(2000); 
	
	});
	
	//if close button is clicked
	$('.dialog_class_window .dialog_class_close').click(function (e) {
		//Cancel the link behavior
		e.preventDefault();
		
		$('#dialog_div_mask').fadeOut(2000);
		//$('.dialog_class_window').hide();
		$('.dialog_class_window').fadeOut(1000);
	});		
	
	//if mask is clicked
	$('#dialog_div_mask').click(function () {
		//$(this).hide();
		//$('.dialog_class_window').hide();
		$(this).fadeOut(2000);
		//$('.dialog_class_window').hide();
		$('.dialog_class_window').fadeOut(1000);
	});			
	
});
//setdiv height
function setDiveHeight(div1, div2)
{
	var newHegit = 100;
	var h1 = $('#'+div1).height();
	var h2 = $('#'+div2).height();	
	if(div2=='middle_part2H')
	h2 +=58;
	if(h1>h2)
	{
	newHegit = h1;
	}
	else
	{
	newHegit = h2;
	}

	$('#'+div1).height(newHegit);
	//$('#'+div2).height(newHegit);
	//alert (newHegit)
}

function maskInput() {
	
        if (event.keyCode == 46 || event.keyCode == 8  || event.keyCode == 9) {
                // let it happen, don't do anything
            }
            else {
                // Ensure that it is a number and stop the keypress
                if ((event.keyCode >= 48 && event.keyCode <= 57) || (event.keyCode >= 96 && event.keyCode <= 105) || (event.keyCode ==37 || event.keyCode==39)) {

                }
                else {
					event.preventDefault();                  
                }
            }
    }
	
	function checkPostCode()
	{
		var postCode = $("#postCode").val();		
		if($("#cat_id").val() == "")
			posturl			=	"check_email.php";
		else
			posturl			=	"../check_email.php";
		
		$.post(posturl, {action: 'checkPostCode', postCode:postCode}, function(data) {
		$("#cityStateDiv").html(data);
		if(data=="Invalid postCode")
		{
			$("#regpagesubmit").attr("disabled",true).css('opacity', 0.5);			
		}
		else
		{
			$("#regpagesubmit").attr("disabled",false).css('opacity', 1);			
		}
		});
	}
	
$(document).ready(function() 
{

	if($('#mobilePhone').val()=="")
	$('#mobilePhone').val('07');
	if($('#homePhone').val()=="")
	$('#homePhone').val('0');
	$('#mobilePhone').keydown(maskInput);
	$('#homePhone').keydown(maskInput);
	$("#mobilePhone").maxLength(11);
	$("#homePhone").maxLength(11);
	$("#postCode").maxLength(8);
	$('#postCode').blur(checkPostCode);
	$('#address1').keyup(checkAddress1);
	
});
	
	
	
jQuery.fn.maxLength = function(max){
	this.each(function(){
		//Get the type of the matched element
		var type = this.tagName.toLowerCase();
		//If the type property exists, save it in lower case
		var inputType = this.type? this.type.toLowerCase() : null;
		//Check if is a input type=text OR type=password
		if(type == "input" && inputType == "text" || inputType == "password"){
			//Apply the standard maxLength
			this.maxLength = max;
		}
		//Check if the element is a textarea
		else if(type == "textarea"){
			//Add the key press event
			this.onkeypress = function(e){
				//Get the event object (for IE)
				var ob = e || event;
				//Get the code of key pressed
				var keyCode = ob.keyCode;
				//Check if it has a selected text
				var hasSelection = document.selection? document.selection.createRange().text.length > 0 : this.selectionStart != this.selectionEnd;
				//return false if can't write more
				return !(this.value.length >= max && (keyCode > 50 || keyCode == 32 || keyCode == 0 || keyCode == 13) && !ob.ctrlKey && !ob.altKey && !hasSelection);
			};
			//Add the key up event
			this.onkeyup = function(){
				//If the keypress fail and allow write more text that required, this event will remove it 
				if(this.value.length > max){
					this.value = this.value.substring(0,max);
				}
			};
		}
	});
};



function runLeads(rootDir)
	{
		var ajaxaction	=	'runLeads';
		var url = rootDir + "ajaxcon.php";
			
			$.post(url, {ajaxaction:ajaxaction}, function(data){
				
			});
			
	}
	
	//new funtion added by naveen
	function checkAddress1()
	{
		var add1 = $("#address1").val();
		var firstchar = add1.split(/\s+/).pop().charAt(0);
		if(isNaN(firstchar))
		{
			//alert ("char")
			$("#address1").maxLength(100);
			//$.("#address1").attr('maxLength',5)
		}
		else
		{
			$("#address1").maxLength(5);
			//alert ("number")
			
		}
		
		//alert (firstchar)
	}
	//end
