<!--
	//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();
	}

	// 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;
					
					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(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="/images/loading.gif"/></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 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="/images/loading.gif"/></td></tr></table>';
				}
			}
			xmlhttp.send(null);
		}
		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
		//alert(serverPage);
		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 = '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
		//alert(objID);
		var obj = document.getElementById(objID);
		try
		{
			xmlhttp.open("GET",serverPage,true);
			xmlhttp.onreadystatechange = function()
			{
			if (xmlhttp.readyState==4)
				{
					//alert(xmlhttp.responseText);
					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)
	{
		// 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';
		}
		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);
					//alert(obj.innerHTML)
					if(eval(last_char)==0)
					{
						obj.innerHTML = mystr;
					}
					else
					{
						var b = xmlhttp.responseText;
						var temp = new Array();
						temp = b.split('#');
						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") 
							{
							msg += "Balance Fast Response Listing(s) are <b>" + temp[1] + "</b>"; 
							}
							else
							{
							msg += "Balance Basic Listing(s) are <b>Unlimited*</b><div class='orange' align='right'>* Limited time offer&nbsp;&nbsp;</div>"; 
							}
							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 = "Welcome <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\"><img src=\"/images/nav_02.gif\" alt=\"My Makaan Account\" border=\"0\" /></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(currentpage == 'requirement')
						{
							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'>";
							msg += "Please fill in this form to post your requirement"; 
							msg += "</td></tr></table>";
							document.requiremant_frm.loginuser.value = temp[0];
							document.getElementById('div_login_table').innerHTML = '';
							document.getElementById('div_login_table').innerHTML = msg;
							document.getElementById('div_login_table').style.display = 'none';
							document.requiremant_frm.contact_name.value = temp[2];
							document.requiremant_frm.contact_email.value = temp[4];
							document.requiremant_frm.mob_country_code.value = temp[5];
							document.requiremant_frm.mobile1.value = temp[6];
							if(temp[7] != "" && temp[8] != "")
							{
								document.requiremant_frm.ph_country_code.value = temp[7];
								document.requiremant_frm.contact_mobile2.value = temp[8];
							}
							document.requiremant_frm.ph_area_code.value = temp[9];
							document.requiremant_frm.phone1.value = temp[10];
							if(temp[11] != "" && temp[12] != "")
							{
								document.requiremant_frm.ph_area_code2.value = temp[11];
								document.requiremant_frm.contact_phone2.value = temp[12];
							}
							document.getElementById('div_welcome').innerHTML = "Welcome <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\"><img src=\"/images/nav_02.gif\" alt=\"My Makaan Account\" border=\"0\" /></a>";
						}
						else if(currentpage == 'shortlist')
						{
							if (document.getElementById("div_welcome") != null && document.getElementById("div_welcome") != "undefined")
								document.getElementById('div_welcome').innerHTML = "Welcome <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\"><img src=\"/images/nav_02.gif\" alt=\"My Makaan Account\" border=\"0\" /></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
							{
								showsms("/search/shortlist.php?pid="+propertyid,'div_'+propertyid);
							}
						}
						else if(currentpage == 'shortlistviewpage')
						{
							if (document.getElementById("div_welcome") != null && document.getElementById("div_welcome") != "undefined")
								document.getElementById('div_welcome').innerHTML = "Welcome <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\"><img src=\"/images/nav_02.gif\" alt=\"My Makaan Account\" border=\"0\" /></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\"><img src=\"/images/nav_02.gif\" alt=\"My Makaan Account\" border=\"0\" /></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 = "Welcome <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\"><img src=\"/images/nav_02.gif\" alt=\"My Makaan Account\" border=\"0\" /></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=\"/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=\"/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);
	}

	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);
	}