<!--
	//Create a boolean variable to check for a valid Internet Explorer instance.
	var xmlhttp = false;
	//Check if we are using IE.
	try {
	//If the Javascript version is greater than 5.
		xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
	} catch (e) {
	//If not, then use the older active x object.
		try {
		//If we are using Internet Explorer.
			xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
		} catch (E) {
		//Else we must be using a non-IE browser.
			xmlhttp = false;
		}
	}
	//If we are using a non-IE browser, create a javascript instance of the object.
	if (!xmlhttp && typeof XMLHttpRequest != 'undefined') {
		xmlhttp = new XMLHttpRequest();
	}

Array.prototype.inArray = function (value)
// Returns true if the passed value is found in the
// array.  Returns false if it is not.
{
    var i;
    for (i=0; i < this.length; i++) {
        // Matches identical (===), not just similar (==).
        if (this[i] === value) {
            return true;
        }
    }
    return false;
};

	function testfrm(serverPage, objID)
	{
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET", serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					document.getElementById(objID).innerHTML = xmlhttp.responseText;
				}
				else
				{
					document.getElementById(objID).innerHTML = '<table width="100%"><tr><td height="10" valign="center" align="center" class="text" style="color:000000;"><font style="font-size:9px">Loading</font>&nbsp;&nbsp;<input type="image" name="imageField" src="'+IMG_SERVER+'/images/loading.gif"/></td></tr></table>';
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}
	// This function is customize for registration and list your property
	function makerequest(serverPage, objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET", serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					//obj.innerHTML = xmlhttp.responseText;
					var text = xmlhttp.responseText.substr(0,(xmlhttp.responseText.length-1));
					if(text == '')
						text = '&nbsp;';
					obj.innerHTML = text;
					mystr = xmlhttp.responseText.substr(0,(xmlhttp.responseText.length-1));

					var thelength=xmlhttp.responseText.length;
					var last_char=xmlhttp.responseText.charAt(thelength-1);

					if(eval('last_char')==0)
					{
						return false;
					}
					else
					{
						return true;
					}
				}
				else
				{
					document.getElementById(objID).innerHTML = '<table width="100%"><tr><td height="10" valign="center" align="center" class="text" style="color:000000;"><font style="font-size:9px">Loading</font>&nbsp;&nbsp;<input type="image" name="imageField" src="'+IMG_SERVER+'/images/loading.gif"/></td></tr></table>';
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}
function makerequestfastfree(serverPage, objID)
	{

		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET", serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
			if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
				}
				else
				{
					document.getElementById(objID).innerHTML = '<table width="40%" border="0" align="rignt"  style="border:1px solid #48A1CB;"><tr><td colspan="2" class="text" width = "20%"><font style="font-size:9px">Loading</font>&nbsp;&nbsp;<input type="image" name="imageField" src="'+IMG_SERVER+'/images/loading.gif"/></td></tr><tr><td align="center">&nbsp;</td><td align="center">&nbsp;</td></tr></table>';
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}
	function showsms(serverPage, objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var temp = new Array();
		temp = objID.split('_');
		var newdiv = 'div_f' + temp[1];
		if (document.getElementById(newdiv) != null && document.getElementById(newdiv) != "undefined") {
			if(document.getElementById(newdiv).style.display != 'none') {
				var obj = document.getElementById(newdiv);
			} else {
				var obj = document.getElementById(objID);
			}
		} else {
				var obj = document.getElementById(objID);
		}

		try
		{
			xmlhttp.open("GET", serverPage,true);

			xmlhttp.onreadystatechange = function()

			{
				if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
					return true;
				}
				else
				{
					document.getElementById(objID).innerHTML = '<table width="100%" class="whitefill"><tr><td height="10" valign="center" align="center" class="text" style="color:000000;"><font style="font-size:9px">Loading</font>&nbsp;&nbsp;<input type="image" name="imageField" src="'+IMG_SERVER+'/images/loading.gif"/></td></tr></table>';
				}
			}
			xmlhttp.send(null);
			//alert("six");
		}
		catch(e)
		{
		}
	}

	// This function is a general function for any where use

	function makeajaxrequest(serverPage,objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					var message='';
					message = xmlhttp.responseText;
					var thelength=message.length;
					var last_char=message.charAt(thelength-1);
					if(last_char == '.')
					{
						message = message.substr(0,(message.length-1));
					}
					obj.innerHTML = message;

				}
				else
				{
					document.getElementById(objID).innerHTML = 'Processing.....please wait';
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}

	function ajaxrequest(serverPage,objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
			if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
    }

	function makeajaxpostrequest(serverPage,objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("POST",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
			if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
    }

	// This function is a general function for any where use
	function ajaxlogin(serverPage,objID,type,mode,currentpage,show,propertyid,mobilepage)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		if(currentpage == '' || currentpage == 'undefined')
		{
			currentpage = 'listing';
		}
		if(!mobilepage) mobilepage=0;
		var obj = document.getElementById(objID);
		try
		{

			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					//obj.innerHTML = xmlhttp.responseText.substr(0,(xmlhttp.responseText.length-1));
					mystr = xmlhttp.responseText.substr(0,(xmlhttp.responseText.length-1));
					var thelength=xmlhttp.responseText.length;
					var last_char=xmlhttp.responseText.charAt(thelength-1);
					if(currentpage == 'saveagetalert')
					{
						//alert('come');
						var getmessage='';
						getmessage = xmlhttp.responseText;
						//alert(getmessage);
						var temp = new Array();
						temp = getmessage.split('##$$##');

						output = temp[0].substr(temp[0].length-4,temp[0].length);
						if(output=='DONE')
						{
							if(document.getElementById('div_getalert'))
								document.getElementById('div_getalert').innerHTML=temp[0].substr(0,temp[0].length-4);

							if(document.getElementById('div_welcome'))
								document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[1] + "</b>&nbsp;&nbsp;";

							if(document.getElementById('div_toplinks'))
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";

							if(document.getElementById('div_register_tab'))
								document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";

							if(document.getElementById('div_msg'))
								document.getElementById('div_msg').innerHTML = '';

							if(document.getElementById('div_msg2'))
								document.getElementById('div_msg2').innerHTML = '';

							//tb_remove();
						}
						else
						{
							output = getmessage.substr(getmessage.length-1,getmessage.length);
							//alert(output);
							//alert(obj);
							if(eval(output)=='0' || eval(output)==0)
							{
								//alert('comedd');
								document.getElementById('div_msg2').innerHTML = '';
								document.getElementById('div_msg2').innerHTML = getmessage.substr(0,getmessage.length-1);
							}
							else
							{
								//alert('godd');
								document.getElementById('div_msg2').innerHTML = getmessage;
							}
						}
					}
					else
					{
						if(eval(last_char)=='0')
						{
							obj.innerHTML = mystr;
						}
						else
						{
							var b = xmlhttp.responseText;
							var temp = new Array();
							temp = b.split('#');

							if(currentpage == 'cl')
							{
								//enableFormElement();
								var msg = "<table border = '0' width='100%' cellpadding='0' cellspacing='0' >"
								var note = note1 = notefr = "";
								var frflag = ' & ';
								msg+="<tr><td valign='top'><b class='bl1h'></b><b class='bl2h'></b><b class='bl3h'></b><b class='bl4h'></b><div style='border-left:1px solid #A7C4E3; border-right:1px solid #A7C4E3;'><div><table width='100%' style='background:#BCDEFA;'>"

								msg += "<tr style='line-height:20px;'><td class = 'columnhead paddingleft20' width='30%'>Balance Listing : </td><td class = 'columnhead paddingleft20'><b>";

								//alert(temp[18]);
								//alert(temp[15]);
								//alert(temp[16]);
								//alert(temp[1]);

								if(temp[15] == "0" || temp[16] == "0") {
									if(temp[18]=="1") {
										msg +="Fast Response - <span id='fr_balance'>1</span>&nbsp;&nbsp;";
										msg +="<br>Fast Response - <span id='fr_obalance'>" + temp[1] + "*</span>";
										notefr +="<b><span id='fr2_obalance'>"+temp[1]+"</span> Fast Response Listing(s)</b>";
									}
									else
									{
										msg +="Fast Response - <span id='fr_balance'>" + temp[1] + "</span>";
									}
								}else{
									if(temp[18]=="1") {
										msg +="Fast Response - <span id='fr_balance'>1</span>&nbsp;&nbsp;";
										msg +="<br>Fast Response - <span id='fr_obalance'>" + temp[1] + "*</span>";
										notefr +="<b><span id='fr2_obalance'>"+temp[1]+"</span> Fast Response Listing(s)</b>";
									}
									else
									{
										msg +="Fast Response - <span id='fr_balance'>" + temp[1] + "</span>";
									}
									if(temp[1] > 0) {
										note1 = " & <b> 1 Fast Response Listing(s)</b>";
									}
								}

								if(temp[15] == "0")
								{
									msg += " &nbsp&nbsp; </b></td><td class = 'columnhead paddingleft20'><b>Basic - <span id='bas_balance'>" + temp[13] + "</span>";
								}else{
									msg += " &nbsp&nbsp; </b></td><td class = 'columnhead paddingleft20'><b>Basic - Unlimited";
									note += "<tr><td colspan='3' style='background:#BCDEFA;height:30px;' align='left' class = 'columnhead paddingleft20'><img src='http://img.makaan.com/images/arrow-right.gif' align='absmiddle' /> You have <b>Unlimited Basic Listing</b><span id='tr_topinfo1'>" + note1 + "</span> to list property in any cities except  Delhi, Mumbai, Hyderabad, Bangalore, Kolkata and Pune.</td></tr>";
									if(temp[13] > 0 || temp[18]=="1") {

										var notebasic = "";
										if(temp[13] > 0)
										{
											var notebasic = "<b>" + temp[13] + " Basic Listing</b>";
											msg += " &nbsp&nbsp;<br>Basic - <span id='bas_balance'>" + temp[13] + "*</span></b>";
										}

										note += "<tr id='tr_topinfo2'><td colspan='3' style='background:#BCDEFA;height:20px;' align='left' class = 'columnhead paddingleft20'><img src='http://img.makaan.com/images/arrow-right.gif' align='absmiddle' /> *You have "+ notebasic + notefr + " for  Delhi, Mumbai, Hyderabad, Bangalore, Kolkata and Pune.</td></tr>";
									}
									else
									{
										msg += "<span id='bas_balance' style='display:none;'>0</span>";
									}
								}

								msg += "</b></td></tr>";
								//msg += "<tr style='line-height:20px;'><td class = 'columnhead paddingleft20'>Properties added this session : </td><td class = 'columnhead paddingleft20'><b>Fast Response - <span id='fr_listed'>0</span>&nbsp&nbsp; </b></td><td class = 'columnhead paddingleft20'><b>Basic - <span id='bas_listed'>0</span></b></td></tr>";

								document.getElementById('div_login_table').innerHTML = '';
								document.getElementById('div_login_table').innerHTML = msg;
								if(note != "")
								{
									document.getElementById('div_login_table').innerHTML += note;
								}
								document.getElementById('div_login_table').innerHTML += "</table></div>";
								document.getElementById('div_login_table').innerHTML += "</div></div><b class='bl4bh'></b><b class='bl3bh'></b><b class='bl2bh'></b><b class='bl1h'></b></td></tr></table>";

								//document.listproperty_frm.loginuser.value = temp[0];
								document.listproperty_frm.member_id.value = temp[0];
								document.listproperty_frm.loggedin.value = temp[0];
								document.listproperty_frm.m_type.value = temp[17];
								document.listproperty_frm.basicbalance.value = temp[13];
								document.listproperty_frm.frbalance.value = temp[1];
								document.listproperty_frm.freemarketfruser.value = temp[16];
								document.listproperty_frm.freemarketbasicuser.value = temp[15];

								document.listproperty_frm.contact_name.value = temp[2];
								document.listproperty_frm.contact_email.value = temp[4];
								document.listproperty_frm.mob_country_code.value = Trim(temp[5]);
								document.listproperty_frm.mobile1.value = temp[6];
								if(temp[7] != "" && temp[8] != "")
								{
									document.listproperty_frm.ph_country_code.value = temp[7];
									document.listproperty_frm.contact_mobile2.value = temp[8];
								}
								document.listproperty_frm.ph_area_code.value = temp[9];
								document.listproperty_frm.phone1.value = temp[10];
								if(temp[11] != "" && temp[12] != "")
								{
									document.listproperty_frm.ph_area_code2.value = temp[11];
									document.listproperty_frm.contact_phone2.value = temp[12];
								}
								document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";
								document.getElementById('login-details').innerHTML = 'Listing Details';
								document.getElementById('cityall').style.display = 'none';
								document.getElementById('citycorporate').style.display = 'none';
								document.getElementById('tr_member_cother').style.display = 'none';
								enableFormElement();
								listingblockchange();
								document.getElementById('sfr').innerHTML = 'Fast Response';
								document.getElementById('sbas').innerHTML = 'Basic';
								showhide();
							}
							else if(currentpage == 'freecl')
							{
								//enableFormElement();
								var msg = "<table border = '0' width='100%' cellpadding='0' cellspacing='0' >"
								var note = note1 = notefr = "";
								var frflag = ' & ';
								msg+="<tr><td valign='top'><b class='bl1h'></b><b class='bl2h'></b><b class='bl3h'></b><b class='bl4h'></b><div style='border-left:1px solid #A7C4E3; border-right:1px solid #A7C4E3;'><div><table width='100%' style='background:#BCDEFA;'>"

								msg += "<tr style='line-height:20px;'><td class = 'columnhead paddingleft20' width='30%' align='center'><b>Special Offer:</b> List your property for FREE.<span id='fr_balance' style='display:none;'>200</span><span id='bas_balance' style='display:none;'>200</span></td></tr>";

								document.getElementById('div_login_table').innerHTML = '';
								document.getElementById('div_login_table').innerHTML = msg;
								document.getElementById('div_login_table').innerHTML += "</table></div>";
								document.getElementById('div_login_table').innerHTML += "</div></div><b class='bl4bh'></b><b class='bl3bh'></b><b class='bl2bh'></b><b class='bl1h'></b></td></tr></table>";

								document.listproperty_frm.member_id.value = temp[0];
								document.listproperty_frm.loggedin.value = temp[0];
								document.listproperty_frm.m_type.value = temp[17];
								document.listproperty_frm.basicbalance.value = '200';
								document.listproperty_frm.frbalance.value = '200';
								document.listproperty_frm.freemarketfruser.value = '0';
								document.listproperty_frm.freemarketbasicuser.value = '0';

								document.listproperty_frm.contact_name.value = temp[2];
								document.listproperty_frm.contact_email.value = temp[4];
								document.listproperty_frm.mob_country_code.value = Trim(temp[5]);
								document.listproperty_frm.mobile1.value = temp[6];
								if(temp[7] != "" && temp[8] != "")
								{
									document.listproperty_frm.ph_country_code.value = temp[7];
									document.listproperty_frm.contact_mobile2.value = temp[8];
								}
								document.listproperty_frm.ph_area_code.value = temp[9];
								document.listproperty_frm.phone1.value = temp[10];
								if(temp[11] != "" && temp[12] != "")
								{
									document.listproperty_frm.ph_area_code2.value = temp[11];
									document.listproperty_frm.contact_phone2.value = temp[12];
								}
								document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";
								document.getElementById('login-details').innerHTML = 'Listing Details';
								document.getElementById('cityall').style.display = 'none';
								document.getElementById('citycorporate').style.display = 'none';
								document.getElementById('tr_member_cother').style.display = 'none';
								enableFormElement();
								listingblockchange();
								document.getElementById('sfr').innerHTML = 'Fast Response';
								document.getElementById('sbas').innerHTML = 'Basic';
								showhide();

								if(document.listproperty_frm.contact_mobile2.value != '') {
									document.getElementById('addmore1').style.display = 'none';
									document.getElementById('added1').style.display = '';
								} else {
									document.listproperty_frm.ph_country_code.value = '';
								}
								if(document.listproperty_frm.contact_phone2.value != '') {
									document.getElementById('addmore2').style.display = 'none';
									document.getElementById('added2').style.display = '';
								} else {
									document.listproperty_frm.ph_area_code2.value = '';
								}
							}
							else if(currentpage == 'listing')
							{
								//enableFormElement();
								var msg = "<table border = '0' width='95%' cellpadding='0' cellspacing='0' class='staticorangetb'>"
								msg += "<tr style='line-height:20px;'><td width='100%' class = 'columnhead paddingleft20'>";
								msg += "Welcome <b>" + temp[2] + "</b>,</td></tr><tr style='line-height:20px;'	><td class = 'columnhead paddingleft20'>";
								if(mode == "fast")
								{
									if(temp[15] == "0" || temp[16] == "0") {
										msg += "Balance Fast Response Listing(s) are <b>" + temp[1] + "</b>";
									} else {
										// Free Marker User with FR
										msg += "Balance Fast Response Listing(s) is " + temp[1] + ". You can use it to list property in any cities except  Delhi, Mumbai, Hyderabad, Bangalore, Kolkata and Pune.";
										document.listproperty_frm.city.onchange = function()
										{
											makerequest('/ssi/ajax/display-locations.php?cityid='+this.value,'div_loc');
											check_other_city(this.value,'tr_city_other','tr_location_other');
											showhidelistin(this.value);
										}

									}
								}
								else if(mode == "fastfree")
								{
								msg += "List Fast Response Listing for free*<div class='orange' align='right' style='padding-right:10px;'>* Special offer!&nbsp;&nbsp; This offer is valid only for listing done till midnight of 30th June, 2008&nbsp;&nbsp;</div>";
								}
								else if(temp[15] == "0")
								{
									msg += "Balance Basic Listing(s) are <b>" + temp[13] + "</b>";

									//document.getElementById('span_city').style.display = "none";
									//document.getElementById('span_city2').style.display = "";
								} else {
									msg += "You have <b>Unlimited Basic Listing</b> . You can use them to list property in any cities except  Delhi, Mumbai, Hyderabad, Bangalore, Kolkata and Pune.";
									document.listproperty_frm.city.onchange = function()
									{
										makerequest('/ssi/ajax/display-locations.php?cityid='+this.value,'div_loc');
										check_other_city(this.value,'tr_city_other','tr_location_other');
										showhidelistin(this.value);
									}
								}
								msg += "</td></tr></table>";
								document.listproperty_frm.loginuser.value = temp[0];
								document.listproperty_frm.availListing.value = temp[1];
								document.getElementById('div_login_table').innerHTML = '';
								document.getElementById('div_login_table').innerHTML = msg;
								document.listproperty_frm.contact_name.value = temp[2];
								document.listproperty_frm.contact_email.value = temp[4];
								document.listproperty_frm.mob_country_code.value = temp[5];
								document.listproperty_frm.mobile1.value = temp[6];
								if(temp[7] != "" && temp[8] != "")
								{
									document.listproperty_frm.ph_country_code.value = temp[7];
									document.listproperty_frm.contact_mobile2.value = temp[8];
								}
								document.listproperty_frm.ph_area_code.value = temp[9];
								document.listproperty_frm.phone1.value = temp[10];
								if(temp[11] != "" && temp[12] != "")
								{
									document.listproperty_frm.ph_area_code2.value = temp[11];
									document.listproperty_frm.contact_phone2.value = temp[12];
								}
								document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";

								//document.getElementById('div_msg').innerHTML = '';
								//document.getElementById('div_msg').innerHTML = msg;

								if(mode == "fast")
								{
									if(temp[1] != "0" && temp[1] != '')
									{
										//document.getElementById('div_frame').innerHTML  = '';
										document.getElementById('div_frame').style.display = 'none';
									}
									//var msg = "<br>Welcome " + temp[2] + ", Your available fast response listing balance is " +  temp[1] + "<br>";
								}
								else if(mode != "fastfree")
								{
									if(temp[13] != "0" && temp[13] != '')
									{
										document.getElementById('div_frame').innerHTML  = '';
										document.getElementById('div_frame').style.display = 'none';
									}
									else if(temp[15] == "1")
									{
										document.getElementById('div_frame').style.display = 'none';
									}
									else
									{
										document.getElementById('div_frame').style.display = '';
									}
									//var msg = "<br>Welcome " + temp[2] + ", Your available fast response listing balance is " +  temp[1] + "<br>";
								}
								enableFormElement();
							}
							else if(currentpage == 'requirement')
							{
								if(document.getElementById('div_toplinks'))
								{
									document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href='/makaan-iq/iq.php' class='toplinks' target=_blank>MakaanIQ</a><img src='http://img.makaan.com/images/new.jpg' align='absmiddle' />|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								}
								if(document.getElementById('div_register_tab'))
								{
									document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";
								}
								document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";


								document.getElementById('tr_rl1').style.display = 'none';
								document.getElementById('tr_rl2').style.display = 'none';
								document.getElementById('tr_f1').style.display = '';
								document.getElementById('tr_f2').style.display = '';
								document.requiremant_frm.loginuser.value = temp[0];
								disable_fields();
								document.getElementById('tr_edit').style.display = '';
							}
							else if(currentpage == 'blead')
							{
								window.location="/buyer-leads-plus/manage-leads.php?action=search&creqid="+type;


							}
							else if(currentpage == 'shortlist')
							{
								if (document.getElementById("div_welcome") != null && document.getElementById("div_welcome") != "undefined")
									document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								if (document.getElementById("div_register_tab") != null && document.getElementById("div_register_tab") != "undefined"){
									document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";
								}
								document.getElementById('div_login').innerHTML = '';
								if(show == '1')
								{
									showsms("/search/shortlist.php?show=1",'div_all');
								}
								else if(show == '2')
								{
									showsms("/search/shortlist.php?show=2",'div_all2');
								}
								else if(mobilepage == '1')
								{
									showsms("/search/mobileshortlist.php?pid="+propertyid,'div_'+propertyid);
								}
								else
								{
									showsms("/search/shortlist.php?pid="+propertyid,'div_'+propertyid);
								}
							}
							else if(currentpage == 'homeshortlist')
							{
								document.getElementById('div_all').innerHTML = '';
								showsms("/search/short-list-popup.php?pid="+propertyid,'div_all');
								window.opener.location.reload();
							}
							else if(currentpage == 'shortlistviewpage')
							{
								if (document.getElementById("div_welcome") != null && document.getElementById("div_welcome") != "undefined")
									document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								if (document.getElementById("div_register_tab") != null && document.getElementById("div_register_tab") != "undefined")
									document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;\"><span class=\"menu-mid textnopad\" style='font-size:15px;'><b>My Makaan Account</b> </span></a>";
								document.getElementById('div_login').innerHTML = '';
								if(show == '1')
								{
									showsms("/search/shortlist-propertylisting.php?show=1",'div_all');
								}
								else if(show == '2')
								{
									showsms("/search/shortlist-propertylisting.php?show=2",'div_all2');
								}
								else
								{
									showsms("/search/shortlist-propertylisting.php?pid="+propertyid,'div_'+propertyid);
								}
							}
							else if(currentpage == 'ppc_banner')
							{
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";
								document.getElementById('div_login').innerHTML = '';
								document.getElementById('div_content').innerHTML = "<font class='text'>Welcome <b>" + temp[2] + "</b>&nbsp;&nbsp;</font>";
							}
							else
							{

								document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[2] + "</b>&nbsp;&nbsp;";
								document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";
								document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";
								document.getElementById('div_login').innerHTML = '';
							}
						}
					}
				}
				else
				{

					document.getElementById(objID).innerHTML = 'Processing.....please wait';
				}
			}

			xmlhttp.send(null);
		}
		catch(e)
		{

		}
	}


function ajax_poll(serverPage,objID,quiz)
{
	// This is the function to call with serverPage as the page to dynamically call and objId is the div id
	var obj = document.getElementById(objID);
	try
	{
		xmlhttp.open("GET",serverPage,true);
		xmlhttp.onreadystatechange = function()
		{
		if (xmlhttp.readyState==4)
			{
				obj.innerHTML = xmlhttp.responseText;
			}
			else
			{
				document.getElementById('no_option').innerHTML= '<table width="100%"><tr><td height="20" valign="center" align="center" class="text" style="color:#ff0000;">Processing.....please wait</td></tr></table>';
			}
		}
		xmlhttp.send(null);
		//window.open('/ssi/popup/poll.php?quiz='+quiz,'title','toolbar=0,scrollbars=0,resize=no,width=630,height=450');
	}
	catch(e)
	{
	}
}


function compare_property_ajax(serverPage,objCmpID1, objCmpID2)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var objCmp1 = document.getElementById(objCmpID1);
		var objCmp2 = document.getElementById(objCmpID2);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					objCmp1.innerHTML = xmlhttp.responseText;
					objCmp2.innerHTML = xmlhttp.responseText;
				}
				else
				{
					/*
					document.getElementById(objCmpID1).innerHTML = "Calculating..";
					document.getElementById(objCmpID2).innerHTML = "Calculating..";
					*/
					document.getElementById(objCmpID1).innerHTML = "<img src='"+IMG_SERVER+"/images/compare-button.gif' alt=\"Compare Property\" title=\"Compare Property\" border=\"0\" onmouseover=\"javascript:ajax_showTooltip('<font class=divmsgbold>Compare different properties</font><font class=divmsg><br>Please check atleast two listings that you would like to compare and click on this button.</font>',this);return false;\" onmouseout=\"ajax_hideTooltip();\" />";
					document.getElementById(objCmpID2).innerHTML = "<img src='"+IMG_SERVER+"/images/compare-button.gif' alt=\"Compare Property\" title=\"Compare Property\" border=\"0\" onmouseover=\"javascript:ajax_showTooltip('<font class=divmsgbold>Compare different properties</font><font class=divmsg><br>Please check atleast two listings that you would like to compare and click on this button.</font>',this);return false;\" onmouseout=\"ajax_hideTooltip();\" />";

				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}

	function update_session(checked,id)
	{
		/*
		var serverPage = '/ssi/ajax/add-session.php?pid=' + id + '&status=' + checked;
		xmlhttp.open("GET",serverPage,true);
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState==4)
			{
				document.frm_search.count_id.value =  xmlhttp.responseText;
			}
		}
		xmlhttp.send(null);
		*/

		if(get_cookie('SELECTED_IDS')==null || get_cookie('SELECTED_IDS')=='')
		{
			var temp_array = new Array(1);
			temp_array[0] = id;
		}
		else
		{
			temp_array = get_cookie('SELECTED_IDS').split(',');
			if(checked == true && !temp_array.inArray(id)){
				temp_array.push(id);
			}else if(checked==false){
			//Remove it from the Session, if it is already there
				for(i = 0;i < temp_array.length; i++ )
				{
					if(temp_array[i] == id)
					{
						temp_array.splice(i,1);
						//unset(temp_array[i]);
					}
				}
			}
		}
		set_cookie('SELECTED_IDS', temp_array.join(","));
		count_sel_ids = temp_array.length;
		document.frm_search.count_id.value =  count_sel_ids;
	}

	function update_comparesession(checked,id)
	{
		if(get_cookie('SELECTED_COMP_IDS')==null || get_cookie('SELECTED_COMP_IDS')=='')
		{
			var temp_array = new Array(1);
			temp_array[0] = id;
		}
		else
		{
			temp_array = get_cookie('SELECTED_COMP_IDS').split(',');

			if(checked == true && !temp_array.inArray(id)){
				temp_array.push(id);
			}else if(checked==false){
			//Remove it from the Session, if it is already there
				for(i = 0;i < temp_array.length; i++ )
				{
					if(temp_array[i] == id)
					{
						temp_array.splice(i,1);
						//unset(temp_array[i]);
					}
				}
			}
		}
		set_cookie('SELECTED_COMP_IDS', temp_array.join(","));
		//count_sel_ids = temp_array.length;
	}

	function click_counter(id,page,city)
	{
		var serverPage = '/ssi/popup/clicks-counter.php?case=ppcbanner&id=' + id + '&city=' +city+'&page=' + page;
		xmlhttp.open("GET",serverPage,true);
		xmlhttp.onreadystatechange = function()
		{
			if (xmlhttp.readyState==4)
			{
			}
		}
		xmlhttp.send(null);
	}
	function makeajaxrequesnumber(serverPage,objID)
	{

		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
				}
				else
				{
				//	obj.innerHTML = '<font style="font-size:9px">Loading</font>&nbsp;&nbsp;<img src="images/loading.gif"/>';

				obj.innerHTML ="<table border=0 width='100%'><tr><td valign='top' class='columnhead' width='30%'></td><td   width='1%' ></td><td  width='79%' valign='middle'><font style='font-size:9px'>Processing.....please wait</font></td> </tr></table>";
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}

	function makeajaxrequest_ratingsystem(serverPage,objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
				}
				else
				{
				//	obj.innerHTML = '<font style="font-size:9px">Loading</font>&nbsp;&nbsp;<img src="images/loading.gif"/>';

				obj.innerHTML ="<table border=0 height='100%' width='100%'><tr><td valign='middle' align='center'> <img src='http://img.makaan.com/images/submit_process2.gif'></td></tr></table>";
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}


	function makeajaxrequest_homepagelocality(serverPage,objID)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					obj.innerHTML = xmlhttp.responseText;
					if(screen.width=="800") {

						var cla = 'hrefhomelinks';
						var myclass = new RegExp('\\b'+cla+'\\b');
						var elem = document.getElementsByTagName('*');
						for (var i = 0; i < elem.length; i++) {
							var classes = elem[i].className;
							if (myclass.test(classes)) {
								elem[i].className='smallhrefhomelinks cursor';
							}
						}
					}

				}
				else
				{
				//	obj.innerHTML = '<font style="font-size:9px">Loading</font>&nbsp;&nbsp;<img src="images/loading.gif"/>';
					obj.innerHTML ="<table border=0 height='50' width='100%'><tr><td valign='middle' align='center'> <img src='http://img.makaan.com/images/loading.gif'></td></tr></table>";
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}


	/**
	 * function purpose : To capture single leads at single click
	 *
	 * @author Mohammad
	 * @param  filename   $param1		serverPage : This is a php file which process and display the result.
	 * @param  div id  $param2			objID : This (div id) is used for display the resultant content.
	 * @return string  getid			getid : This is a table id used for making all div id unique like div_19
	 *
	 * @usage $var_name = function_name($param);
	*/
	function makeajaxrequest_buyerlead(serverPage,objID,getid,newbl)
	{
		if(!newbl) newbl = 0;
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if (xmlhttp.readyState==4)
				{
					message=xmlhttp.responseText;


					var cla = 'dbuyerleadbutton';
					var myclass = new RegExp('\\b'+cla+'\\b');
					var elem = document.getElementsByTagName('*');
					for (var i = 0; i < elem.length; i++) {
						var classes = elem[i].className;
						if (myclass.test(classes)) {
							elem[i].style.display='none';
						}
					}
					var clb = 'buyerleadbutton';
					var myclass = new RegExp('\\b'+clb+'\\b');
					var elem = document.getElementsByTagName('*');
					for (var i = 0; i < elem.length; i++) {
						var classes = elem[i].className;
						if (myclass.test(classes)) {
							elem[i].style.display='';
						}
					}
					document.body.style.cursor='auto';
					if(message=='counterfull')
					{
						message_display('','This lead can not be captured.');
						obj.style.display='none';
						document.getElementById('tr_'+getid).style.display='none';
						//document.getElementById('captureimage_'+getid).innerHTML="<img src='http://img.makaan.com/images/buyer-leads/capture-inact.gif' align='absmiddle' border='0' />";
					}
					else if(message=='nobalance')
					{
						message_display_nobalance('',"You don't have balance to purchase buyer lead(s). Contact your account manager for renewal of services.");
						//obj.style.display='none';

						//obj.style.display='none';
						document.getElementById('tr_'+getid).style.display='none';
					}
					else if(message=='alreadytaken')
					{
						message_display('','You have already captured this lead.');
						//obj.style.display='none';
						document.getElementById('tr_'+getid).style.display='none';
						//document.getElementById('captureimage_'+getid).innerHTML="<img src='http://img.makaan.com/images/buyer-leads/capture-inact.gif' align='absmiddle' border='0' />";
					}
					else
					{
						obj.style.display='';
						array_string=Array();
						array_string=message.split('|#|');
						var mybalancelead = '';
						var mytotcapturelead = '';

						if(array_string[0]=='' || array_string[0]=='NA')
							leadctr=0;
						else if(array_string[0] != undefined)
							leadctr=array_string[0];

						if(array_string[1]=='' || array_string[1]=='NA')
							mybalancelead=0;
						else if(array_string[1] != undefined)
							mybalancelead=array_string[1];

						if(array_string[2]=='' || array_string[2]=='NA')
							mytotcapturelead=0;
						else if(array_string[2] != undefined)
							mytotcapturelead=array_string[2];

						//document.getElementById('div_leadctr_'+getid).innerHTML=leadctr+"/"+total_cnt;
						if(newbl != 0 && mybalancelead != '')
						{
							if(document.getElementById('newpleads'))
								document.getElementById('newpleads').innerHTML = parseInt(document.getElementById('newpleads').innerHTML)+1;
						}
						else if(mybalancelead != '') {
							document.getElementById('balancelead').innerHTML=mybalancelead;
							if(document.getElementById('newleads'))
								document.getElementById('newleads').innerHTML = parseInt(document.getElementById('newleads').innerHTML)+1;
						}

						if(newbl != 0 && mytotcapturelead != '')
						{
							document.getElementById('totcaptureplead').innerHTML="(" + mytotcapturelead;
						}
						else if(mytotcapturelead != '') {
							document.getElementById('totcapturelead').innerHTML="("+mytotcapturelead+")";
						}
						document.getElementById('captureimage_'+getid).style.backgroundImage="url('http://img.makaan.com/images/buyer-leads/capture-inact.gif')";


						htmlcontent='';
						htmlcontent_text='';
						htmlcontent="<center><table width='99%' class='text' cellpadding='0' cellspacing='2' border='0'><tr>";

						htmlcontent+="<td width='17%' align='right'>Contact Details</td> <td width='1%' align='center'>:</td><td width='82%'>";

						var saparator='';

						if(array_string[3]!='NA' && array_string[3]!=undefined)
						{
							htmlcontent_text+="<b>"+array_string[3]+"</b>";
							saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
						}

						if(array_string[4]!='NA' && array_string[4]!=undefined)
						{
							htmlcontent_text+=saparator+"<b>"+array_string[4]+"</b>";
							saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
						}

						if(array_string[5]!='NA' && array_string[5]!=undefined)
						{
							htmlcontent_text+=saparator+"<b>"+array_string[5]+"</b>";
							saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
						}

						if(array_string[6]!='NA' && array_string[6]!=undefined)
						{
							htmlcontent_text+=saparator+"<b>"+array_string[6]+"</b>";
							saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
						}
						htmlcontent+=htmlcontent_text;
						htmlcontent+="</td>";
						htmlcontent+="</tr> </table></center>";

						if(htmlcontent_text!='')
						{
							obj.innerHTML=htmlcontent;
						}
						else
						{
							obj.innerHTML="<center><table width='99%' class='text' cellpadding='0' cellspacing='2' border='0'><tr><td align='center'><b>This lead could not be captured at this moment. Please try again later.</b></td></tr> </table></center>";
						}

						if(newbl == 0) {
							document.getElementById('captureimage_'+getid).innerHTML="<span style='color:#000000;'>&nbsp;Capture&nbsp;"+leadctr+"/"+total_cnt+"</span>";
						}
						else
						{
							document.getElementById('captureimage_'+getid).innerHTML = "<span style='color:#000000;'>&nbsp;Capture&nbsp;</span>";
						}

						formObj = eval('document.frm');
						for (var i=1;i < formObj.length;i++)
						{
							fldObj = formObj.elements[i];
							if (fldObj.type=='checkbox')
							{
								if(fldObj.value==getid)
								{
									fldObj.disabled=true;
								}
							}
						}

						message_success='';
						if(htmlcontent_text!='') {
							message_success="You have successfully captured 1 lead(s). Buyer details have been displayed in green background.";

							message_display_smily('',message_success);
						}
					}
				}
				else
				{
					obj.innerHTML ="<table border=0 align='center' cellpadding='0' cellspacing='0' width='80%'><tr><td align='center' valign='middle' class='text'><img src='http://img.makaan.com/images/buyer-leads/buyer-process.gif'></td></tr></table>";
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}

	/**
	 * function purpose : To capture all the leads in single click
	 *
	 * @author Mohammad
	 * @param  filename   $param1		serverPage : This is a php file which process and display the result.
	 * @param  div id  $param2			objID : This (div id) is used for display the resultant content.
	 * @return string  getid			getid : This is a table id used for making all div id unique like div_19
	 *
	 * @usage $var_name = function_name($param);
	*/
	function makeajaxrequest_buyerlead_all(serverPage,objID,getid, newbl)
	{
		if(!newbl) newbl = 0;
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		formObj = eval('document.frm');
		var alreadytaken_allmessage='';
		var counter_allmessage='';
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if(xmlhttp.readyState==4)
				{
					allmessage=xmlhttp.responseText;
					//alert(allmessage);

					array_string_all=Array();
					array_string_all=allmessage.split('|$|');
					array_string_alllength=0;
					array_string_alllength=array_string_all.length;
					//alert(array_string_alllength);

					array_regid=Array();
					array_regid=getid.split(",");
					getlength=array_regid.length;

					var cla = 'dbuyerleadbutton';
					var myclass = new RegExp('\\b'+cla+'\\b');
					var elem = document.getElementsByTagName('*');
					for (var i = 0; i < elem.length; i++) {
						var classes = elem[i].className;
						if (myclass.test(classes)) {
							elem[i].style.display='none';
						}
					}
					var clb = 'buyerleadbutton';
					var myclass = new RegExp('\\b'+clb+'\\b');
					var elem = document.getElementsByTagName('*');
					for (var i = 0; i < elem.length; i++) {
						var classes = elem[i].className;
						if (myclass.test(classes)) {
							elem[i].style.display='';
						}
					}
					document.body.style.cursor='auto';

					if(allmessage=='nobalance')
					{
						message_display_nobalance('',"You don't have balance to purchase buyer lead(s). Contact your account manager for renewal of services.");
						obj.style.display='none';

						return false;
					}
					else
					{
						mycounter=0;
						//alert(array_string_all);
						for(var x=1;x<array_string_alllength;x++)
						{
							message='';
							message=array_string_all[x];
							getidindex=x-1;
							//alert("MESSAGE="+message);
							if(message=='counterfull')
							{
								counter_allmessage="This lead can not be captured.";
								//obj.style.display='none';
								//alert('counterfull');

								//document.getElementById('tr_'+array_regid[getidindex]).style.display='none';
								//document.getElementById('captureimage_'+array_regid[getidindex]).innerHTML="<img src='http://img.makaan.com/images/buyer-leads/capture-inact.gif' align='absmiddle' border='0' />";
							}
							else if(message=='alreadytaken')
							{
								alreadytaken_allmessage="You have already captured this lead(s).";
								//obj.style.display='none';
								//alert('alreadytaken');
								//document.getElementById('tr_'+array_regid[getidindex]).style.display='none';
								//document.getElementById('captureimage_'+array_regid[getidindex]).innerHTML="<img src='http://img.makaan.com/images/buyer-leads/capture-inact.gif' align='absmiddle' border='0' />";
							}
							else
							{
								//alert(message);
								obj.style.display='none';
								array_string=Array();
								array_string=message.split('|#|');
								array_string_length=array_string.length;
								//alert('ARRAYlen='+array_string_length);
								//alert("NEWVAL="+array_string[5]);
								get_divid='';
								get_divid=array_string[5];

								//alert(get_divid);

								document.getElementById('tr_'+get_divid).style.display='';
								//alert(array_string[0]);


								if(array_string[0]=='' || array_string[0]=='NA')
									leadctr=0;
								else
									leadctr=array_string[0];

								//document.getElementById('div_leadctr_'+get_divid).innerHTML=leadctr+"/"+total_cnt;
								document.getElementById('captureimage_'+get_divid).style.backgroundImage="url('http://img.makaan.com/images/buyer-leads/capture-inact.gif')";

								htmlcontent='';
								htmlcontent_text='';
								htmlcontent="<center><table width='99%' class='text' cellpadding='0' cellspacing='2' border='0'><tr>";

								htmlcontent+="<td width='17%' align='right'>Contact Details</td> <td width='1%' align='center'>:</td><td width='82%'>";
								var saparator='';

								if(array_string[1]!='NA' && array_string[1]!=undefined)
								{
									htmlcontent_text+="<b>"+array_string[1]+"</b>";
									saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
								}

								if(array_string[2]!='NA' && array_string[2]!=undefined)
								{
									htmlcontent_text+=saparator+"<b> "+array_string[2]+"</b>";
									saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
								}

								if(array_string[3]!='NA' && array_string[3]!=undefined)
								{
									htmlcontent_text+=saparator+"<b> "+array_string[3]+"</b>";
									saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
								}

								if(array_string[4]!='NA' && array_string[4]!=undefined)
								{
									htmlcontent_text+=saparator+"<b> "+array_string[4]+"</b>";
									saparator='&nbsp;&nbsp;|&nbsp;&nbsp;  ';
								}

								htmlcontent+=htmlcontent_text;

								htmlcontent+="</td>";
								htmlcontent+="</tr> </table></center>";

								//alert(htmlcontent);
								if(htmlcontent_text!='')
								{
									document.getElementById('div_'+get_divid).innerHTML=htmlcontent;
								}
								else
								{
									document.getElementById('div_'+get_divid).innerHTML="<center><table width='99%' class='text' cellpadding='0' cellspacing='2' border='0'><tr><td align='center'><b>This lead could not be captured at this moment. Please try again later.</b></td></tr> </table></center>";
								}

								if(newbl == 0) {
									document.getElementById('captureimage_'+get_divid).innerHTML="<span style='color:#000000;'>&nbsp;Capture&nbsp;"+leadctr+"/"+total_cnt+"</span>";
								}
								else
								{
									document.getElementById('captureimage_'+get_divid).innerHTML = "<span style='color:#000000;'>&nbsp;Capture&nbsp;</span>";
								}

								//formObj = eval('document.frm');
								for (var i=1;i < formObj.length;i++)
								{
									fldObj = formObj.elements[i];
									//alert(fldObj.name);
									if (fldObj.type=='checkbox' && fldObj.name=='id[]')
									{
										if(fldObj.value==get_divid)
										{
											fldObj.disabled=true;
										}
									}
								}
								mycounter++;
							}
						}
					}
					cal_array=array_string_all[0];
					array_string_leftpanel=cal_array.split('|#|');
					var mybalancelead = '';
					var mytotcapturelead = '';
					//alert("mytotcapturelead="+array_string_leftpanel[0]);
					//alert("mybalancelead="+array_string_leftpanel[1]);
					if(array_string_leftpanel[1]=='' || array_string_leftpanel[1]=='NA')
						mybalancelead=0;
					else if(array_string_leftpanel[1]!=undefined)
						mybalancelead=array_string_leftpanel[1];

					if(array_string_leftpanel[0]=='' || array_string_leftpanel[0]=='NA')
						mytotcapturelead=0;
					else if(array_string_leftpanel[0]!=undefined)
						mytotcapturelead=array_string_leftpanel[0];

					if(newbl != 0 && mybalancelead != '')
					{
						//document.getElementById('balanceplead').innerHTML=mybalancelead;
						if(document.getElementById('newpleads'))
							document.getElementById('newpleads').innerHTML = parseInt(document.getElementById('newpleads').innerHTML)+mycounter;
					}
					else if(mybalancelead != '') {
						if(document.getElementById('balancelead'))
							document.getElementById('balancelead').innerHTML=mybalancelead;
						if(document.getElementById('newleads'))
							document.getElementById('newleads').innerHTML = parseInt(document.getElementById('newleads').innerHTML)+mycounter;
					}

					if(newbl != 0 && mytotcapturelead != '')
					{
						if(document.getElementById('totcaptureplead'))
							document.getElementById('totcaptureplead').innerHTML="(" + mytotcapturelead;
					}
					else if(mytotcapturelead != '') {
						if(document.getElementById('totcapturelead'))
							document.getElementById('totcapturelead').innerHTML="("+mytotcapturelead+")";
					}



					message_success='';
					message_success="You have successfully captured "+mycounter+" lead(s). Buyer details have been displayed in green background.";

					if(alreadytaken_allmessage!='')
						message_display('',alreadytaken_allmessage);
					else if(counter_allmessage!='')
						message_display('',counter_allmessage);
					else if(htmlcontent_text!='')
						message_display_smily('',message_success);
				}
				else
				{
					obj.innerHTML ="<table border=0 align='center' cellpadding='0' cellspacing='0' width='80%'><tr><td align='center' valign='middle' class='text'><img src='http://img.makaan.com/images/buyer-leads/buyer-process.gif'></td></tr></table>";
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}

	/**
	 * function purpose : If amount is not available then popup a message
	 *
	 * @author Mohammad
	 * @param  filename   $param1		serverPage : This is a php file which process and display the result.
	 * @param  div id  $param2			objID : This (div id) is used for display the resultant content.
	 * @return string  getid			getid : This is a table id used for making all div id unique like div_19
	 *
	 * @usage $var_name = function_name($param);
	*/
	function makeajaxrequest_buyerlead_nobalance(serverPage,objID,getid)
	{
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		if(document.getElementById(objID))
			var obj = document.getElementById(objID);
		else
			var obj ='';
		formObj = eval('document.frm');
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
				if(xmlhttp.readyState==4)
				{
					if(obj)
						obj.style.display='none';
					if(document.getElementById(objID))
						document.getElementById(objID).style.display='none';
					allmessage=xmlhttp.responseText;
					//message_display_nobalance_close();

					var cla = 'dbuyerleadbutton';
					var myclass = new RegExp('\\b'+cla+'\\b');
					var elem = document.getElementsByTagName('*');
					for (var i = 0; i < elem.length; i++) {
						var classes = elem[i].className;
						if (myclass.test(classes)) {
							elem[i].style.display='none';
						}
					}
					var clb = 'buyerleadbutton';
					var myclass = new RegExp('\\b'+clb+'\\b');
					var elem = document.getElementsByTagName('*');
					for (var i = 0; i < elem.length; i++) {
						var classes = elem[i].className;
						if (myclass.test(classes)) {
							elem[i].style.display='';
						}
					}
				}
				else
				{
					if(obj)
						obj.innerHTML ="<table border=0 align='center' cellpadding='0' cellspacing='0' width='80%'><tr><td align='center' valign='middle' class='text'><img src='http://img.makaan.com/images/buyer-leads/buyer-leads2.gif'></td></tr></table>";
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}


	function make_getalert_request(serverPage, objID)
	{
		var local_xmlhttp = false;
		try {
			local_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				local_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				local_xmlhttp = false;
			}
		}
		if (!local_xmlhttp && typeof XMLHttpRequest != 'undefined') {
			local_xmlhttp = new XMLHttpRequest();
		}

		Array.prototype.inArray = function (value)
		{
			var i;
			for (i=0; i < this.length; i++) {
				if (this[i] === value) {
					return true;
				}
			}
			return false;
		};

		var obj = document.getElementById(objID);
		try
		{
			local_xmlhttp.open("GET", serverPage,true);
			local_xmlhttp.onreadystatechange = function()
			{
				if (local_xmlhttp.readyState==4)
				{
					var text = local_xmlhttp.responseText.substr(0,(local_xmlhttp.responseText.length-1));
					if(text == '')
						text = '&nbsp;';
					obj.innerHTML = text;
					mystr = local_xmlhttp.responseText.substr(0,(local_xmlhttp.responseText.length-1));
					var thelength=local_xmlhttp.responseText.length;
					var last_char=local_xmlhttp.responseText.charAt(thelength-1);
					if(eval('last_char')==0)
					{
						return false;
					}
					else
					{
						return true;
					}
				}
				else
				{
					document.getElementById(objID).innerHTML = '<table width="100%"><tr><td height="10" valign="center" align="center" class="text" style="color:000000;"><font style="font-size:9px">Loading</font>&nbsp;&nbsp;<input type="image" name="imageField" src="'+IMG_SERVER+'/images/loading.gif"/></td></tr></table>';
				}
			}
			local_xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}


	function make_getalert_mobilecheck(serverPage, objID)
	{
		var local_xmlhttp = false;
		try {
			local_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				local_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				local_xmlhttp = false;
			}
		}
		if (!local_xmlhttp && typeof XMLHttpRequest != 'undefined') {
			local_xmlhttp = new XMLHttpRequest();
		}

		Array.prototype.inArray = function (value)
		{
			var i;
			for (i=0; i < this.length; i++) {
				if (this[i] === value) {
					return true;
				}
			}
			return false;
		};

		var obj = document.getElementById(objID);
		try
		{
			local_xmlhttp.open("GET", serverPage,true);
			local_xmlhttp.onreadystatechange = function()
			{
				if (local_xmlhttp.readyState==4)
				{
					var text = local_xmlhttp.responseText;
					if(text == '')
						text = '&nbsp;';
					if(text==1)
					{
						obj.innerHTML = "";
						document.getElementById('div_mobileerr').style.display='';
						document.getElementById('div_msg2').style.display='none';
					}
					else
					{
						obj.innerHTML = "&nbsp;";
						document.getElementById('div_msg2').style.display='';
						document.getElementById('div_mobileerr').style.display='none';
						//new_getalert_form();
					}

				}
				else
				{
					document.getElementById(objID).innerHTML = '<table width="100%"><tr><td height="10" valign="center" align="center" class="text" style="color:000000;"><font style="font-size:9px">Loading</font>&nbsp;&nbsp;<input type="image" name="imageField" src="'+IMG_SERVER+'/images/loading.gif"/></td></tr></table>';
				}
			}
			local_xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}



	function getalert_makeajax_postrequest(serverPage,objID,getstring)
	{
		var local_xmlhttp = false;
		try {
			local_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				local_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				local_xmlhttp = false;
			}
		}
		if (!local_xmlhttp && typeof XMLHttpRequest != 'undefined') {
			local_xmlhttp = new XMLHttpRequest();
		}

		Array.prototype.inArray = function (value)
		{
			var i;
			for (i=0; i < this.length; i++) {
				if (this[i] === value) {
					return true;
				}
			}
			return false;
		};

		//alert('successfullcall');
		//alert(getstring);
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("POST",serverPage+'?'+getstring,true);
			xmlhttp.onreadystatechange = function()
			{
			if (xmlhttp.readyState==4)
				{
					var getmessage='';
					getmessage = xmlhttp.responseText;
					/*-------------------------*/
					var temp = new Array();
					temp = getmessage.split('##$$##');

					output = temp[0].substr(temp[0].length-4,temp[0].length);
					if(output=='DONE')
					{
						obj.innerHTML=temp[0].substr(0,temp[0].length-4);

						if(document.getElementById('div_welcome'))
							document.getElementById('div_welcome').innerHTML = "Hi <b>" + temp[1] + "</b>&nbsp;&nbsp;";

						if(document.getElementById('div_toplinks'))
							document.getElementById('div_toplinks').innerHTML = "<a href=\"/\" class=\"toplinks\" >Home</a>&nbsp;|&nbsp;<a href=\"/help/about-us.php\" class=\"toplinks\" >About Us</a>&nbsp;|&nbsp;<a href=\"/help/faq.php\" class=\"toplinks\" >FAQ's</a>&nbsp;|&nbsp;<a href=\"/help/contact-us.php\" class=\"toplinks\" >Contact Us</a>&nbsp;|&nbsp;<a href=\"/member/logout.php\" class=\"toplinks\" >Logout</a>";

						if(document.getElementById('div_register_tab'))
							document.getElementById('div_register_tab').innerHTML = "<a href=\"/member/my-makaan-account.php\" class=\"hrefheader\" style=\"color:#000;font-size:13px;text-decoration:none;\"><span class=\"menu-left\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-left\"></span><span class=\"menu-mid textnopad\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-mid\"><b><span class=\"tabtext\">My Makaan Account</span></b> </span><span class=\"menu-right\" onmouseover=\"changetab('reg', true);\" onmouseout=\"changetab('reg', false);\" id=\"menu-reg-right\"></span></a>";

						if(document.getElementById('div_msg'))
							document.getElementById('div_msg').innerHTML = '';

						if(document.getElementById('div_msg2'))
							document.getElementById('div_msg2').innerHTML = '';

						//tb_remove();
					}/*-------------------------*/
					else
					{
						output = getmessage.substr(getmessage.length-1,getmessage.length);
						//alert(output);
						//alert(obj);
						if(eval(output)=='0' || eval(output)==0)
						{
							//alert(getmessage.substr(0,getmessage.length-1));
							document.getElementById('div_msg2').innerHTML = '';
							document.getElementById('div_msg2').innerHTML = getmessage.substr(0,getmessage.length-1);
						}
						else
						{
							//alert('go');
							document.getElementById('div_msg2').innerHTML=getmessage;
						}
					}
				}
				else
				{
					document.getElementById('div_msg2').innerHTML = '<table width="100%" height="20"><tr><td valign="middle" align="center" class="text" style="color:000000;height:100%;"><img src="'+IMG_SERVER+'/images/loading.gif"/></td></tr></table>';
				}
			}
			xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}

	function buyerleadrequest(serverPage,objID)
	{
		var local_xmlhttp = false;
		try {
			local_xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
		} catch (e) {
			try {
				local_xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
			} catch (E) {
				local_xmlhttp = false;
			}
		}
		if (!local_xmlhttp && typeof XMLHttpRequest != 'undefined') {
			local_xmlhttp = new XMLHttpRequest();
		}

		Array.prototype.inArray = function (value)
		{
			var i;
			for (i=0; i < this.length; i++) {
				if (this[i] === value) {
					return true;
				}
			}
			return false;
		};
		// This is the function to call with serverPage as the page to dynamically call and objId is the div id
		var obj = document.getElementById(objID);
		//alert(serverPage);
		try
		{
			local_xmlhttp.open("GET",serverPage,true);
			local_xmlhttp.onreadystatechange = function()
			{
				if(local_xmlhttp.readyState==4)
				{
					getmessage = local_xmlhttp.responseText;
					obj.innerHTML=getmessage;
				}
				else
				{
					obj.innerHTML = '<table width="100%" height="200"><tr><td valign="middle" align="center" class="text" style="color:000000;height:100%;"><img src="'+IMG_SERVER+'/images/broker-search/loadingfile.gif"/></td></tr></table>';
				}
			}
			local_xmlhttp.send(null);
		}
		catch(e)
		{
		}
	}
