var $j = jQuery.noConflict();
$j(document).ready(function() {
$j("#toptentitle[title]").tooltip({tip: '#tooltiptwo', effect: 'slide', direction: 'left', bounce: 'true'});
window.location = "#toptentitle";
function loadProperty(propertyCode) {
$j('.selected_image').animate({
opacity: 0
      }, 500 );
propertyid = propertyCode.replace('property','');
parentlist = $j('#topten_main').find('.fulllist.active').attr('id');
parentlistid = parentlist.replace('fulllist','');
//alert(parentlistid);
$j.ajax({
type: "GET",
url: "scripts/xhr_property_single.php",
cache: false,
data: "propertyid=" + propertyid + "&parentlistid=" + parentlistid,
success: function(html){
//alert(html);
propertydata = html.split("#");
$j('.fulllist.active .selected_image').html(propertydata[3]);
$j('.fulllist.active .selected_property h4').html(propertydata[0]);
$j('.fulllist.active .selected_why p.why_text').html(propertydata[9]);
if(propertydata[10]!="") {
$j('.fulllist.active p.quotes').html(propertydata[10]);
}
$j('.fulllist.active .excerpt_text').html(propertydata[7]);
//$j('.fulllist.active .listingenquire').html(propertydata[3]);
//$j('.fulllist.active a.booknow').attr("href", propertydata[8] + ".htm#availability");
$j('.fulllist.active a.moreinfo').attr("href", propertydata[8] + ".htm#property_details");
$j('.fulllist.active .selected_image').animate({
opacity: 1.0
      }, 750 );
$j(".fulllist.active ul.excerpt_list, .fulllist.active .listingenquire, .fulllist.active .selected_why, .fulllist.active .selected_property").show();
}
});
}
function loadBestList(listID) {
listid = listID.replace('list','');
block = "fulllist" + listid;
$j.ajax({
type: "GET",
url: "scripts/xhr_get_tenbest.php",
cache: false,
data: "listid=" + listid,
success: function(html){
listdata = html.split("---");
listName = listdata[0];
newList = "<ol>\n" + listdata[1] + "</ol>\n";
$j('.property_list').empty();
$j('.fulllist').hide();
$j('.fulllist, .standard_header').removeClass('active');
$j('#' + block).addClass('active').show();
$j('#' + listID).addClass('active').show();
$j('#' + block + ' .property_list').html(newList);
window.location = String(window.location).replace(/\#.*$/, "") + "#" + listID;
loadProperty(listdata[2])
}
});
}
$j(".standard_header").live("click",function () {
var listID = $j(this).attr("id");
loadBestList(listID);
});
$j(".property_list ol li").live("click",function () {
var propertyID = $j(this).attr("id");
loadProperty(propertyID);
});
// end document.ready()
});