$(document).ready(function () {
   
     // Get the URL parameters' array
     query_string = getUrlVars();
     // If nid is set in url, then get the value, else set it to default 0
     nid      = ((query_string[0] != undefined)?query_string[0]:0);
     // If tid is set in url, then get the value, else set it to default 0
     tid      = ((query_string[1] != undefined)?query_string[1]:8);
     // If minPrice is set in url, then get the value, else set it to default 0
     minPrice = ((query_string[2] != undefined)?query_string[2]:0);
     // If maxPrice is set in url, then get the value, else set it to default 0
     maxPrice = ((query_string[3] != undefined)?query_string[3]:99999);

   
     doPageLoad();

});

function doPageLoad()
{
	initNeighborhoodsLive('#neighborhoodCont',nid);
	initSearentSearch("detail_test.html", nid, tid, "0", minPrice, maxPrice);
};
function searentUnitDetailOnClickOverride(strUrl, iUnitId, strTitle)
{
       $.fn.colorbox({href:strUrl,width:"875px", height:"95%", iframe:true,open:true}); 
}; 


/* Function of getting URL parameters back from Get Form */
// array[0]=> frist parameter's value
// array[1]=> second parameter's value
// array[2]=> third parameter's value
// array[3]=> forth parameter's value
function getUrlVars() {
         var vars   = [], hash;
         var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

         for (var i=0; i< hashes.length; i++) {
           hash = hashes[i].split('=');
           vars[i] = hash[1];
         }

	return vars;
};

