var propertyListing_currentType="sale";
var propertyListing_currentMode="thumb";
var propertyListing_currentNode=0;
var propertyListing_currentPage=0;
var propertyListing_currentRecords=0;
var propertyListing_currentMaxRows=0;
var propertyListing_changeEnabled=true;
var propertyListing_customType="";
var propertyListing_order="sort_by_price";
var propertyListing_orderDirection="asc";
var propertyListing_contactSearchId=0;
var propertyListing_currentSavedSearch="";
var propertyListing_toPage=0;
var propertyListing_toStartrow=0;
var propertyListing_LIST_MODE="list";
var propertyListing_THUMB_MODE="thumb";
var propertyListing_MAP_MODE="map";
var propertyListing_viewMode={};
propertyListing_viewMode.list="/site/master.cfm?fuseaction=site-ajax.displayPropertyResultList";
propertyListing_viewMode.thumb="/site/master.cfm?fuseaction=site-ajax.displayPropertyResultThumb";
propertyListing_viewMode.map="/site/master.cfm?fuseaction=site-ajax.displayPropertyResultMap";
var propertyListing_options={dataType:"html",url:propertyListing_viewMode.thumb,type:"GET",data:"startrow=1",async:true,cache:false,queue:false,success:function(responseHtml,textStatus){$("#col2_content_wrapper").animate({opacity:"hide"},{queue:"false",duration:1000,easing:"linear",complete:function(){$("#col2_content_wrapper").html(responseHtml);
$("#col2_content_wrapper").animate({opacity:"show"},{queue:"true",duration:1000,easing:"linear"});
propertyListing_changeEnabled=true;
}});},error:function(XMLHttpRequest,textStatus,errorThrown){alert("An error occured, please try again\n"+textStatus+" "+errorThrown);
propertyListing_changeEnabled=true;
}};function propertyListing_switchToMode(mode){if(propertyListing_changeEnabled){$("#col2_content_wrapper").animate({opacity:"hide"},{queue:"false",duration:100,easing:"linear"});
$("#col2_content_wrapper").html('<div class="preloader_wrapper_col3"><div id ="loader" class="preloader_light_32_alt"/><span>Loading</span></div>');
$("#col2_content_wrapper").animate({opacity:"show"},{queue:"false",duration:100,easing:"linear"});
propertyListing_options.data="startrow="+propertyListing_toStartrow+"&searchType="+propertyListing_currentType+"&relocate=false&pageid="+propertyListing_currentNode+"&customType="+propertyListing_customType+"&order="+propertyListing_order+"&orderDirection="+propertyListing_orderDirection+"&contactSearchId="+propertyListing_contactSearchId+"&currentSavedSearch="+propertyListing_currentSavedSearch;
propertyListing_options.url=propertyListing_viewMode[mode];
$("#list_mode, #thumbnail_mode, #map_mode").removeClass("active");
propertyListing_setCurrentMode(mode);
propertyListing_changeEnabled=false;
$.ajax(propertyListing_options);
}return false;}function propertyListing_switchToPage(pageType){var startrow=0;
if(propertyListing_changeEnabled){if(pageType=="next"){propertyListing_toPage=propertyListing_currentPage+1;
}else{if(pageType=="prev"){propertyListing_toPage=propertyListing_currentPage-1;
}else{propertyListing_toPage=1;
}}startrow=((propertyListing_toPage-1)*propertyListing_currentMaxRows)+1;
propertyListing_toStartrow=startrow;
propertyListing_switchToMode(propertyListing_currentMode);
}}function propertyListing_setCurrentPage(page){if(propertyListing_currentPage!=page){propertyListing_currentPage=page;
}}function propertyListing_setStartrow(row){if(propertyListing_toStartrow!=row){propertyListing_toStartrow=row;
}}function propertyListing_setCurrentRecords(value){propertyListing_currentRecords=value;
}function propertyListing_setCurrentMaxRows(value){propertyListing_currentMaxRows=value;
}function propertyListing_setCurrentNode(value){propertyListing_currentNode=value;
}function propertyListing_setCurrentMode(mode){propertyListing_currentMode=mode;
switch(mode){case propertyListing_LIST_MODE:$("#list_mode").addClass("active");
break;case propertyListing_THUMB_MODE:$("#thumbnail_mode").addClass("active");
break;case propertyListing_MAP_MODE:$("#map_mode").addClass("active");
recalculateNavHeight();
break;}}function propertyListing_setCurrentType(searchType){if(propertyListing_currentType!=searchType){propertyListing_currentType=searchType;
}}function propertyListing_setCustomType(customType){if(propertyListing_customType!=customType){propertyListing_customType=customType;
}}function propertyListing_setContactSearchId(contactSearchId){if(propertyListing_contactSearchId!=contactSearchId){propertyListing_contactSearchId=contactSearchId;
}}function propertyListing_setCurrentSavedSearch(currentSavedSearch){if(propertyListing_currentSavedSearch!=currentSavedSearch){propertyListing_currentSavedSearch=currentSavedSearch;
}}function propertyListing_refreshInterface(){var pageTotal=Math.ceil(propertyListing_currentRecords/propertyListing_currentMaxRows);
if(pageTotal!=0){$("#pagination_label").html("Page "+propertyListing_currentPage+"/"+pageTotal+" of "+propertyListing_currentRecords+" matches");
$(".icons_views li#iconPrint,.icons_views li#iconThumbView,.icons_views li#iconListView,.icons_views li#iconMapView,.icons_views li.iconDivider").css("display","block");
$(".property_search_sort_by").css("display","block");
}else{$("#pagination_label").html("");
$(".icons_views li#iconPrint,.icons_views li#iconThumbView,.icons_views li#iconListView,.icons_views li#iconMapView,.icons_views li.iconDivider").css("display","none");
$(".property_search_sort_by").css("display","none");
}if(pageTotal<=propertyListing_currentPage){$(".nextPage").css("display","none");
}else{$(".nextPage").css("display","inline");
}if(propertyListing_currentPage<=1){$(".prevPage").css("display","none");
}else{$(".prevPage").css("display","inline");
}if(pageTotal<=1){$(".footer_pagination, .footer_pagination_outer").css("display","none");
}else{$(".footer_pagination, .footer_pagination_outer").css("display","block");
}if(propertyListing_currentMode==propertyListing_MAP_MODE){$("#pagination_label").html("");
$(".property_search_sort_by").css("display","none");
}if(propertyListing_currentSavedSearch!=""){$("h2#searchResults_heading").html(propertyListing_currentSavedSearch);
}if(propertyListing_customType==""&&propertyListing_currentSavedSearch==""){$(".icons_views li#iconSaveSearch").css("display","block");
}else{$(".icons_views li#iconSaveSearch").css("display","none");
}if(propertyListing_customType=="favouriteProperties"){$(".icons_views li#iconSendEmail,.icons_views li#iconSendMMS").css("display","block");
$(".icons_views li#iconSaveSearch").css("display","none");
}if(propertyListing_order=="sort_by_date_leased"){$(".property_search_sort_by #search_sort").css("display","none");
$(".property_search_sort_by #sort_by_date_sold").css("display","none");
$(".property_search_sort_by #sort_by_date_leased").css("display","block");
$(".property_search_sort_by #sort_by_most_viewed").css("display","none");
$(".property_search_sort_by #sort_by_date_listed").css("display","none");
}else{if(propertyListing_customType=="recentSales"||propertyListing_order=="sort_by_date_sold"){$(".property_search_sort_by #search_sort").css("display","none");
$(".property_search_sort_by #sort_by_date_sold").css("display","block");
$(".property_search_sort_by #sort_by_date_leased").css("display","none");
$(".property_search_sort_by #sort_by_most_viewed").css("display","none");
$(".property_search_sort_by #sort_by_date_listed").css("display","none");
}else{if(propertyListing_customType=="mostViewed"||propertyListing_order=="sort_by_most_viewed"){$(".property_search_sort_by #search_sort").css("display","none");
$(".property_search_sort_by #sort_by_date_sold").css("display","none");
$(".property_search_sort_by #sort_by_date_leased").css("display","none");
$(".property_search_sort_by #sort_by_most_viewed").css("display","block");
$(".property_search_sort_by #sort_by_date_listed").css("display","none");
}else{if(propertyListing_order=="sort_by_date_listed"){$(".property_search_sort_by #search_sort").css("display","none");
$(".property_search_sort_by #sort_by_date_sold").css("display","none");
$(".property_search_sort_by #sort_by_date_leased").css("display","none");
$(".property_search_sort_by #sort_by_most_viewed").css("display","none");
$(".property_search_sort_by #sort_by_date_listed").css("display","block");
}else{$(".property_search_sort_by #search_sort").css("display","block");
$(".property_search_sort_by #sort_by_date_sold").css("display","none");
$(".property_search_sort_by #sort_by_date_leased").css("display","none");
$(".property_search_sort_by #sort_by_most_viewed").css("display","none");
$(".property_search_sort_by #sort_by_date_listed").css("display","none");
}}}}}function propertyListing_setOrder(order){if(propertyListing_order!=order){propertyListing_order=order;
}}function propertyListing_setOrderDirection(orderDirection){if(propertyListing_orderDirection!=orderDirection){propertyListing_orderDirection=orderDirection;
}}function propertyListing_toggleSortStyle(sortType,sortOrder){$(".property_search_sort_by ul a").each(function(){$(this).removeClass("sort_active");
$(this).removeClass("ascending");
$(this).removeClass("descending");
});$(".property_search_sort_by ul a#"+sortType).addClass("sort_active");
if(sortOrder=="desc"){$(".property_search_sort_by ul a#"+sortType).addClass("descending");
}else{$(".property_search_sort_by ul a#"+sortType).addClass("ascending");
}}function propertyListing_setSort(sortType,sortOrder){propertyListing_setOrder(sortType);
propertyListing_setOrderDirection(sortOrder);
propertyListing_switchToMode(propertyListing_currentMode);
}function propertyListing_sendEmail(pagePath,nType,ntoKey,nfromKey,nReferer){var options={dataType:"json",url:"/site/master.cfm?fuseaction=site-ajax.validateAuth",type:"GET",async:false,cache:false,timeout:30,success:function(response){if(response.retcode=="OK"){subnav_show("site-ajax.displayPopupEmailFavourites",0);
trackme(nType,ntoKey,nfromKey,nReferer);
}else{subnav_show("site-ajax.displayLogin",1,"component","site-ajax.displayPopupEmailFavourites%26thisPagePath="+pagePath);
}},error:function(XMLHttpRequest,textStatus,errorThrown){alert("An error occured, please try again\n"+textStatus+" "+errorThrown);
}};$.ajax(options);return false;
}function propertyListing_sendFavouritesMMS(pagePath,nType,ntoKey,nfromKey,nReferer){var options={dataType:"json",url:"/site/master.cfm?fuseaction=site-ajax.validateAuth",type:"GET",async:false,cache:false,timeout:30,success:function(response){if(response.retcode=="OK"){subnav_show("site-ajax.displayPopupFavouriteMMS",0);
trackme(nType,ntoKey,nfromKey,nReferer);
}else{subnav_show("site-ajax.displayLogin",1,"component","site-ajax.displayPopupFavouriteMMS%26thisPagePath="+pagePath);
}},error:function(XMLHttpRequest,textStatus,errorThrown){alert("An error occured, please try again\n"+textStatus+" "+errorThrown);
}};$.ajax(options);return false;
}function propertyListing_setTooltip(){$("#col2_content_wrapper .tooltip_icons a, #col2_content_wrapper .tooltip_icons span, #col2_content_wrapper .tooltip_icons li").tooltip({track:true,delay:0,fade:0,top:-45,left:-10,showURL:false,fixPNG:true});
return false;}$(document).ready(function(){$("#col2_navigation .tooltip_icons a, #col2_navigation .tooltip_icons span").tooltip({track:true,delay:0,fade:0,top:-45,left:-10,showURL:false,fixPNG:true});
$(".property_search_sort_by ul a#sort_by_suburb, .property_search_sort_by ul a#sort_by_price").click(function(){$(this).toggleClass("descending");
$(this).toggleClass("ascending");
propertyListing_setCurrentPage(1);
propertyListing_setStartrow(1);
if($(this).hasClass("sort_active")){if($(this).hasClass("descending")){propertyListing_setSort(this.id,"desc");
}else{propertyListing_setSort(this.id,"asc");
}}else{propertyListing_setSort(this.id,"asc");
}propertyListing_toggleSortStyle(this.id,propertyListing_orderDirection);
});});