function ajx()
{
	var el;
	var txt_arr;
	var find_div = '';
	var hide_div = 1; // whether to hide or not hide dive that has no data
	var el_type;
	var pid = 0;
	var sno = 0;
	var debug = 0;
	var page = 'home';
	var timerplay = 0;
	var heading = 'temp_page';
	var stat = 'Play';
	var img_path = 'http://www.makaan.com/images/property/small/';
	var div_center_start = '<table width="100%" height="100%" align="center" ><tr valign="middle"><td width="100%"   height="100%" valign="middle" align="center"  style="padding-left:5px; padding-right:3px;">';
	var div_center_end = '</td></tr></table>';

	this.add_element = function(el){
		this.el =  el;
		return ;
	};

	this.remove_element = function(){
		this.el =  null;
		return ;
	};

	this.debug_on = function(){
		this.debug = 1;
	};

	this.debug_off = function(){
		this.debug = 0;
	};

	this.set_imgpath = function(path){
		this.img_path = path;
		return;
	};

	this.set_stat = function(stat){
		this.stat = stat;
		return;
	};

	this.set_hide_div = function(v){
		this.hide_div = v;
		return;
	}

	this.add_type = function(type){
		this.el_type = type;
		return;
	};

	this.remove_type = function(){
		this.el_type = null;
		return;
	};

	this.set_find_div = function(id){
		this.find_div = id;
		return;
	}

	this.get_div_center_start= function(){
		return div_center_start;
	}
	
	this.get_div_center_end= function(){
		return div_center_end;
	}
	this.ajaxRead = function(file)
	{
		this.fl = file; 
		this.show_error(" link :: "+file);
		var xmlObj = null;
		if(window.XMLHttpRequest)
		{
			xmlObj = new XMLHttpRequest();
		} 
		else if(window.ActiveXObject)
		{
			xmlObj = new ActiveXObject("Microsoft.XMLHTTP");
		}
		else
		{
			return;
		}
		xmlObj.onreadystatechange = function()
		{
			if(xmlObj.readyState == 4)
			{
				ajx.processXML(xmlObj.responseXML);
				ajx.show_error(" text received : "+xmlObj.responseText);
			}
		}
		xmlObj.open ('POST', file, true);
		xmlObj.send ('');
	};
	this.processXML = function(obj)
	{
		
		if(!obj)
		{
			if(this.$(this.el))
			this.$(this.el).innerHTML = '';
			return null;
		};
		
		var insertData='';
		objArray = obj.getElementsByTagName('data')[0];
		this.show_error(" Element registered : "+this.el_type);
		if(objArray == null)
		{
			return;
		}
		if(!this.el || this.el == (''|| null ) || this.el_type == ('' || null) || !this.$(this.el))
			return;
		
		subArray = objArray.getElementsByTagName(this.el_type);
		this.show_error(" sub array : " + subArray);
		
		switch(this.el_type)
		{
			case 'listing':
				//var total = objArray.getElementsByTagName('num')[0].firstChild.data;	
				this.timerplay = setInterval('playslide()',5000);
				if(this.page == 'home')
					var tmp_html = this.load_property('0');
				else
					var tmp_html = this.load_property_msn('0');
				this.show_error(" Html : " + subArray.length);
			break;
			default:
			break;
		}
	};

	this.$ = function(id){
		if(!id)
		return null;
		if(document.getElementById(id)){
			var tmp = document.getElementById(id);
			return tmp;
		}
		return false;
	};

	this.echo = function(vl){
		alert(vl);
		return true;
	};

	this.show_error = function(vl){
		if(this.debug)
			alert(vl);
		return true;
	};
	this.chr_replace = function(str){
		str = str.replace('#040;','\'');
		str = str.replace('#039;','&');
		return str;
	};
this.load_property_msn = function(sno)
{
	var total = '20';
	var tmp_st = "";
	//this.sno = this.sno+1;
	//var sno = this.sno;
	var alink = '<a href="/property/view-property-detail.php?ptnr=mkch2&pid='+subArray[sno].getAttribute('pid')+'" target="_blank" class="hreftemplate">';
	//var alink = '';
	tmp_st += '<table cellspacing="0" cellpadding="0" border="0" width="100%"><tr><td width="22%" id="listing" class="blockhead"><h5 class="white"><img src="/images/smallblackarrow.gif" />&nbsp;Most Recent Listings </h5></td><td width="78%" id="listing" align="right"><table width="100%" border="0" align="right" cellpadding="0" cellspacing="0" ><tr><td><div class="clspagination" id="paginate-property_slider">'; 
	for(var t = 0; t < total; t++)
	{
		if(parseInt(t) == parseInt(sno))
			tmp_st += '<a href="#" style="text-align:right;color:000000;font-size:12px;background-color:#ffffff;" class="cursor" onclick="ajx.sno='+t+';ajx.load_property_msn(\''+t+'\');stopslide();return false;">'+(t+1)+'</a>';
		else
			tmp_st += '<a href="#" style="text-align:right;color:000000;font-size:12px;" class="cursor" onclick="ajx.sno='+t+';ajx.load_property_msn(\''+t+'\');stopslide();return false;">'+(t+1)+'</a>';
	}
	tmp_st += '</td><td align="right" width="5%"><div id="playcontrol" align="center">';
	if(this.stat == 'Play')
		tmp_st += '<a onClick="changestat();" class="cursor"><img id = "play_img" src="/images/pause.gif" border="0" alt="Pause" align="absmiddle"></a>';
	else
		tmp_st += '<a onClick="changestat();" class="cursor"><img id = "play_img" src="/images/play.gif" border="0" alt="Play" align="absmiddle"></a>';
	
	tmp_st += '&nbsp;</div></td></tr></table></td></tr></table>'; 
//alert(tmp_st);
	tmp_html = '<table width="700" border="0" cellspacing="0" cellpadding="0"><tr><td style="line-height:6px;">&nbsp;</td></tr>';
	tmp_html += '<tr><td ><table width="100%" border="0" cellspacing="2" cellpadding="0" style="font-size: 10px;border:1px solid #F6C472;"><tr>';
	tmp_html += '<td width="31%" bgcolor="#FFEBC9" class="columnheadsearchresults" valign="top">Location</td><td width="21%" bgcolor="#FFEBC9" class="columnheadsearchresults">Specification  </td><td width="18%" bgcolor="#FFEBC9" class="columnheadsearchresults">Price</td><td width="30%" bgcolor="#FFEBC9" class="columnheadsearchresults">Contact</td>';
	tmp_html += '</tr></table></td></tr><tr><td colspan="4" class="lineheight"></td></tr>';
	
	tmp_html += '<tr><td colspan="4" valign="top">';
	tmp_html += '<table width="100%" border="0" cellpadding="0" cellspacing="0" class="listingTbl" height="160"><tr><td valign="top" bgcolor="#FFFFFF">';
	tmp_html += '<table width="100%" border="0" cellpadding="1" cellspacing="0" class="tborderblue" height="175" bgcolor="#E7F5Fa" onmouseover="style.background=\'#D5EBF5\';" onmouseout="style.background=\'#E7F5FA\';">';
	tmp_html += '<tr><td colspan="5" bgcolor="#D5EBF5" style="line-height:4px">&nbsp;</td></tr>';
	tmp_html += '<tr><td width="2%" align="left" valign="top" class="normaltext"><input name="checkbox[]" id="checkbox[]" type="checkbox" /></td>';
	tmp_html += '<td width="29%" valign="top" class="normaltext"><table width="99%" border="0" cellspacing="0" cellpadding="0" class="normaltext" height="175">';
	
	tmp_html += '<tr><td width="100%" align="left" valign="top">'+alink+'<font class="brown">'+unescape(this.chr_replace(subArray[sno].getAttribute('title')))+ subArray[sno].getAttribute('property_for') +'</a></font><br>';
	if(subArray[sno].getAttribute('property_address') != ""){
		tmp_html += alink + unescape(this.chr_replace(subArray[sno].getAttribute('property_address'))) + '</a><br>';
	}
	tmp_html += alink + unescape(this.chr_replace(subArray[sno].getAttribute('location'))) +' '+ unescape(this.chr_replace(subArray[sno].getAttribute('city'))) +'</a></td></tr>';
	tmp_html += '<tr><td width="100%" align="center" ><table width="99%" height="100%" cellpadding="0" cellspacing="0" ><tr><td width="58%" align="center">';
	
	tmp_html += '<div align="left" valign="bottom">';
	
	if(subArray[sno].getAttribute('image') != ""){
		tmp_html += alink + '<img border="0" src="http://www.makaan.com/images/property/small/'+subArray[sno].getAttribute('image')+'" width="'+subArray[sno].getAttribute('pro_width')+'" height="'+subArray[sno].getAttribute('pro_height')+'"></a>';
	}else{
		tmp_html += alink + '<img border="0" src="http://www.makaan.com/images/property/small/image.gif"></a>';
	}
	
	tmp_html += '</div>';
	
	tmp_html += '</td></tr></table></td></tr></table></td>';

	tmp_html += '<td width="21%" valign="top"><table width="100%" border="0" cellspacing="0" cellpadding="0" class="normaltext" height="175">';
	tmp_html += '<tr><td width="100%" align="left" valign="top">'+alink+'Area '+subArray[sno].getAttribute('area')+' ' +subArray[sno].getAttribute('area_unit')+ '</a><br>';
	if(subArray[sno].getAttribute('area_in_sqfeet') != ""){
		tmp_html += '&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;'+alink+'[' + subArray[sno].getAttribute('area_in_sqfeet') + ']</a><br><br>';
	}else{
		tmp_html += '<br><br>';
	}
	if(subArray[sno].getAttribute('bedrooms') != ""){
		tmp_html += alink + subArray[sno].getAttribute('bedrooms') + '</a></td></tr>';
	}else{
		tmp_html += '<br></td></tr>';
	}
	tmp_html += '<tr><td width="100%" align="left" valign="bottom"><table width="99%" height="100%" cellpadding="0" cellspacing="0" ><tr><td width="58%" align="center">';
	tmp_html += '<div align="left">';
	if(subArray[sno].getAttribute('logo') != ""){
		tmp_html += alink + '<img border="0" src="http://www.makaan.com/images/member/logo/'+subArray[sno].getAttribute('logo')+'" width="'+subArray[sno].getAttribute('logo_width')+'" height="'+subArray[sno].getAttribute('logo_height')+'"></a>';
	}
	tmp_html += '</div>';
	tmp_html += '</td></tr></table></td></tr></table></td>';

	tmp_html += '<td width="18%" align="left" valign="top" class="normaltext"><table width="99%" border="0" cellspacing="0" cellpadding="0" class="normaltext">';
	tmp_html += '<tr><td width="100%" align="left" valign="top">'+alink+'Rs. '+subArray[sno].getAttribute('price')+'</a><br>';
	if(subArray[sno].getAttribute('is_negotiable') != "yes"){
		tmp_html += alink +'Negotiable</a>';
	}else{
		tmp_html += alink +'Not Negotiable</a>';
	}
	tmp_html += '</td></tr><tr><td width="100%" align="left" valign="top">&nbsp;</td></tr>';
	tmp_html += '<tr><td width="100%" align="left" valign="top">'+alink+'Rs. '+subArray[sno].getAttribute('price_area')+'/'+subArray[sno].getAttribute('area_unit')+'<br>[Rate]</a></td></tr></table></td>';
	
	tmp_html += '<td width="30%" align="left" valign="top" class="normaltext"><table width="99%" border="0" cellspacing="0" cellpadding="0" class="normaltext">';
	tmp_html += '<tr><td width="100%" align="left" valign="top">'+alink+'Makaan Id : '+subArray[sno].getAttribute('formated_id')+'</a><br>'+alink+'Posted on  &nbsp;: '+subArray[sno].getAttribute('reposted_date')+'</a><br><br></td></tr>';
	tmp_html += '<tr><td width="100%" align="left" valign="top">'+alink+'<font class="brown">'+unescape(this.chr_replace(subArray[sno].getAttribute('contact_name')))+'</a><br>'+alink+'<font class="brown">'+unescape(this.chr_replace(subArray[sno].getAttribute('company_name')))+'</font></a></td></tr>';
	
	if(subArray[sno].getAttribute('contact_mobile') != "" || subArray[sno].getAttribute('contact_mobile2') != ""){
		tmp_html += '<tr><td width="100%" align="left" valign="top" ><table width="100%" class="normaltext" border="0"><tr><td width="35%" valign="top" align="left">Mobile: </td><td width="65%" valign="top">';
		if(subArray[sno].getAttribute('contact_mobile') != ""){
			tmp_html += alink+'<font class="brown"> '+subArray[sno].getAttribute('mob_country_code')+'-'+subArray[sno].getAttribute('contact_mobile') + '</a><br>';
		}
		if(subArray[sno].getAttribute('contact_mobile2') != ""){
			tmp_html += alink+'<font class="brown">' + subArray[sno].getAttribute('mob_country_code')+'-'+subArray[sno].getAttribute('contact_mobile2') + '</font></a>';
		}
		tmp_html += '</font></td></tr></table></td></tr>';
	}
	if(subArray[sno].getAttribute('contact_phone') != "" || subArray[sno].getAttribute('contact_phone2') != ""){
		tmp_html += '<tr><td width="100%" align="left" valign="top" ><table width="100%" class="normaltext"><tr><td width="35%" valign="top" align="left">Landline: </td><td width="65%" valign="top">';
		if(subArray[sno].getAttribute('contact_phone') != ""){
			tmp_html += alink+'<font class="brown"> '+subArray[sno].getAttribute('ph_area_code')+'-'+subArray[sno].getAttribute('contact_phone') + '</a><br>';
		}
		if(subArray[sno].getAttribute('contact_phone2') != ""){
			tmp_html += alink + '<font class="brown">' +  subArray[sno].getAttribute('ph_area_code2')+'-'+subArray[sno].getAttribute('contact_phone2') + '</font></a>';
		}
		tmp_html += '</font></td></tr></table></td></tr>';
	}
	tmp_html += '<tr><td width="100%" align="left" valign="top">&nbsp;</td></tr>';

	if(subArray[sno].getAttribute('url') != ""){
		tmp_html += '<tr><td width="100%" align="left" valign="top">URL : <a href="http://www.makaan.com/'+subArray[sno].getAttribute('url')+'" class="hrefheaderunderline" style="font-size:11px;" target="_blank">Visit our webpage</a></td></tr>';
	}
	tmp_html += '</table></td></table></td></tr>';
	tmp_html += '<tr><td colspan="4" bgcolor="#D5EBF5"><table width="100%" height="25px" border="0" cellpadding="0" cellspacing="0" class="tborderblue" style="border-top:none;" >';
	var amenitiesArray = subArray[sno].getElementsByTagName('ame');
	
	if(amenitiesArray.length > 0)
	{
		tmp_html += '<tr bgcolor="#AED7E8"><td width="55%" bgcolor="#D5EBF5" class="textwhitenopad"><table cellpadding=3 cellspacing=0 border=0><tr>';
		for(var i = 0; i < amenitiesArray.length; i++)
		{
			tmp_html += '<td><img src="/images/icon/'+amenitiesArray[i].getAttribute('image')+'" title="'+amenitiesArray[i].getAttribute('title')+'" alt="'+amenitiesArray[i].getAttribute('title')+'"></td>';
		}
		tmp_html += '</tr></table></td>';
	}else{
		tmp_html += '<tr bgcolor="#AED7E8"><td width="55%" bgcolor="#D5EBF5" class="textwhitenopad">&nbsp;</td>';
	}
	
	if(subArray[sno].getAttribute('contact_email') != ""){
		tmp_html += '<td width="16%" bgcolor="#D5EBF5" class="textwhitenopad"><a href="javascript:return false;" class="hrefblacklisting" onclick="javascript:window.open(\'/search/contact-property-email.php?pid='+subArray[sno].getAttribute('pid')+'\',\'smallwindowsms\',\'toolbars=0,scrollbars=1,width=600,height=500,menubar=0,resizable=0\');return false;"><img src="/images/email-color.gif" alt="Send E-mail" align="absmiddle" border="0" /> Send E-mail</a></td>';
	}else{
		tmp_html += '<td width="16%" bgcolor="#D5EBF5" class="textwhitenopad"><span onmouseover="ajax_showTooltip(\'&lt;font class=divmsg&gt;This feature is not available for this property.&lt;/font&gt;\',this);return false;" onmouseout="ajax_hideTooltip();" style="color:#000000;font-size:11px"><img src="/images/email-color.gif" alt="Send E-mail" align="absmiddle" border="0"> Send E-mail</span></td>'
	}

	if(subArray[sno].getAttribute('contact_mobile') != ""){
		tmp_html += '<td width="14%" bgcolor="#D5EBF5" class="textwhitenopad"><a href="javascript:return false;" class="hrefblacklisting" onclick="javascript:window.open(\'/search/contact-property.php?pid='+subArray[sno].getAttribute('pid')+'\',\'smallwindowsms\',\'toolbars=0,scrollbars=1,width=600,height=500,menubar=0,resizable=0\');return false;"><img src="/images/sms-color.gif" alt="Send SMS" align="absmiddle" border="0" /> Send SMS</a></td>';
	}else{
		tmp_html += '<td width="14%" bgcolor="#D5EBF5" class="textwhitenopad"><span onmouseover="ajax_showTooltip(\'&lt;font class=divmsg&gt;This feature is not available for this property.&lt;/font&gt;\',this);return false;" onmouseout="ajax_hideTooltip();" style="color:#000000;font-size:11px"  class="textwhitenopad"><img src="/images/sms-color.gif" alt="Send SMS" align="absmiddle" border="0"> Send SMS</span></td>'
	}
	
	if(subArray[sno].getAttribute('member_id') != "0"){
		tmp_html += '<td width="15%" bgcolor="#D5EBF5" class="textwhitenopad"><a href="javascript:return false;" class="hrefblacklisting" onclick="showsave(this,\''+subArray[sno].getAttribute('pid')+'\');"><img src="/images/save.gif" alt="Short-list" align="absmiddle" border="0" /> Short-list</a></td>';
	}else{
		tmp_html += '<td width="15%" bgcolor="#D5EBF5" class="textwhitenopad"><a href="/member/login.php?from=/search/search-property&pid='+subArray[sno].getAttribute('pid')+'" class="hrefblacklisting" ><img src="/images/save.gif" alt="Short-list" align="absmiddle" border="0" /> Short-list</a></td>';
	}
	tmp_html += '</tr></table></td></tr></table></td></tr></table></td></tr></table>';
	//tmp_html +=	tmp_ed;
	this.$(this.el).innerHTML = tmp_html;
	this.$(this.heading).innerHTML = '';
	this.$(this.heading).innerHTML = tmp_st;
	//alert(tmp_st)
	//return  tmp_html;
};


}





