var activeListingSection = "listingOverviewNav";var currentListIndex = 0;var nextEnabled = false;var prevEnabled = false;var currentPageNumber = 0;Effect.BlindLeft = function(element) {  element = $(element);  element.makeClipping();  return new Effect.Scale(element, 0,    Object.extend({ scaleContent: false,       scaleY: false,                           restoreAfterFinish: true,      afterFinishInternal: function(effect) {        effect.element.hide().undoClipping();      }     }, arguments[1] || {})  );}Effect.BlindRight = function(element) {  element = $(element);    var elementDimensions = element.getDimensions();  return new Effect.Scale(element, 100, Object.extend({     scaleContent: false,     scaleY: false,    scaleFrom: 0,    scaleMode: {originalHeight: elementDimensions.height, originalWidth: elementDimensions.width},    restoreAfterFinish: true,    afterSetup: function(effect) {      effect.element.makeClipping().setStyle({width: '0px'}).show();     },      afterFinishInternal: function(effect) {      effect.element.undoClipping();    }  }, arguments[1] || {}));}function setActiveListingNavigation(currentNav){	$(activeListingSection).className="";	$(currentNav).className="listingDetailNavHighlight";
	if (activeListingSection == currentNav)	{		return;	}
	oldSecName = activeListingSection.substring(0, activeListingSection.length - 3) + "Section";	newSecName = currentNav.substring(0, currentNav.length - 3) + "Section";
	var sec = $(oldSecName)	var newSec = $(newSecName)
	new Effect.Fade(sec, {queue: {position: 'end', scope: 'listingNavScope'}, duration: 0.15 });	new Effect.Appear(newSec, {queue: {position: 'end', scope: 'listingNavScope'}, duration: 0.15 });
	activeListingSection = currentNav;}
function getNext(){	if (listingIds == null || currentListIndex == listingIds.length - 1)	{		return;	}		populateNewListingInformation(currentListIndex++);	hideListingArea();	greyOutNext();}function getPrev(){	if (listingIds == null || currentListIndex == listingIds.length - 1)	{		return;	}		populateNewListingInformation(currentListIndex--);	hideListingArea();	greyOutPrevious();}function populateNewListingInformation(index){	$('newListingOverviewSection').innerHTML = "New overview";	$('newListingDetailSection').innerHTML = "New detail";	$('newListingFeaturesSection').innerHTML = "New features";	$('newListingPhotosSection').innerHTML = "New photo gallery";	$('newListingVirtualTourSection').innerHTML = "New virtual tour";	$('newListingAgentSection').innerHTML = "New agent";	$('newListingAddress').innerHTML = "456 Westheimer Blvd.";	$('newListingPrice').innerHTML = "$1,200,000";}function hideListingArea(){	new Effect.toggle('listingDetail', 'slide', {queue: {position: 'end', scope: 'listingDetailScope'}, afterFinish: changeListingHeaderInfo});}function showListingArea(){	new Effect.toggle('listingDetail', 'slide', {queue: {position: 'end', scope: 'listingDetailScope'}});}function changeListingHeaderInfo(){	new Effect.toggle('listingDetailSummaryAddress', 'appear', {queue: {position: 'end', scope: 'listingSummaryAddressScope'}, duration: 0.4 });	new Effect.toggle('listingDetailSummaryPrice', 'appear', {queue: {position: 'end', scope: 'listingSummaryPriceScope'}, duration: 0.4, afterFinish: swapListingHeaderInfoAndShow });}function swapListingHeaderInfoAndShow(){	$('listingDetailSummaryAddress').innerHTML = $('newListingAddress').innerHTML;	$('listingDetailSummaryPrice').innerHTML = $('newListingPrice').innerHTML;	new Effect.toggle('listingDetailSummaryAddress', 'appear', {queue: {position: 'end', scope: 'listingSummaryAddressScope'}, duration: 0.4 });	new Effect.toggle('listingDetailSummaryPrice', 'appear', {queue: {position: 'end', scope: 'listingSummaryPriceScope'}, duration: 0.4, afterFinish: replaceListingInfo });}function replaceListingInfo(){	$('listingOverviewSection').innerHTML = $('newListingOverviewSection').innerHTML;	$('listingDetailSection').innerHTML = $('newListingDetailSection').innerHTML;	$('listingFeaturesSection').innerHTML = $('newListingFeaturesSection').innerHTML;	$('listingPhotosSection').innerHTML = $('newListingPhotosSection').innerHTML;	$('listingVirtualTourSection').innerHTML = $('newListingVirtualTourSection').innerHTML;	$('listingAgentSection').innerHTML = $('newListingAgentSection').innerHTML;	showListingArea();	}function greyOutNext(){}function greyOutPrev(){}function setPrevEnabled(){	prevEnabled = ($('results_page_num').firstChild.nodeValue > 1);}function setNextEnabled(){	nextEnabled = ($('results_page_num').firstChild.nodeValue != $('results_total_pages').firstChild.nodeValue);}function setSearchCount(){	searchCount = trim($('results_count').firstChild.nodeValue);}function setListingsShown(){	listingsShown = $('results_min').firstChild.nodeValue + " - " + $('results_max').firstChild.nodeValue;}function setCurrentPageNumber(){	currentPageNumber = trim($('results_page_num').firstChild.nodeValue);}function trim(s) {    var m = s.match(/^\s*(\S+(\s+\S+)*)\s*$/);    return (m == null) ? "" : m[1];}function listingINIT(){	setNextEnabled();	setPrevEnabled();	setSearchCount();	setListingsShown();	setCurrentPageNumber();}function checkForVirtualTourURL(){	if ($('vtourframe').src == document.location.href)	{		$('listingVirtualTourNav').hide();	}}
