// JavaScript Document

//var $ = jquery.noConflict();

function next_special_prop(base_url,offset)
{
	//
	$("#ajaz_preloader").show();
	//document.getElementById('ajaz_preloader').innerHTML = img_load;
   // alert('sadsaasd');
	
	var data = offset;
	$.ajax({
		
  url: base_url+"Housing/ajax_special_property/"+data,
  
  context: document.body,
  
  success: function(html){
    	$("#ajaz_preloader").hide();
		document.getElementById('speprop').innerHTML = html; 
  }
});
}


/////////////////////////////////////////////////
function show_unittype_dpd(dpd,base_url)
{
	
	//$("#ajaz_preloader").show();
	//document.getElementById('ajaz_preloader').innerHTML = img_load;
    //alert('sadsaasd');
	if(dpd == 'unit_type')
	{
		
		document.getElementById('dpd').style.display = 'block';
		document.getElementById('txt').style.display = 'none';
	
	}
	else if(dpd == 'rent')
	{
		document.getElementById('dpd').style.display = 'none';
		document.getElementById('txt').style.display = 'block';
	}
	
	
	
}







function search_house(path)
{
    alert(path);
	var min_rent      	 =   document.getElementById('txt_min_rent');
    var max_rent   		 =   document.getElementById('txt_max_rent');
    var direction        =   document.getElementById('dpdDirection');
    var unitType       	 =   document.getElementById('dpdUnitType');
    //alert(email.value);
    var data    =   'min_rent='+min_rent.value+'&max_rent='+max_rent.value+'&direction='+direction.value+'&unitType='+unitType.value;
	alert(data);
    j.ajax({
            //this is the php file that processes the data and checks it for inconsistencies
            url: path+"demo/ajax_check_1",

            //POST method is used
            type: "POST",

            //pass the data
            data: data,

            //Do not cache the page
            cache: false,

            //success
            success: function(html)
            {
                //alert(html);
                var result	=   html;
                if(result	==	"success")
                {                    
                   window.location = path+'demo/step2/';
                }
                else
                {
                    j('div[id=ErrorMsgdesc]').html(result);
                    j('div[id=ErrorMsg]').show('slow');
                }               
            }
    });
    //return result;
}
