// FUNCTION USED FOR VALIDATING ALL KINDS OF FORM UPDATED ON AUG 10TH BY SHERMILIN
function Validate(frm)
{
	for (i=0; i < document[frm].elements.length; i++)
	{
		
		//DEFINING FORM OBJECT WITH ITS CORRESPONDING ELEMENTS
		var item = document[frm].elements[i];
		var flag=0;
		var itemspec=item.id;
		var alertMsg=item.id.substring((item.id.lastIndexOf("_") + 1),item.id.length);
		var type=item.type;
										
			if(item.id.indexOf("req_")>=0)
			{
				
				switch (item.type)
				{
					case 'checkbox':
						if (item.type=="Prop_Addroom")
						{
							var chkbox=chkboxValidation();
							alert(chkbox);
							if(chkbox==false)
							{
								flag=1;
								return false;
							}
						}
						if (item.name=="TERMS")
						{
							if(document.forms[0].TERMS.checked==false)
							{
								alert("Please Agree with the Terms & Conditions");
								flag=1;
								return false;
							}
						}
						break;

					case 'radio':
						if (item.name=="Category")
						{
							var bol_radiobutton=RegistrationRadioValidation();
							if(bol_radiobutton==false)
							{
								flag=1;
								return false;
							}
						}
						if(item.name=="req_price")
						{
							if(document.forms[0].req_price[1].checked==true)
							{
								if(document.forms[0].Crores.value == "" && document.forms[0].lakhs.value == "")
								{
									alert("Please Select Price Value");
									flag=1;
									return false;
								}
							}
						}
						
						if(item.name=="Prop_price")
						{
							if(document.forms[0].Prop_price[1].checked==true)
							{
								if(document.forms[0].Crores.value == "" && document.forms[0].Lakhs.value == "" && document.forms[0].Thousands.value == "")
								{
									alert("Please Select Price Value");
									flag=1;
									return false;
								}
							}
						}
						break;
		
					
					case 'file':
					{
						if(item.name=="productImage")
						{
							if (item.value =="")
							{
								alert("Please Upload Product Photo");
								return false;
							}
							if (item.value !="")
							{
								var textname = item.name;
								var imagename = eval(document[frm].elements[textname].value.length);
								if (imagename > 0 )
								{
									var CheckImage = CheckValidImage(frm,textname);
									if(CheckImage==1)
									{
										flag=1;
										return false;
										break;
									}
								
								}
							}
						}
						if (item.value !="")
							{
								var textname = item.name;
								var imagename = eval(document[frm].elements[textname].value.length);
								if (imagename > 0 )
								{
									var CheckImage = CheckValidImage(frm,textname);
									if(CheckImage==1)
									{
										flag=1;
										return false;
										break;
									}
									else
									{
										flag=0;
										return true;
										break;
									}
								
								}
							}
						
						
					}
					break;
					
					//PASSWORD CONFIRMATION 
					case 'password':
						if(item.value=="")
						{
							var element = document.getElementById(itemspec);
							alert(innerHTML = "Please Enter "+alertMsg);
							item.focus();
							flag=1;
							return false;
						}
						if(!(item.value)=="")
						{
							if(item.name=="Password")
							{
								var checkField=check_mincharpassword(frm);
								if(checkField==false)
								return false;
							}
						}
						if(item.name=="Password")
						{ 
							if(!(item.value)=="")
							{
								var CheckDuplicate=CheckDuplicateUsernamePassword(frm);
								if(CheckDuplicate==false)
								{
									flag=1;
									return false;
								}
							}
						}
						if(item.name=="Confirm_pass")
						{ 
							if(!(item.value)=="")
							{ 
								var email=validepassword(frm);
								if(email==false)
								{
									flag=1;
									return false;
								}
							}
						}
						break;
					case 'text':
					//CHECKING FOR TEXTBOX VALUES
						var tch = /^[ ]*$/;
						if ((item.value=="") && (item.disabled == false) || ((tch.test(item.value))))
						{
							var element = document.getElementById(itemspec);
							alert(innerHTML = "Please Enter "+alertMsg);
							item.focus();
							flag=1;				
							return false;
						}
						else
						{
							if(item.id=="txt")
							{
								if(isNaN(item.value)==true)
								{
									item.focus();
									flag=1;
									return false;
								}
							}
				        }

						
						//EMAIL VALIDATION
						if(!(item.value)=="")
						{
							if((item.name=="EmailAddress" )||( item.name=="Prop_Cont_EmailID") ||( item.name=="Email")||( item.name=="to_email")||( item.name=="from_email") || ( item.name=="txtFrom")||( item.name=="email"))
							{
								var FieldName=item.name;  
								var checkField=validate_email(frm,FieldName);
								if(checkField==false)
								{
									flag=1;
									return false;
								}
							}
						}
						
						//USERNAME VALIDATION
						if(!(item.value)=="")
						{
							if(item.name=="Username")
							{
								var checkField=check_mincharusername(frm);
								if(checkField==false)
								{
								flag=1;
									return false;
								}
							}
						}
						
						
						if(!(item.value)=="")
						{
							if(item.name=="Number")
							{
								var FieldName=item.name;
								var checkField=tel_length(frm,FieldName);
								if(checkField==false)
								{
									flag=1;
									return false;
								}
							}
						}
						
						if(!(item.value)=="")
						{
							if(item.name=="Mobile")
							{
								var FieldName=item.name;
								var checkField=cell_length(frm,FieldName);
								if(checkField==false)
								{
									flag=1;
									return false;
								}
							}
						}
	// Text Filed in Zero Function	Start				
						if(item.name=="Phone" || item.name=="LandLine" || item.name=="AreaCode" || item.name=="Prop_BuiltupArea" || item.name=="Prop_PlotArea" || item.name=="Prop_Zip" || item.name=="Prop_Rent" || item.name=="price" || item.name=="req_A_range" || item.name=="City_Code" || item.name=="Number" || item.name=="dir_AreaCode" || item.name=="dir_LandLine" || item.name=="dir_Zip" || item.name=="phone" || item.name=="Prop_Frontwidth")
						{ 
							if(!(item.value)=="")
							{ 
								var FieldName=item.name;
								var checkField=CheckPhoneSizeValue(frm,FieldName);
								if(checkField==false)
								{
									flag=1;
									return false;
								}
							}
						}
	// Text Filed in Zero Function	End		
				
					if(item.name=="Url")	
						{
						
							
							if(!(item.value)=="")
							{
								
								var Fieldname=item.name;
								var checkField=check_URL(frm,Fieldname);
								if(checkField==false)
								{
									flag=1;
									return false;
									break;
								}
								
							}
						}
						break;
					case 'select-one':
						
						if (!checkSelect(item))
						{ 
							var element = document.getElementById(itemspec);
							if(item.value == "")
							{
								alert(innerHTML = "Please Select "+alertMsg);
								item.focus();
								flag=1;
								return false;
							}
						}
						if(!(item.value)=="")
						{

							if(item.name=="Country")
							{
							
								var CountryName=item.value;
								var checkField=CheckStateValidation(frm,CountryName);

								if(checkField==false)
								{
									flag=1;
									return false;
								}
								else
								{
									flag=0;
								}
							}

						}
						if(!(item.value)=="")
						{

							if(item.name=="State")
							{
								var StateName=item.value;
								var checkField=CheckStateValidation(frm,StateName);

								if(checkField==false)
								{
									flag=1;
									return false;
								}
								else
								{
									flag=0;
								}
							}

						}
						break;
					case 'textarea':
						var tch = /^[ ]*$/;
						if(item.value==""  || ((tch.test(item.value))))
						{	
							var element = document.getElementById(itemspec);
							alert(innerHTML = "Please Enter "+alertMsg);
							item.focus();
							flag=1;	
									return false;							
						}
					break;
					//case 'UserType':
				}//end of switch
		 	}//INSIDE ELSE IF(OPTIONAL)
		//end of main else
	
		if (flag==1)
		{	
			return false;
			break;
		}	
	}
//document[frm].submit();
}



//FUNCTIONS FOR EMAIL VALIDATION
function validate_email(frm,name)
{
	if (emailvalidation(document[frm].elements[name].value)==false)
	{
		document[frm].elements[name].focus(); 
		alert('Invalid E-Mail Address');
		return false;
	}
}

function emailvalidation(i)
{
	var regexp = /^[a-zA-Z0-9_@.-]*$/;
	var val = i;
	var at="@";
	var dot=".";
	var pat=val.indexOf(at);
	var lval=val.length;
	var pdot=val.indexOf(dot);
	var secondat = val.indexOf(at,pat+1);
	var lastat = val.lastIndexOf(at);
	var afterat = val.substring(pat+1,pat+2);
	var afterdot = val.substring(pdot+1,pdot+2);
	var lastchar = val.substring(lval-1,lval);
	var dotafterat = val.indexOf(dot,pat+1);
	var pseconddot = val.indexOf(dot,pdot+1);
	var pthirddot = val.indexOf(dot,pseconddot+1);
	var afterseconddot = val.substring(pseconddot+1,pseconddot+2);
	var afterthirddot = val.substring(pthirddot+1,pthirddot+2);

	if (regexp.test(val) == false ||pat == -1 || pat == 0 || pat == lval-1 || pdot == -1 || pdot == 0 || pdot == lval-1 || secondat != -1 || lastat != pat || afterat == dot || afterat == "-" || afterat == "_" || afterdot == at || afterdot == "-" || afterdot == "_" || afterdot == dot || lastchar == dot || dotafterat == -1 || afterseconddot == at || afterseconddot == "-" || afterseconddot == "_" || afterseconddot == dot || afterthirddot == at || afterthirddot == "-"
	|| afterthirddot == "_" || afterthirddot == dot)
	{
		return false;
	}
	else
	{
		return true;
	}
}

//FUNCTION FOR CHECKING SELECT BOX VALUES
function checkSelect(item) 
{
	bLocValid = true;
	if(item.selectedIndex==0)
	{
		bLocValid=false;
	}
	if (item.selectedIndex < 0) 
	{ 
		bLocValid = false;
	}
	if (item.selectedIndex == 0) 
	{
		if (item.options[0].value == '') 
		{ 
			bLocValid = false;
		}
	}
	return bLocValid;
}

//FUNCTION FOR CHECKING NUMMERIC VALUES
function numOnly()
{
	if(window.event.keyCode != 13 && window.event.keyCode<45 || window.event.keyCode>57 || window.event.keyCode == "47" || window.event.keyCode == "46")
	{
		window.event.keyCode=null;
		alert("Please Enter Numeric Values Only");
	}
}

function numdecimalOnly()
{
	if(window.event.keyCode != 13 && window.event.keyCode<45 || window.event.keyCode>57 || window.event.keyCode == "47")
	{
		window.event.keyCode=null;
		alert("Please Enter Numeric Values Only");
	}
}
function numOnlynew(frm,FieldName)
{
	var alpha;
	alpha=FieldName.value;
	for(var j=0; j<alpha.length; j++)
	{
		var alphaa = alpha.charAt(j);
		var hh = alphaa.charCodeAt(0);
		if(hh != 13 && hh < 45 || hh > 57 || hh == "46")
		{
			hh=null;
			alert("Please Enter Numeric Values Only");
			FieldName.value="";
			FieldName.focus();
			return false;
		}		
	}
}
function numOnlyacccomma(frm,FieldName)
{
	var alpha;
	alpha=FieldName.value;
	for(var j=0; j<alpha.length; j++)
	{
		var alphaa = alpha.charAt(j);
		var hh = alphaa.charCodeAt(0);
		if(hh != 13 && hh < 43 || hh > 57 || hh == "46")
		{
			hh=null;
			alert("Please Enter Numeric Values Only");
			FieldName.value="";
			FieldName.focus();
			return false;
		}		
	}
}

//FUNCTION FOR CHECKING USERNAME LENGTH
function check_mincharusername(frm)
{
	var user=document[frm].elements["Username"].value;
	var sub1=user.substr(0,1);
	var len = document[frm].elements["Username"].value.length;
	if ( len < 6 )
	{
		alert ( "Username Field should not be less than 6 Characters" );
		document[frm].elements["Username"].focus();
		return false;
	}
	else if ( len > 12)
	{
		alert ( "Username Field should not be more than 12 Characters" );
		document[frm].elements["Username"].focus();
		return false;
	}
	else if ((sub1 >= 0) && (sub1 <=9))
	{
		alert("Username Field should start with alpha Character");
		document[frm].elements["Username"].value="";
		document[frm].elements["Username"].focus();
		return false;
	}
}

//FUNCTION FOR CHECKING PASSWORD LENGTH
function check_mincharpassword(frm)
{
	var passlen = document[frm].elements["Password"].value.length;
	if ( passlen < 6  )
	{
		alert ( "Password Field should not be less than 6 Characters");
		document[frm].elements["Password"].focus();
		return false;
	}
	else if ( passlen > 12)
	{
		alert ( "Password Field should not be or more than 12 Characters");
		document[frm].elements["Password"].focus();
		return false;
	}
}

//FUNCTION FOR CHECKING PASSWORD AND CONFIRM PASSWORD
function validepassword(frm)
{
	var Password=document[frm].elements["Password"].value;
	var ConfirmPass=document[frm].elements["Confirm_pass"].value;

	if (Password!=ConfirmPass)
	{
		alert('Please Confirm Your Password Correctly');
		document[frm].elements["Confirm_pass"].focus();
		
		return false;
	}
	else
	{
		return true;
	}
}

//FUNCTION FOR CHECKING FORGOT PASSWORD VALIDATION
function forgetpwd(frm)
{

	if (document[frm].Email.value == "" && document[frm].ForgotUsername.value == "")
	{
		alert("Please enter Username or Email address.");
		document[frm].ForgotUsername.focus(); 
		return false;
	}
	else if (document[frm].Email.value != "" && document[frm].ForgotUsername.value != "")
	{
		alert("Please enter only one field. Either enter Username or email address.");
		document[frm].ForgotUsername.focus(); 
		return false;
	}
	else if (document[frm].Email.value != "" && document[frm].ForgotUsername.value == "")
	{
		if (emailvalidation(document[frm].Email.value)==false)
		{
			document[frm].Email.focus(); 
			alert('Invalid E-Mail Address');
			return false;
		}
	}
}


//FUNCTION FOR CHECKING DUPLICATION OF USERNAME AND PASSWORD
function CheckDuplicateUsernamePassword(frm) // Duplicate Username,Password
{
	var TxtUsername=document[frm].elements["Username"].value;
	var TxtPassword=document[frm].elements["Password"].value;
	if (TxtUsername==TxtPassword)
	{
		alert("Password Should not be Same as Username");
		document[frm].elements["Password"].value="";
		document[frm].elements["Confirm_pass"].value="";
		document[frm].elements["Password"].focus();
		return false;
	}
	else
	{
		return true;
	}
}

//FUNCTION FOR STATE AND CITY VALIDATION
function CheckStateValidation(frm,Countryvalue)
{
	var tch = /^[ ]*$/;
	if (document[frm].State.length > 1)
	{
		if (document[frm].State.value=="")
		{
			alert("Please Select State");
			document[frm].State.focus();
			return false;
		}		
	}

	//*********************************************************************************** City Validation

	if (document[frm].State.value !="")
	{
			if(document[frm].City.type == "text" && document[frm].City.value=="" || ((tch.test(document[frm].City.value))))
			{
				alert("Please Enter City")
				document[frm].City.focus();
				return false;
			}
			else if(document[frm].City.type == "select-one" && document[frm].City.value=="")
			{
				alert("Please Select City");
				document[frm].City.focus();
				return false;

			}
			else
			{
				return true;
			}
			/*
			if (document[frm].City.length==1)
			{
				if (document[frm].City.value=="" && document[frm].HiddenCity.value=="")
				{
					alert("Please Enter City")
					document[frm].City.focus();
					return false;
				}
			}
			else if (document[frm].City.length > 1)
			{
				if (document[frm].City.value=="" && document[frm].HiddenCity.value=="")
				{
					alert("Please Select City");
					document[frm].City.focus();
					return false;
				}
			}
		
		if (document[frm].City.length == 1)
		{
			
			if (document[frm].City.value=="")
			{
				alert("Please Select City");
				document[frm].City.focus();
				return false;
			}
		}
		*/
	}
	
}



//URL CHECKING FUNCTION
function check_URL(frm,name)
{
	
	var mailValid = /^(([w]{3})+\.+([a-zA-Z0-9\-]+\.)+([a-zA-Z0-9]*)+([\.com\.net\.org\.gov\.edu\.info\.co.uk]))+$/;
	if (!document[frm].elements[name].value.match(mailValid))
	{
		alert("Invalid URL");
		document[frm].elements[name].focus();
		return false;
	}
}



//FUNCTION FOR CHECKING WHETHER THE IMAGES UPLOADED ARE VALID OR NOT
function CheckValidImage(frm,name)
{
	var image=document[frm].elements[name].value;
	var imagelength=document[frm].elements[name].value.length;
	var imageindex=image.lastIndexOf(".") + 1;
	var last=image.substring(imageindex,imagelength);
	if(document[frm].elements[name].value != "")
	{
		if(last != "jpg" && last != "gif" && last != "jpeg" && last != "png" && last != "JPG" && last != "GIF" && last != "JPEG" && last != "PNG")
		{
			alert("Please Upload valid jpg or gif or png file");
			return flag=1;
		}
		else
		{
			return flag=0;
		}
	}
}

//TEXT AREA VALIDATION FUNCTION FOR LIMITED CHARACTER*******************************

function validatetextarea1(frm,FieldName) 
{

		var arealength = document[frm].elements[FieldName].value.length + 1;
		document[frm].ctText.value=arealength;
		if (arealength > 500)
		{
			  alert('Your property description must be 500 characters or less');
	          document[frm].elements[FieldName].focus();
		}
}

function validatetextarea2(frm,FieldName) 
{

		var arealength = document[frm].elements[FieldName].value.length + 1;
		document[frm].ctText.value=arealength;
		if (arealength > 100)
		{
			  alert('Your property description must be 100 characters or less');
	          document[frm].elements[FieldName].focus();
		}
}

//FUNCTION CHECK FOR NUMERIC VALUES**************************************************
	
	function IsNumeric(frm,e,FieldName)
	{
		
		if(navigator.userAgent.indexOf("Netscape") > 0)
		{
			var KeyID=e.keyCode;
			if(KeyID < 45 || KeyID > 57 || KeyID == "47" || KeyID == "46" || KeyID == "32" )
			{
				var string=document[frm].elements[FieldName].value.length;
				alert("Please Enter Numeric Values Only");
				document[frm].elements[FieldName].focus();
			}
		}
		else
		{
			if(window.event.keyCode<45 || window.event.keyCode>57 || window.event.keyCode == "47" || window.event.keyCode == "46")
			{
				window.event.keyCode=null;
				var string=document[frm].elements[FieldName].value;
				document[frm].elements[FieldName].focus();
			}
		}
	}


//CHECKING FOR THE PHONE NUMBER LENGTH***********************************
function tel_length(frm,FieldName)
{
	var ph,len;
	ph=document[frm].elements[FieldName].value;
	len=ph.length;
	if(len<5)
	{
		alert("Phone No Should have minimum 5 digits");
		document[frm].elements[FieldName].focus();
		return false;
	}

return true;
}

//CHECKING FOR THE CELLPHONE NUMBER LENGTH*********************************
function cell_length(frm,FieldName)
{
	var ph,len;
	ph=document[frm].elements[FieldName].value;
	len=ph.length;
	if(len<10)
	{
		alert("Mobile Number Should have minimum 10 digits");
		document[frm].elements[FieldName].focus();
		return false;
	}
	
return true;
}


//RADIO BUTTONS VALIDATION FUNCTION IN REGISTRATION FORM
function RegistrationRadioValidation()
{
	var frmname=document.regForm;
	var CheckUserType="";
	for(i=0;i<3;i++)
	{
		if(frmname.Category[i].checked == true)
		{
			CheckUserType = frmname.Category[i].value;
		}
	} 
	if (CheckUserType=="")
	{
		alert("Please Select User Type");
		//frmname.Category[i].focus();
		return false;
	}
	//COMPANY NAME VALIDATION
		if (frmname.Category[1].checked==true)
			{
				if(frmname.Username.value=='')
				{
					alert("Please Enter Username");
					frmname.Username.focus();
					return false;
				}
					
			}
		if (frmname.Category[2].checked==true)
			{
				if(frmname.Username.value=='')
				{
					alert("Please Enter Username");
					frmname.Username.focus();
					return false;
				}
			}
	
}

//CHECKING FOR VALIDATION OF CHECK BOX
function chkboxValidation()
{
	
	var total="";
	var frmname=document.forms[0];
	for(var i=0; i < frmname.Prop_Addroom.length; i++)
	{
		if(frmname.Prop_Addroom[i].checked)
		total +=frmname.Prop_Addroom[i].value + "\n"
	}
		if(total=="")
		{
			alert("Please Select Additional Rooms") 
			return false; 
		}
}

function chkboxValidationn()
{
	var total="";
	var frmname=document.forms[0];
	for(var i=0; i < frmname.usertype.length; i++)
	{
		if(frmname.usertype[i].checked)
		total +=frmname.usertype[i].value + "\n"
	}
		if(total=="")
		{
			alert("Please Select Usertype") 
			return false; 
		}
}

//CHECKING FOR SPECIAL CHARACTERS IN USERNAME
function check_SpChar(frm)
{
	var username=document[frm].Username.value;
	if ((username.match('@')) || (username.match('#')) || (username.match('!')) || (username.match('%')) || (username.match('&')) )
	{
		alert("Special Characters not allowed ! ");
		return false;
	}
}

function validurl()
{
	if(document.forms[0].Url.value != "")
	{
		document.forms[0].Url.id="req_txt_Url";
	}
	else
	{
		document.forms[0].Url.id="";
	}
	
}


function show()
{   
    document.all.id1.style.display = '';
	document.all.id2.style.display = '';
	document.all.id5.style.display = '';
	document.all.id4.style.display = '';
	
}
function hide()
{
	document.all.id.style.display = 'none';
	document.all.id2.style.display = 'none';
	document.all.id5.style.display = 'none';
	document.all.id4.style.display = 'none';
		
}
function showmember()
{   
    document.all.idm1.style.display = '';
	document.all.idm2.style.display = '';
	document.all.idm3.style.display = '';
	document.all.idm4.style.display = '';
	document.all.ida1.style.display = 'none';
	document.all.ida2.style.display = 'none';
	document.all.ida3.style.display = 'none';
	document.all.ida4.style.display = 'none';
	document.all.idb1.style.display = 'none';
	document.all.idb2.style.display = 'none';
	document.all.idb3.style.display = 'none';
	document.all.idb4.style.display = 'none';	
	document.regForm.strnri.disabled=false;
	document.regForm.Name1.id='req_txt_Name';
	document.regForm.AgencyName.id="Agency Name";	
	document.regForm.agentname.id="Contact Name";
	document.regForm.strcompanyname.id="Builder's Name";	
	document.regForm.buildername.id="Contact Name";	
	document.regForm.Country.value='1';
	document.all.igg3.style.display = 'none';	
	document.all.igg4.style.display = '';	
}

function showagent()
{
	document.all.idm1.style.display = 'none';
	document.all.idm2.style.display = 'none';
	document.all.idm3.style.display = 'none';
	document.all.idm4.style.display = 'none';
	document.all.ida1.style.display = '';
	document.all.ida2.style.display = '';
	document.all.ida3.style.display = '';
	document.all.ida4.style.display = '';
	document.all.idb1.style.display = 'none';
	document.all.idb2.style.display = 'none';
	document.all.idb3.style.display = 'none';
	document.all.idb4.style.display = 'none';
	document.regForm.strnri.checked=false;
	document.regForm.strnri.disabled=true;	
	document.regForm.Name1.id='Name';
	document.regForm.AgencyName.id='req_txt_Agency Name';	
	document.regForm.agentname.id='req_txt_Contact Name';
	document.regForm.strcompanyname.id="Builder's Name";	
	document.regForm.buildername.id="Contact Name";	
	document.regForm.Country.value="1";
	document.all.igg3.style.display = '';	
	document.all.igg4.style.display = 'none';	
	showDialect(1);
}
function showbuilder()
{
	document.all.idm1.style.display = 'none';
	document.all.idm2.style.display = 'none';
	document.all.idm3.style.display = 'none';
	document.all.idm4.style.display = 'none';
	document.all.ida1.style.display = 'none';
	document.all.ida2.style.display = 'none';
	document.all.ida3.style.display = 'none';
	document.all.ida4.style.display = 'none';
	document.all.idb1.style.display = '';
	document.all.idb2.style.display = '';
	document.all.idb3.style.display = '';
	document.all.idb4.style.display = '';
	document.regForm.strnri.checked=false;
	document.regForm.strnri.disabled=true;
	document.regForm.Name1.id='Name';
	document.regForm.AgencyName.id="Agency Name";	
	document.regForm.agentname.id="Contact Name";
	document.regForm.strcompanyname.id='req_txt_Builders Name';	
	document.regForm.buildername.id='req_txt_Contact Name';	
	document.regForm.Country.value="1";	
	showDialect(1);
	document.all.igg3.style.display = '';
	document.all.igg4.style.display = 'none';	
}
function hidepropfloor(frm)
{
	var val=document[frm].Prop_Totalfloor.value;
	if(val=='0000')
	{
		document.all.pid1.style.display = 'none';
		document.all.pid2.style.display = 'none';
		document[frm].Prop_onfloor.id="Prop_onfloor";
		document[frm].Prop_onfloor.value="0000";

	}
	else
	{
		document.all.pid1.style.display = '';
		document.all.pid2.style.display = '';
	}
	
}

//*******************************************************/
function showref()
{   
	document.all.scamp.style.display = 'none';
	document.all.sref.style.display = '';	 
}

function showcamp()
{   
     document.all.sref.style.display = 'none';
	 document.all.scamp.style.display = '';	 
}


//************************************************************/

function dropChange(val)
{
	if(document.forms[0].delreason.value == 'Others')
	{
		document.all.id1.style.display = '';
	}
	else
	{
		document.all.id1.style.display = 'none';
	}
}

function goTo()
{
	window.location = 'myrequirement.php';
}


function disableprice(val)
{
	if(val == 1)
	{
		if(Pur == 'Sale')
		{
			document.forms[0].Crores.disabled = true;
			document.forms[0].Lakhs.disabled = true;
			document.forms[0].Thousands.disabled = true;
			document.forms[0].Prop_Rent.id="Rent";
		}
		else
		{
			document.forms[0].Prop_Rent.disabled = true;
			document.forms[0].Prop_Rent.id="Rent";
		}
	}
	else
	{
		if(Pur == 'Sale')
		{
			document.forms[0].Crores.disabled = false;
			document.forms[0].Lakhs.disabled = false;
			document.forms[0].Thousands.disabled = false;
			document.forms[0].Prop_Rent.id="Rent";
			
		}
		else
		{
			document.forms[0].Prop_Rent.disabled = false;
			document.forms[0].Prop_Rent.id="req_txt_Rent";
		}
	}
}

function disable1(val)
{
	if(val == 1)
	{
		document.forms[0].Prop_avail_month.disabled = true;
		document.forms[0].Prop_avil_year.disabled = true;
	}
	else
	{
		document.forms[0].Prop_avail_month.disabled = false;
		document.forms[0].Prop_avil_year.disabled = false;
		document.forms[0].Prop_avail_month.id="req_select-one_Month";
		document.forms[0].Prop_avil_year.id="req_select-one_Year";
	}
}

function disable(val)
{
	if(val == 1)
	{
		document.forms[0].Crores.disabled = true;
		document.forms[0].lakhs.disabled = true;
	}
	else
	{
		document.forms[0].Crores.disabled = false;
		document.forms[0].lakhs.disabled = false;
		/*if(document.forms[0].Crores.value == "" && document.forms[0].lakhs.value == "")
		{
			alert("Please Select Price Value");
		}*/
	}
}

function chkuser(frm)
{
	var checkField=check_username(frm);
	var username = document[frm].elements["Username"].value;
	if(checkField==false)
	{
		flag=1;
		return false;
	}
	else
	{
		window.open('forms/chkUser.php?flag=1&uname='+ username,'','width=350,height=190,scrollbars=yes,status=no,toolbar=no,resizable=yes');
	}
}
//**********************************************************************

//**********************************************************************

function check_username(frm)
{
	var user=document[frm].elements["Username"].value;
	var sub1=user.substr(0,1);
	var len = document[frm].elements["Username"].value.length;
	
	if ( user == "" )
	{
		alert ( "Username field is blank" );
		document[frm].elements["Username"].focus();
		return false;
	}
	else 
	{
		var checkField=check_mincharusername(frm);
		if(checkField==false)
		{
			flag=1;
			return false;
		}

	}
}

function validatetextarea(frm,field,cntfield,maxlimit) 
{	
	if (field.value.length > maxlimit)
	{// if too long...trim it!
		field.value = field.value.substring(0, maxlimit);
	}
	// otherwise, update 'characters left' counter
	else if(cntfield!=null)
	{
		cntfield.value = maxlimit - field.value.length;
	}
	
}

function selectAll(list)
{

	if(document.form1.hidSelect.value==0)
	{
		for (var i=0;i<list.length;i++)
		{
			document.getElementById(list[i]).checked = true
		}
		document.form1.hidSelect.value=1;
	}
	else
	{
		for (var i=0;i<list.length;i++)
		{
			document.getElementById(list[i]).checked = false
		}
		document.form1.hidSelect.value=0;
	}
}

function checkSelection()
{
	var chk=false;
	for (var i=0;i<(document.form1.elements.length);i++)
	{
		if (document.form1.elements[i].checked == true)
		{
			chk=true;
			document.form1.submit();
			break;
		}
	}
	if (chk==false)
	{
		alert ("Please Select atleast one Property!");
		return false;
	}

}
function checkDelete()
{
	var chk=false;
	for (var i=0;i<(document.form1.elements.length);i++)
	{
		if (document.form1.elements[i].checked == true)
		{
			chk=true;
			if(confirm("Are you sure to delete marked messages"))
			{
			 document.form1.submit();
			}
			break;
		}
	}
	if (chk==false)
	{
		alert ("Please select messages!");
		return false;
	}

}

function showbutton()
{
	document.all.id3.style.display = '';
	
}

function CharacterOnly(frm,FieldName)
{
	var numeric;
	numeric=FieldName.value;
	for(var j=0; j<numeric.length; j++)
	{
		var alphaa = numeric.charAt(j);
		var hh = alphaa.charCodeAt(0);
		//alert(alphaa);
		//alert(hh);

		if((hh > 64 && hh < 91) || (hh > 96 && hh < 123) || hh==32 || hh==38 || hh==46 || hh==44 || hh==40 || hh==41 || hh==91 || hh==93)
		{
		}
		else
		{
			alert("Please Enter Alphabets Only");
			FieldName.value="";
			FieldName.focus();
			return false;
		}
	}
	
	return true;
}
function CharacterOnlywithdot(frm,FieldName)
{
	var numeric;
	numeric=FieldName.value;
	for(var j=0; j<numeric.length; j++)
	{
		var alphaa = numeric.charAt(j);
		var hh = alphaa.charCodeAt(0);
		//alert(alphaa);
		//alert(hh);

		if((hh > 64 && hh < 91) || (hh > 96 && hh < 123) || hh==32 || hh==46 || hh==38 || hh==46 || hh==44 || hh==40 || hh==41 || hh==91 || hh==93)
		{
		}
		else
		{
			alert("Please Enter Alphabets & dot Only");
			FieldName.value="";
			FieldName.focus();
			return false;
		}
	}
	
	return true;
}

function keycode()
{
	if(window.event.keyCode == "13")
	{
		searchbyarealoc();
	}
}

function searchbyarealoc()
{
	document.AreaLocaton.submit();
	
}

//PRICE RANGE FUNCTION FOR RENT	
function memberchangepricerangerent()
{

	document.forms[0].Range.options.length = 0;
	var option0= new Option("Select a Price Range","");
	var option1= new Option("Below 2,000","1-2000");
	var option2= new Option("2,000 to 4,000","2000-4000");
	var option3= new Option("4,000 to 6,000","4000-6000");
	var option4= new Option("6,000 to 8,000","6000-8000");
	var option5= new Option("8,000 to 10,000","8000-10000");
	var option6= new Option("10,000 to 15,000","10000-15000");
	var option7= new Option("15,000 to 20,000","15000-20000");
	var option8= new Option("20,000 to 25,000","20000-25000");
	var option9= new Option("Above 25,000","25000");
	//var option10= new Option("Contact User","0-0");
	for(var i=0;i<10;i++)
	{
		eval("document.forms[0].Range.options[i]=option" + i);
	}
}
//PRICE RANGE FUNCTION FOR RENT	FOR ADVANCED SEARCH
function memberchangepricerangerentadv()
{

	document.Adv_ser.Range.options.length = 0;
	var option0= new Option("Select a Price Range","");
	var option1= new Option("Below 2,000","1-2000");
	var option2= new Option("2,000 to 4,000","2000-4000");
	var option3= new Option("4,000 to 6,000","4000-6000");
	var option4= new Option("6,000 to 8,000","6000-8000");
	var option5= new Option("8,000 to 10,000","8000-10000");
	var option6= new Option("10,000 to 15,000","10000-15000");
	var option7= new Option("15,000 to 20,000","15000-20000");
	var option8= new Option("20,000 to 25,000","20000-25000");
	var option9= new Option("Above 25,000","25000");
	//var option10= new Option("Contact User","0-0");
	for(var i=0;i<10;i++)
	{
		eval("document.Adv_ser.Range.options[i]=option" + i);
	}
}

//PRICE RANGE FUNCTION FOR BUY	
function memberchangepricerangebuy()
{
	document.forms[0].Range.options.length = 0;
	var option0= new Option("Select a Price Range","");
	var option1= new Option("Below 5 lacs","1-500000");
	var option2= new Option("5 to 10 lacs","500000-1000000");
	var option3= new Option("10 to 15 lacs","1000000-1500000");
	var option4= new Option("15 to 25 lacs","1500000-2500000");
	var option5= new Option("25 to 40 lacs","2500000-4000000");
	var option6= new Option("40 to 60 lacs","4000000-6000000");
	var option7= new Option("60 to 100 lacs","6000000-10000000");
	var option8= new Option("1 to 1.5 crores","10000000-15000000");
	var option9= new Option("1.5 to 2 crores","15000000-20000000");
	var option10= new Option("2.0 to 2.5 crores","20000000-25000000");
	var option11= new Option("above 2.5 crores","25000000");
	//var option12= new Option("Contact User","0-0");
	for(var i=0;i<12;i++)
	{
		eval("document.forms[0].Range.options[i]=option" + i);
	}
}
//PRICE RANGE FUNCTION FOR BUY	FOR ADVANCED SEARCH
function memberchangepricerangebuyadv()
{
	document.Adv_ser.Range.options.length = 0;
	var option0= new Option("Select a Price Range","");
	var option1= new Option("Below 5 lacs","1-500000");
	var option2= new Option("5 to 10 lacs","500000-1000000");
	var option3= new Option("10 to 15 lacs","1000000-1500000");
	var option4= new Option("15 to 25 lacs","1500000-2500000");
	var option5= new Option("25 to 40 lacs","2500000-4000000");
	var option6= new Option("40 to 60 lacs","4000000-6000000");
	var option7= new Option("60 to 100 lacs","6000000-10000000");
	var option8= new Option("1 to 1.5 crores","10000000-15000000");
	var option9= new Option("1.5 to 2 crores","15000000-20000000");
	var option10= new Option("2.0 to 2.5 crores","20000000-25000000");
	var option11= new Option("above 2.5 crores","25000000");
	//var option12= new Option("Contact User","0-0");
	for(var i=0;i<12;i++)
	{
		eval("document.Adv_ser.Range.options[i]=option" + i);
	}
}

function memberchangepricerangehome(form)
{
	document.Price_ser_form.Rangehome.options.length = 0;
	var option0= new Option("Select a Price Range","");
	var option1= new Option("Below 5 lacs","1-500000");
	var option2= new Option("5 to 10 lacs","500000-1000000");
	var option3= new Option("10 to 15 lacs","1000000-1500000");
	var option4= new Option("15 to 25 lacs","1500000-2500000");
	var option5= new Option("25 to 40 lacs","2500000-4000000");
	var option6= new Option("40 to 60 lacs","4000000-6000000");
	var option7= new Option("60 to 100 lacs","6000000-10000000");
	var option8= new Option("1 to 1.5 crores","10000000-15000000");
	var option9= new Option("1.5 to 2 crores","15000000-20000000");
	var option10= new Option("2.0 to 2.5 crores","20000000-25000000");
	var option11= new Option("2.5 to 5.0 crores","25000000-50000000");
	var option12= new Option("5.0 to 7.5 crores","50000000-75000000");
	var option13= new Option("7.5 to 10.0 crores","75000000-100000000");
	var option14= new Option("10.0 to 15.0 crores","100000000-150000000");
	var option15= new Option("15.0 to 20.0 crores","150000000-200000000");
	var option16= new Option("20.0 to 25.0 crores","200000000-250000000");
	var option17= new Option("25.0 to 30.0 crores","250000000-300000000");
	var option18= new Option("above 30.0 crores","300000000");
	//var option12= new Option("Contact User","0-0");
	for(var i=0;i<19;i++)
	{
		eval("document.Price_ser_form.Rangehome.options[i]=option" + i);
	}
}


/////homeloanenquiry///

function occupationfunc()
{
	
	document.homeloanapply.occupation.options.length = 0;
	var option0= new Option("Select","");
	var option1= new Option("salaried public Ltd.Co","salaried public Ltd.Co");
	var option2= new Option("Salaried MNC","Salaried MNC");
	var option3= new Option("Salaried Govt","Salaried Govt");
	var option4= new Option("Salaried Pvt Ltd Co.","Salaried Pvt Ltd Co.");
	var option5= new Option("Salaried Doctor","Salaried Doctor");
	var option6= new Option("Self-employed Doctor","Self-employed Doctor");
	var option7= new Option("Self-employed CA/MBA","Self-employed CA/MBA");
	var option8= new Option("Self-employeed Engg/Arch","Self-employeed Engg/Arch");
	var option9= new Option("Self-employed others","Self-employed others");
	
	for(var i=0;i<10;i++)
	{	
		eval("document.homeloanapply.occupation.options[i]=option" + i);
		
	}
}

//////////////////////////

/////homeloanmonthlyincome///

function monthlyincome()
{
	
	document.homeloanapply.monincome.options.length = 0;
	var option0= new Option("Select","");
	var option1= new Option("Less than 7000","1-7000");
	var option2= new Option("7001-10000","7001-10000");
	var option3= new Option("10001-15000","10001-15000");
	var option4= new Option("15001-25000","15001-25000");
	var option5= new Option("25001-40000","25001-40000");
	var option6= new Option("Above 40000","40000");
	
	for(var i=0;i<7;i++)
	{	
		eval("document.homeloanapply.monincome.options[i]=option" + i);
		
	}
}

//////////////////////////


//////////////////homeloanBudget/////////


function homeloanbudget()
{
	
	document.homeloanapply.budget.options.length = 0;
	var option0= new Option("Select","");
	var option1= new Option("Below 7 Lacs","1-70000");
	var option2= new Option("7 to 15 Lacs","700000-1500000");
	var option3= new Option("15 to 25 Lacs","1500000-2500000");
	var option4= new Option("25 to 40 Lacs","2500000-4000000");
	var option5= new Option("40 to 60 Lacs","4000000-6000000");
	var option6= new Option("60 to 100 Lacs","6000000-10000000");
	var option7= new Option("1 to 1.5 Crores","10000000-15000000");
	var option8= new Option("1.5 to 2 Crores","15000000-20000000");
	var option9= new Option("2 to 2.5 Crores","20000000-25000000");
	var option10= new Option("2.5 to 5 Crores","25000000-50000000");
	var option11= new Option("2.5 to 5 Crores","25000000-50000000");
	var option12= new Option("5 to 10 Crores","50000000-100000000");
	var option13= new Option("10 to 15 Crores","100000000-1500000000");
	var option14= new Option("15 to 20 Crores","1500000000-2000000000");
	var option15= new Option("20 to 25 Crores","2000000000-2500000000");
	var option16= new Option("25 to 30 Crores","2500000000-3000000000");
	var option17= new Option("30 to 35 Crores","3000000000-3500000000");
	var option18= new Option("35 to 40 Crores","3500000000-4000000000");
	var option19= new Option("40 to 45 Crores","4000000000-4500000000");
	var option20= new Option("45 to 50 Crores","4500000000-5000000000");
	var option21= new Option("Above 50 Crores","5000000000");


	for(var i=0;i<22;i++)
	{	
		eval("document.homeloanapply.budget.options[i]=option" + i);
		
	}
}
/////////////////////////////////

/////////Homeloan bank//////////////

function homeloanbank()
{
	
	document.homeloanapply.bank.options.length = 0;
	var option0= new Option("---Select a Bank---","");
	var option1= new Option("SBI","State Bank of India ");
	var option2= new Option("ICICI","icici");
	var option3= new Option("UTI","Unit Trust of India");
	var option4= new Option("HDFC","HDFC");
	var option5= new Option("ABN Amro Bank","ABN Amro bank");
	var option6= new Option("HSBC","HSBC");
	var option7= new Option("RBI","Reserve Bank of India");
	var option8= new Option("Bank of Baroda","Bank of Baroda");
	var option9= new Option("Central Bank of India ","Central Bank of India");
	var option10= new Option("Bharat Overseas Bank","Bharat Overseas Bank");
	var option11= new Option("UCO Bank","UCO Bank");
	var option12= new Option("Corporation Bank","Corporation Bank");
	var option13= new Option("Allahabad Bank","Allahabad Bank");
	var option14= new Option("IDBI Bank Ltd","IDBI Bank Ltd");
	var option15= new Option("Indian Overseas Bank","IOB");
	var option16= new Option("Bharat Overseas Bank Ltd","Bharat Overseas Bank Ltd");
	var option17= new Option("Punjab National Bank","Punjab National Bank");
	var option18= new Option("Union Bank of India","Union Bank of India");
	var option19= new Option("Syndicate Bank","Syndicate Bank");
	var option20= new Option("City Bank","City Bank");
	var option21= new Option("Other","Other");
	
	for(var i=0;i<22;i++)
	{	
		eval("document.homeloanapply.bank.options[i]=option" + i);
		
	}
}

////////////////////////////////



/////////Homeloan bank-admin//////////////

function homeloanbankadmin()
{
	
	document.form1.bank.options.length = 0;
	var option0= new Option("---Select a Bank---","");
	var option1= new Option("SBI","State Bank of India ");
	var option2= new Option("ICICI","icici");
	var option3= new Option("UTI","Unit Trust of India");
	var option4= new Option("HDFC","HDFC");
	var option5= new Option("ABN Amro Bank","ABN Amro bank");
	var option6= new Option("HSBC","HSBC");
	var option7= new Option("RBI","Reserve Bank of India");
	var option8= new Option("Bank of Baroda","Bank of Baroda");
	var option9= new Option("Central Bank of India ","Central Bank of India");
	var option10= new Option("Bharat Overseas Bank","Bharat Overseas Bank");
	var option11= new Option("UCO Bank","UCO Bank");
	var option12= new Option("Corporation Bank","Corporation Bank");
	var option13= new Option("Allahabad Bank","Allahabad Bank");
	var option14= new Option("IDBI Bank Ltd","IDBI Bank Ltd");
	var option15= new Option("Indian Overseas Bank","IOB");
	var option16= new Option("Bharat Overseas Bank Ltd","Bharat Overseas Bank Ltd");
	var option17= new Option("Punjab National Bank","Punjab National Bank");
	var option18= new Option("Union Bank of India","Union Bank of India");
	var option19= new Option("Syndicate Bank","Syndicate Bank");
	var option20= new Option("City Bank","City Bank");
	var option21= new Option("Other","Other");

	for(var i=0;i<22;i++)
	{	
		eval("document.form1.bank.options[i]=option" + i);
		
	}
}

////////////////////////////////

//DELETE CONFIRMATION FUNCTIONS
function deleteCon(id)
{
	if(confirm("Are you sure to want to delete this SavedSearch?"))
		document.location.href="search.php?delId="+id;
} 

function deletecon(url,fld)
{
	//alert("saravanan");
	if(confirm("Are you sure to want to delete this "+fld+"?"))
		document.location.href=url;
}
function deletefav(id)
{
	if(confirm("Are you sure to want to delete this Favorite Property?"))
	document.location.href="favorites.php?delId="+id;
}
function deletepos(id)
{
	if(confirm("Are you sure to want to delete this Possible Property?"))
	document.location.href="propertypossible.php?delId="+id;
}
function deleteReject(id)
{
	if(confirm("Are you sure to want to delete this Rejected Property?"))
	document.location.href="propertyrejected.php?delId="+id;
}
function deleteProp(id)
{
	if(confirm("Are you sure to want to delete this Property?")){
		if(pg == ''){
				pg=1;
		}
		document.location.href="Myproperty.php?delId="+id+"&page="+pg;
	}
		
}
function deleteProp1(id)
{
	if(confirm("Are you sure to want to delete this Property?")){
		var val=document.location.href="Myproperty.php?delId="+id;
	}
	return(val);
		
}
function deletevideo(id)
{
	if(confirm("Are you sure to want to delete this Video?")){
		var val=document.location.href="addvideo.php?delId="+id;
	}
	return(val);
		
}
function DelImg(id,path)
{
	if(confirm("Are you sure to want to delete ?"))
	window.location=path+"&url="+path+"&delId="+id;
}

function DelImgprop(id,path,image)
{
	if(confirm("Are you sure to want to delete ?"))
	window.location=path+"&url="+path+"&delId="+id+"&img="+image;
}

function DelImgpro(id,path,image,pid)
{
	//alert(pid);
	if(confirm("Are you sure to want to delete this image?"))
	window.location=path+"?&url="+path+"?&delId="+id+"&img="+image+"&Pid="+pid;

}
function DelMappro(id,path,image,pid)
{
	//alert(pid);
	if(confirm("Are you sure to want to delete this Map?"))
	window.location=path+"?&url="+path+"?&delmapId="+id+"&img="+image+"&Pid="+pid;

}
function DelFilepro(id,path,pid,image)
{
	//alert(pid);
	if(confirm("Are you sure to want to delete this File?"))
	window.location=path+"?&url="+path+"?&FileId="+id+"&img="+image+"&Pid="+pid;
}

function DelproductImg(id,path,image)
{
	if(confirm("Are you sure to want to delete ?"))
	window.location=path+"?url="+path+"&delId="+id+"&img="+image;
}

//FUNCTION FOR DISPLAYING THE IMAGE
function Show_Image(id,Pid)
{
day = new Date();
id1 = day.getTime();
window.open('classes/Show_Image.php?file='+id+'&id='+Pid, id1, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=600,height=600,left='+(screen.width/2-250)+', top='+(screen.height/2-150));
		//document.location.href="employeeMgt.php?delId="+id;
}



function showprice()
{
	document.all.id1.style.display = '';
	document.all.id2.style.display = '';
	document.all.id4.style.display = 'none';
	document.all.price.id = 'req_txt_price';
}


function hideprice()
{
	document.all.id1.style.display = 'none';
	document.all.id2.style.display = 'none';
	document.all.id4.style.display = '';
	document.all.price.id = '';
}


function disablep(val)
{
	if(val == 1)
	{
		document.forms[0].price.disabled = true;
	}
	else
	{
		document.forms[0].price.disabled = false;				
	}

}


function onemore(rname)
{
	var element=document.getElementById(rname);
	element.style.display="block";
}



function onemoreimg(rname)
{
	var element=document.getElementById(rname);
	if(rname=='2')
	{
		document.form1.PicTitle2.id="req_txt_Image Title 2";
	}
	else if(rname=='3')
	{
			document.form1.PicTitle3.id="req_txt_Image Title 3";
	}
	else if(rname=='4')
	{
			document.form1.PicTitle4.id="req_txt_Image Title 4";
	}
	else if(rname=='5')
	{
			document.form1.PicTitle5.id="req_txt_Image Title 5";
	}
	else if(rname=='6')
	{
			document.form1.PicTitle6.id="req_txt_Image Title 6";
	}
	else if(rname=='7')
	{
			document.form1.PicTitle7.id="req_txt_Image Title 7";
			document.form1.Pic[7].id="req_txt_Image 7";
	}
	else if(rname=='8')
	{
			document.form1.PicTitle8.id="req_txt_Image Title 8";
	}
	else if(rname=='9')
	{
			document.form1.PicTitle9.id="req_txt_Image Title 9";
	}
	else if(rname=='10')
	{
			document.form1.PicTitle10.id="req_txt_Image Title 10";
	}
	else if(rname=='11')
	{
			document.form1.PicTitle11.id="req_txt_Image Title 11";
	}
	else if(rname=='12')
	{
			document.form1.PicTitle12.id="req_txt_Image Title 12";
	}
	else if(rname=='13')
	{
			document.form1.PicTitle13.id="req_txt_Image Title 13";
	}
	else if(rname=='14')
	{
			document.form1.PicTitle14.id="req_txt_Image Title 14";
	}
	else if(rname=='15')
	{
			document.form1.PicTitle15.id="req_txt_Image Title 15";
	}
	else if(rname=='16')
	{
			document.form1.PicTitle16.id="req_txt_Image Title 16";
	}
	else if(rname=='17')
	{
			document.form1.PicTitle17.id="req_txt_Image Title 17";
	}
	else if(rname=='18')
	{
			document.form1.PicTitle18.id="req_txt_Image Title 18";
	}
	else if(rname=='19')
	{
			document.form1.PicTitle19.id="req_txt_Image Title 19";
	}
	else if(rname=='20')
	{
			document.form1.PicTitle20.id="req_txt_Image Title 20";
	}
	element.style.display="block";
}




function chek(j)
{
	var a=parseInt(document.forms[0].Prop_Totalfloor.value);
	var b=parseInt(document.forms[0].Prop_onfloor.value);
	if((b) > (a))
	{
		alert('Property on floor value should be less than or equal to Total floor value');
		document.forms[0].Prop_onfloor.focus();
		return false;
	}
	return true;
}

function setlen(v)
{
	if(v == 4)
	{
		document.forms[0].Category.options.length = 3;
	}
	else
	{
		document.forms[0].Category.options.length = 0;
		var option0= new Option("Select Category","");
		var option1= new Option("Apartment",1);
				var option2= new Option("Independent House",2);	
				var option3= new Option("Retail Space",3);
				var option4= new Option("Office Space",4);
				var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.forms[0].Category.options[i]=option" + i);
					}
				}
			}
		
		function setlenprop(v){
			
			if(v == 'PG/Roommate'){
			document.forms[0].Type.options.length = 3;
			}else
				{
			document.forms[0].Type.options.length = 0;

			var option0= new Option("Select Category","");
			var option1= new Option("Apartment",1);
			var option2= new Option("Independent House",2);	
			var option3= new Option("Retail Space",3);
			var option4= new Option("Office Space",4);
			var option5= new Option("Land",5);

				for(var i=0;i<6;i++)
				{
					eval("document.forms[0].Type.options[i]=option" + i);
				}//for
			}//else
			}//function

			
			function setlensearch(v){
				//alert(v);
			if(v == '4'){
			document.forms[0].Category.options.length = 3;
			}else{
				document.forms[0].Category.options.length = 0;
				var option0= new Option("Select Category","");
				var option1= new Option("Apartment",1);
				var option2= new Option("Independent House",2);	
				var option3= new Option("Retail Space",3);
				var option4= new Option("Office Space",4);
				var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.forms[0].Category.options[i]=option" + i);
					}
				}
			}
			
			
			function setlenquicksearch(v){
			if(v == '4'){
			document.forms[0].Category.options.length = 3;
			}else{
				document.forms[0].Category.options.length = 0;
				var option0= new Option("Select Category","");
				var option1= new Option("Apartment",1);
				var option2= new Option("Independent House",2);	
				var option3= new Option("Retail Space",3);
				var option4= new Option("Office Space",4);
				var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.forms[0].Category.options[i]=option" + i);
					}
				}
			}
			function setlenquicksearchforfeature(v){
			if(v == '4'){
			document.Featured_ser_form.Category.options.length = 3;
			}else{
				document.Featured_ser_form.Category.options.length = 0;
				var option0= new Option("Select Category","");
				var option1= new Option("Apartment",1);
				var option2= new Option("Independent House",2);	
				var option3= new Option("Retail Space",3);
				var option4= new Option("Office Space",4);
				var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.Featured_ser_form.Category.options[i]=option" + i);
					}
				}
			}

			function homejewelsearch(v)
			{
				if(v == '4')
				{
				document.Quc_ser_form.SS_PropCat.options.length = 3;
				}else
				{
					document.Quc_ser_form.SS_PropCat.options.length = 0;
					var option0= new Option("Select Category","");
					var option1= new Option("Apartment",1);
					var option2= new Option("Independent House",2);	
					var option3= new Option("Retail Space",3);
					var option4= new Option("Office Space",4);
					var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.Quc_ser_form.SS_PropCat.options[i]=option" + i);
					}
				}
			}




			function setlenadvancedsearch(v)
			{
				if(v == '4')
				{
				document.Adv_ser.SS_PropCat.options.length = 3;
				}
				else
				{
					document.Adv_ser.SS_PropCat.options.length = 0;
					var option0= new Option("Select Category","");
					var option1= new Option("Apartment",1);
					var option2= new Option("Independent House",2);	
					var option3= new Option("Retail Space",3);
					var option4= new Option("Office Space",4);
					var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.Adv_ser.SS_PropCat.options[i]=option" + i);
					}
				}
			}

function setlencity(v)
{
	if(v == 4)
	{
		document.forms[0].Types.options.length = 3;
	}
	else
	{
		document.forms[0].Types.options.length = 0;
		var option0= new Option("Select Category","");
		var option1= new Option("Apartment",1);
				var option2= new Option("Independent House",2);	
				var option3= new Option("Retail Space",3);
				var option4= new Option("Office Space",4);
				var option5= new Option("Land",5);
					for(var i=0;i<6;i++)
					{
						eval("document.forms[0].Types.options[i]=option" + i);
					}
				}
			}

	function Vdate(){
		if(document.forms[0].Search_save.checked == true && document.forms[0].SS_Title.value == ""){
			alert('Please Enter The Saved Search Title');
			document.forms[0].SS_Title.focus();
			return false;
		}
	return true;
	}
  function ssName(chk){
	  if(chk == true){
			document.getElementById('sstitle').style.display = '';
  		}else{
			document.getElementById('sstitle').style.display = 'None';
		}
	}
	function ShowSearchTitle()
	{
		document.getElementById('sstitle').style.display = '';
	}
	
	function chek1(j){
	dml = document.Prop_apartment_details;
	chkName = 'Prop_Addroom';
	len = dml.elements.length;

	var i=0;
	for( i=0 ; i<len ; i++) {
		if (dml.elements[i].name==chkName){
			alert("Please Select Additional Rooms");
			return false;
		}
	}
	if(document.forms[0].Prop_onfloor.value > document.forms[0].Prop_Totalfloor.value){
		alert('Property on floor value should be less than or equal to Total floor value');
		document.forms[0].Prop_onfloor.focus();
		return false;
	}
	return true;
}
function winclose(uname)
{
	window.opener.document.forms[0].Username.value = uname;
	window.close();
}

function addVal(val){
document.forms[0].Prop_Addroom1.value = document.forms[0].Prop_Addroom1.value+val+',';
}

function loginform()
   { 
   var a=document.login;
   	 if(a.Username.value=="")
	 {
		alert("Plase Enter username")
		a.Username.focus();
		return false;
		}
     else if(a.Password.value=="")
	 {
        alert("Plase Enter password")
		a.Password.focus();
		return false;
      }
	  else
	  {
	  a.submit();
	  return true;
	  }
  }
   function ValdateID(){
  
  if(document.forms[0].Prop_ID.value == ""){
  		alert("Enter Property ID");
		document.forms[0].Prop_ID.focus();
  		return false;
  }
  
  }
  
  
function keycode()
{
 if(window.event.keyCode == "13")
 {
  validem();
 }
}
/*function validem()
{
	
	if(document.idSearch.Prop_ID.value=="")
	{
		alert("Please Enter an Listing ID !");
		document.idSearch.Prop_ID.focus();
		return false;
    }
	else
	{
		var PLID=new String(document.idSearch.Prop_ID.value);
		var len=PLID.length;
		
		var casechanged=PLID.toUpperCase(); 
		var PLListingID=casechanged;
		var CheckPLID=PLListingID.substring(0,3);
		
		

		if (CheckPLID!="PL")
		{
			alert("Invalid Listing ID ! Please Enter Correct ID");
			document.idSearch.Prop_ID.value="";
			document.idSearch.Prop_ID.focus();
			return false;
		}
		PLListingID=PLListingID.substring(3,len);
		
		}
}*/

function validem()
{
	
	if(document.idSearch.Prop_ID.value=="")
	{
		alert("Please Enter Listing ID !");
		document.idSearch.Prop_ID.focus();
		return false;
    }
	else
	{
		var PLID=new String(document.idSearch.Prop_ID.value);
		var len=PLID.length;
		
		var casechanged=PLID.toUpperCase(); 
		var PLListingID=casechanged;
		//alert(PLListingID);
		var CheckPLID=PLListingID.substring(0,4);
		//alert(CheckPLID);
		var myRegExp = /\d\d/;
		var numStart = PLID.search(myRegExp); 
		//alert("The number starts at position " + numStart);
		if(numStart!='0')
		{
			if(CheckPLID!="PLID" || PLListingID == 'PLID')
			{
				alert("Invalid Listing ID! Please Enter Correct ID");
				document.idSearch.Prop_ID.value="";
				document.idSearch.Prop_ID.focus();
				return false;
			}
		}
				
	}
}

function Show_Image1(id,Pid)
{

day = new Date();
id1 = day.getTime();
//alert(Pid)
//alert('../classes/Show_Image.php?file='+id+'&id=<?=$_REQUEST["Pid"]?>');
window.open('classes/Show_Image.php?file='+id+'&id='+Pid, id1, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=500,height=500,left='+(screen.width/2-250)+', top=0');

}



function Show_Map(id,Map)
{

//alert("hii");
day = new Date();
id1 = "Map";
window.open('classes/Show_Map.php?file='+Map+'&id='+id, id1, 'toolbar=0,scrollbars=1,location=0,statusbar=0,menubar=0,resizable=1,width=900,height=600,left='+(screen.width/2-250)+', top=0');

}

function Show_PImage(id,Map)
{
day = new Date();
id1 = "Map";
window.open('classes/Show_PImage.php?file='+Map+'&id='+id, id1, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left='+(screen.width/2-250)+', top=0');

}
function Show_ProjectImage(id,Map)
{
day = new Date();
id1 = "Map";
window.open('classes/Show_PImage.php?file='+Map+'&id='+id, id1, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=400,left='+(screen.width/2-250)+', top=0');

}
function Show_Map1(id,Map)
{

day = new Date();
id1 = "Map";
window.open('classes/Show_Map.php?file='+Map+'&id='+id, id1, 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=500,height=500,left='+(screen.width/2-250)+', top=0');

}

function showplace(sd,cid,frmname)
{
//	alert("ddddddddd");
	for (i=0; i < document[frmname].elements.length; i++)
	{
	var item = document[frmname].elements[i];
	var item1 = document[frmname].elements[0];
	var item2 = document[frmname].elements[1];
	document.all.id1.style.display = '';
	document.all.id2.style.display = '';
	item1.value = sd;
	item2.value = cid;
	item1.focus();
	}

}
function hideplace()
{
	document.all.id1.style.display = 'none';
	document.all.id2.style.display = 'none';
	
}

function deletecountry(url,fld)
{
	//alert("kumar");
	if(confirm("Are you sure to want to delete this "+fld+"?"))
		document.location.href=url;
}
function chk_hid()
{
	document.regForm.strnri.disabled=false;	
}

function chk_hid1()
{
    document.regForm.strnri.disabled=true; 
}
function showterms()
{
	window.open('terms.php','','width=560,height=600,scrollbars=yes,status=no,toolbar=no,resizable=yes');
}
function DisplayServiceTypeCharge(form)
	{
		var ServiceTypePrice=document[form].ServiceType.value;
		///alert(document[form].NRIPaymentPlanID.value);

		var CheckType1=document.getElementById("Searching Property");
		var CheckType2=document.getElementById("Price Negotiation");
		var CheckType3=document.getElementById("Property Legal Verification");
		var CheckType4=document.getElementById("Property Maintenance");
		var CheckType5=document.getElementById("Additional Photo & Video for Property");
		var CheckType6=document.getElementById("NRI Listing Contact");
		if (ServiceTypePrice=="Searching Property")
		{
			CheckType1.style.display="block";
			CheckType2.style.display="none";
			CheckType3.style.display="none";
			CheckType4.style.display="none";
			CheckType5.style.display="none";
			CheckType6.style.display="none";
			//document[form].Amount.value="860";
		}
		else if (ServiceTypePrice=="Price Negotiation")
		{
			CheckType1.style.display="none";
			CheckType2.style.display="block";
			CheckType3.style.display="none";
			CheckType4.style.display="none";
			CheckType5.style.display="none";
			CheckType6.style.display="none";
			//document[form].Amount.value="4300";
		}
		else if (ServiceTypePrice=="Property Legal Verification")
		{
			CheckType1.style.display="none";
			CheckType2.style.display="none";
			CheckType3.style.display="block";
			CheckType4.style.display="none";
			CheckType5.style.display="none";
			CheckType6.style.display="none";
			//document[form].Amount.value="8600";
		}
		else if (ServiceTypePrice=="Property Maintenance")
		{
			CheckType1.style.display="none";
			CheckType2.style.display="none";
			CheckType3.style.display="none";
			CheckType4.style.display="block";
			CheckType5.style.display="none";
			CheckType6.style.display="none";
			//document[form].Amount.value="21500";
		}
		else if (ServiceTypePrice=="Additional Photo & Video for Property")
		{
			CheckType1.style.display="none";
			CheckType2.style.display="none";
			CheckType3.style.display="none";
			CheckType4.style.display="none";
			CheckType5.style.display="block";
			CheckType6.style.display="none";
			//document[form].Amount.value="4300";
		}
		else if (ServiceTypePrice=="NRI Listing Contact")
		{
			CheckType1.style.display="none";
			CheckType2.style.display="none";
			CheckType3.style.display="none";
			CheckType4.style.display="none";
			CheckType5.style.display="none";
			CheckType6.style.display="block";
			//document[form].Amount.value="4300";
		}
		///alert(document[form].SelectPaymentPlanID.value);
	}

function CheckPhoneSizeValue(frm,FieldName)
{
	var PhoneValue=document[frm].elements[FieldName].value;
	if(PhoneValue <= 0)
	{
		alert('Please Enter Valid Number');
		document[frm].elements[FieldName].focus();
		document[frm].elements[FieldName].value="";
		return false;		
	}
	/*if (PhoneValue=="0" || PhoneValue=="00" || PhoneValue=="000" || PhoneValue=="0000" || PhoneValue=="00000" || PhoneValue=="000000" || PhoneValue=="0000000" || PhoneValue=="00000000"  || PhoneValue=="000000000"  || PhoneValue=="0000000000"  || PhoneValue=="00000000000"  || PhoneValue=="000000000000"  || PhoneValue=="0000000000000"  || PhoneValue=="00000000000000"  || PhoneValue=="000000000000000"  || PhoneValue=="0000000000000000"  || PhoneValue=="00000000000000000"  || PhoneValue=="000000000000000000"  || PhoneValue=="0000000000000000000"  || PhoneValue=="00000000000000000000")
	{
		alert('Please Enter Valid Phone');
		document[frm].elements["Phone"].value="";
		document[frm].elements["Phone"].focus();
		return false;
	}*/
}

function APTOnly(frm,s)
{
	//alert(s);
	var a=s;
	if(a!="")
	{
	var a1=a.substring(0,3);
	//alert(a1);
		if(a1=='APT')
			{
				var	a2=a.split("APT");

//alert(a2[1]);
				if(isNaN(a2[1])== true)
				{
					alert("Invalid TicketID");
					document.forms[frm].TicketID.value="";
					document.forms[frm].TicketID.focus();
					return false;
				}
				else
				{
					return true;
				}
	
			}
		else
			{
			//alert('false');
			alert("Invalid TicketID");
			document.forms[frm].TicketID.value="";
			document.forms[frm].TicketID.focus();
			return false;
    		}
			return false;
	}
	else
	{
		return true
	}

}

//************************************* Payment Start *****************************************************************
function popupwin(name,width,height)
{
	var spec='menubar=no, toolbar=no, location=no, status=no, scrollbars=yes, resizable=no, width='+width+',height='+height;
	var newwin = window.open(name,newwin,spec);
}

function UpgradeMembership(frm)
	{
		var num=document[frm].elements["TotalListings"].value;
		//-------------------------------------------------------------------------------------------------------------

		var AllListingID=document[frm].elements["AllListingID"].value;
		var myString = new String(AllListingID);
		var mySeparator = ",";
		var arrayName=myString.split(mySeparator);

		//-------------------------------------------------------------------------------------------------------------

		if (document[frm].elements["upgrademembershipchoice"].value==1)
		{
			
			for(i=0;i<num;i++)
			{
				var FieldName="Select" + i;
				//alert(FieldName);
				var str = document[frm].elements[FieldName].checked=true;
				eval (str);
			}
			document[frm].elements["MainCheckBox"].checked=true;
			document[frm].elements["upgrademembershipchoice"].value="0";
		}
		else
		{
			for(i=0;i<num;i++)
			{
				var RadioFieldName="PaymentPlanID" + arrayName[i];
				document[frm].elements[RadioFieldName][0].checked=false;
				document[frm].elements[RadioFieldName][1].checked=false;
				AddTotalAmount(frm,RadioFieldName); // Call to Function..

				var FieldName="Select" + i;
				//alert(FieldName);
				var str = document[frm].elements[FieldName].checked=false;
				eval (str);
			}
			document[frm].elements["MainCheckBox"].checked=false;
			document[frm].elements["upgrademembershipchoice"].value="1";
		}
	}

	function TotalUpgradeMembership(frm)
	{
		var counter=0;
		var AllListingID=document[frm].elements["AllListingID"].value;
		//alert(AllListingID);
		//alert("AllListingID" + AllListingID);
		var myString = new String(AllListingID);
		var mySeparator = ",";
		genResults(frm,myString.split(mySeparator));
		function genResults(frm,arrayName)
		{
			if (arrayName == null)
			{
			}
			else
			{
				for (var i=0; i<arrayName.length;i++)
				{
					var FieldName="PaymentPlanID" + arrayName[i];
				//	alert(FieldName);
					if ((document[frm].elements[FieldName][0].checked==true) || (document[frm].elements[FieldName][1].checked==true))
					{
						counter++;
					}
				}
			}
			if (counter==0)
			{
				alert("Please select your membership");
				return false;
			}
			else
			{
				document[frm].submit();
			}
		}
	}

	function AddTotalAmount(frm)
	{
		var AllListingID=document[frm].elements["AllListingID"].value;
		//alert(AllListingID);
		document[frm].elements["TotalAmount"].value="0";
		document.getElementById('nTotalAmt').innerHTML = "0";
		//alert(document.getElementById('nTotalAmt').innerHTML = "0");
		var myString = new String(AllListingID);
		var mySeparator = ",";
		genResults(frm,myString.split(mySeparator));
		function genResults(frm,arrayName)
		{
			if (arrayName == null)
			{
			}
			else
			{
				for (var i=00; i<arrayName.length;i++)
				{
					var CheckBoxName="Select" + i;
					PreviousAmount=document[frm].elements["TotalAmount"].value;
					var FieldName="PaymentPlanID" + arrayName[i];
					var Purpose="Purpose" +i;
					//alert(FieldName);
					if (document[frm].elements[FieldName][0].checked==true)
					{
						if (document[frm].elements[Purpose].value=="Sale")
						{
							var GoldMembership=document[frm].elements["SellerGoldAmount"].value;
						}
						else
						{
							var GoldMembership=document[frm].elements["MemberGoldAmount"].value;
						}
						var TotalAmount=parseInt(GoldMembership) + parseInt(PreviousAmount);
						document.getElementById('nTotalAmt').innerHTML = TotalAmount;
						document[frm].elements["TotalAmount"].value=TotalAmount;
						document[frm].elements[CheckBoxName].checked=true;
						document[frm].elements[CheckBoxName].value=FieldName;// document[frm].elements[FieldName][0].value; // Assign value to Check Box
					}
					else if (document[frm].elements[FieldName][1].checked==true)
					{
						if (document[frm].elements[Purpose].value=="Sale")
						{
							var ClassicMembership=document[frm].elements["SellerClassicAmount"].value;
						}
						else
						{
							var ClassicMembership=document[frm].elements["MemberClassicAmount"].value;
						}
						var TotalAmount=parseInt(ClassicMembership) + parseInt(PreviousAmount);
						document.getElementById('nTotalAmt').innerHTML = TotalAmount;
						document[frm].elements["TotalAmount"].value=TotalAmount;
						document[frm].elements[CheckBoxName].checked=true;
						document[frm].elements[CheckBoxName].value= FieldName;//document[frm].elements[FieldName][1].value; // Assign value to Check Box
					
					
					}
					
				}
			}
		}
	}

	function AddAmount(frm)
	{
		var FieldName="PaymentPlanID";
		if(document[frm].elements[FieldName][0].checked==true)
		{
		var val=document[frm].elements[FieldName][0].value;
		}
		else
		{
		var val=document[frm].elements[FieldName][1].value;
		}
		document[frm].TotalAmount.value=val;
	}
	function CheckBoxValidation(frm,FieldName)
	{
		var RadioFieldName=document[frm].elements[FieldName].value;
		//alert(RadioFieldName);
		if (RadioFieldName)
		{
			document[frm].elements[RadioFieldName][0].checked=false;
			document[frm].elements[RadioFieldName][1].checked=false;
			AddTotalAmount(frm);
		}
	}

	function DisplayMessage(URL)
	{
		alert("Unpaid Property Message! \n Please Pay to view this message.");
		window.location.replace(URL);
		return false
	}
	
	function DisplayMessageAgent(URL)
	{
		alert("Sorry paid Agents/Builders can only view the Property Message! \n Please Pay to view this message.");
		window.location.replace(URL);
		return false
	}

function getCookie(name) 
		{
		  var dc = document.cookie;
		  var prefix = name + "=";
		  var begin = dc.indexOf("; " + prefix);
		  if (begin == -1) {
			begin = dc.indexOf(prefix);
			if (begin != 0) return null;
		  } else
			begin += 2;
		  var end = document.cookie.indexOf(";", begin);
		  if (end == -1)
			end = dc.length;
		  return unescape(dc.substring(begin + prefix.length, end));
		}

		function DeleteCookie(name,path,domain)
		{
			if (getCookie(name)) 
				{
				 document.cookie = name + "=" + ((path) ? "; path=" + path : "") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
			   }
		}

function add(list,url)
{
	var listid=new Array()
	var j=0;
	var counter=0;
	for (var i=0;i<list.length;i++)
	{
		if(document.getElementById(list[i]).checked == true)
		{
			//alert(list[i]);
			listid[j]=list[i];
			//alert(listid[j]);
			j++;
			counter++;
		}
	}
	if (counter == 0)
	{
		alert("Please Select atleast one Property");
		return false;
	}
	else
	{
		window.location = url+listid;
	}
}
//****************************************** ****************************************************** add balamurugan June 26th
function MemberPropertyFormValidation(frm,Fieldname)
	{
		if(!(document[frm].elements[Fieldname][0].checked || document[frm].elements[Fieldname][1].checked))
		{
			alert("Please Select Payment Option");
			document[frm].elements[Fieldname][0].focus();
			return false;
		}
		else
		{
			document[frm].submit();
		}
	}

function poptastic(url)
{
	newwindow=window.open(url,'name','height=470,width=610');
	if (window.focus) {newwindow.focus()}
}
function popmoreloc()
{
	alert(document.morelocation.morelocs.value);
	document.morelocation.submit();
}

//CRS admin add appointments
function showirs()
{   
    document.all.tabirs.style.display = 'none';
	document.all.tabcrs.style.display = '';
}
function showcrs()
{   
    document.all.tabcrs.style.display = 'none';
	document.all.tabirs.style.display = '';
}
//end CRS admin
//****************************************** Payment End ******************************************************


//****************************************************** Subuser **********************************************

/*function dupServices(docF)
{
	var str=docF;
	var service=new Array();
	var tempstr, flag=true, lastchecked, sname;
	var k=0,i,flag=0;

	for(i=0;i<str.elements.length;i++)
	{
		if(str.elements[i].name == Property && str.elements[i].checked==true)
		{
			flag=1;
			tempstr =str.elements[i].value.split("_");
			if(tempstr.length == '1')
				service[k++]=tempstr[0];
			else
				for(j=0;j<tempstr.length-1;j++)
				{
					service[k++]=tempstr[j];
				}// end inner for
			lastchecked = tempstr[0];
		}// end if
	}// end outer for

	if(flag == 0)
	{
		alert('You have not selected any service.');
		return false;
	}

	for(k=0;k<service.length;k++)
	{
		for(j=k+1;j<service.length;j++)
		{
			if(service[k]==service[j])
			{
				alert("You have chosen a service twice.\nPlease de-select one option");
				return false;
			}
		}
	}
	return true;
}*/

//**********************************************************************************************************