<!--
var oFrame = document.getElementById("oFrame")

var sCurrentButton = ""
var sCurrentRentalTab = ""
var sCurrentSalesTab = ""

document.getElementById("tabHome").style.display = 'block'

addLoadEvent(showPage)

addEvent(document.getElementById("btnRentals"), "click", function() {return clickButton('lnkRentals')})
addEvent(document.getElementById("btnSales"), "click", function() {return clickButton('lnkSales'); return false})
addEvent(document.getElementById("btnLongTerm"), "click", function() {return clickButton('lnkLongTerm'); return false})
addEvent(document.getElementById("btnBuilders"), "click", function() {return clickButton('lnkBuilders'); return false})
addEvent(document.getElementById("btnCrystal"), "click", function() {return clickButton('lnkCrystal'); return false})
addEvent(document.getElementById("btwBluewater"), "click", function() {return clickButton('lnkBluewater'); return false})
addEvent(document.getElementById("btnOwners"), "click", function() {return clickButton('lnkOwners'); return false})

addEvent(document.getElementById("btnRentals"), "mouseover", function() {overButton('lnkRentals')})
addEvent(document.getElementById("btnSales"), "mouseover", function() {overButton('lnkSales')})
addEvent(document.getElementById("btnLongTerm"), "mouseover", function() {overButton('lnkLongTerm')})
addEvent(document.getElementById("btnBuilders"), "mouseover", function() {overButton('lnkBuilders')})
addEvent(document.getElementById("btnCrystal"), "mouseover", function() {overButton('lnkCrystal')})
addEvent(document.getElementById("btwBluewater"), "mouseover", function() {overButton('lnkBluewater')})
addEvent(document.getElementById("btnOwners"), "mouseover", function() {overButton('lnkOwners')})

addEvent(document.getElementById("btnRentals"), "mouseout", function() {outButton('lnkRentals')})
addEvent(document.getElementById("btnSales"), "mouseout", function() {outButton('lnkSales')})
addEvent(document.getElementById("btnLongTerm"), "mouseout", function() {outButton('lnkLongTerm')})
addEvent(document.getElementById("btnBuilders"), "mouseout", function() {outButton('lnkBuilders')})
addEvent(document.getElementById("btnCrystal"), "mouseout", function() {outButton('lnkCrystal')})
addEvent(document.getElementById("btwBluewater"), "mouseout", function() {outButton('lnkBluewater')})
addEvent(document.getElementById("btnOwners"), "mouseout", function() {outButton('lnkOwners')})

function showPage()
{
	document.getElementById("loadingcontainer").style.display = "none"
	document.getElementById("container").style.display = "block"
	var sTmp = readCookie("currentButton")
	if (sTmp == "")
	{
		sCurrentButton = 'lnkRentals'
		clickButton(sCurrentButton)
	}
	else
	{
		sCurrentButton = sTmp
		clickButton(sCurrentButton)
	}
	if (document.images) {var img1 = new Image(); var img2 = new Image(); var img3 = new Image(); var img4 = new Image(); var img5 = new Image(); var img6 = new Image(); var img7 = new Image(); img1.src = "http://www.bluewatergmac.com/images/hp/hp_rentals.jpg"; img2.src = "http://www.bluewatergmac.com/images/hp/hp_sales.jpg"; img3.src = "http://www.bluewatergmac.com/images/hp/hp_longterm.jpg"; img4.src = "http://www.bluewatergmac.com/images/hp/hp_builders.jpg"; img5.src = "http://www.bluewatergmac.com/images/hp/hp_crystal.jpg"; img6.src = "http://www.bluewatergmac.com/images/hp/hp_bluewater.jpg"; img7.src = "http://www.bluewatergmac.com/images/hp/hp_owners.jpg"}
}

function clickLink(sButton) {return false}

function clickButton(sButton)
{
	document.getElementById("tabHome").style.display = "none"
	if (sCurrentButton != "") {document.getElementById(sCurrentButton).style.backgroundPosition = '0 0'; document.getElementById(sCurrentButton.replace("lnk", "tab")).style.display = "none"}
	document.getElementById(sButton).style.backgroundPosition = '0 -98px';
	sCurrentButton = sButton
	document.getElementById(sButton.replace("lnk", "tab")).style.display = "block"

	if (sButton == "lnkRentals") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_rentals.jpg)"}
	if (sButton == "lnkSales") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_home.jpg)"}
	if (sButton == "lnkLongTerm") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_longterm.jpg)"}
	if (sButton == "lnkBuilders") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_builders.jpg)"}
	if (sButton == "lnkCrystal") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_crystal.jpg)"}
	if (sButton == "lnkBluewater") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_bluewater.jpg)"}
	if (sButton == "lnkOwners") {document.getElementById("menu").style.backgroundImage = "url(http://www.bluewatergmac.com/images/hp/hp_owners.jpg)"}

	createCookie("currentButton", sButton, 1000)

	if (sButton == "lnkRentals")
	{
		var sTmp = readCookie("currentTabRentals")
		if (sTmp == "") {showInnerRentalTab('Search')} else {showInnerRentalTab(sTmp)}
	}

	if (sButton == "lnkSales")
	{
		var sTmp = readCookie("currentTabSales")
		if (sTmp == "") {showInnerSalesTab('Search')} else {showInnerSalesTab(sTmp)}
	}

}

var brSearch = false
var brFeatured = false
var brFavorites = false

function showInnerRentalTab(sRentalTab)
{

	if (sCurrentRentalTab != "")
	{
		document.getElementById('ar' + sCurrentRentalTab).className = ""
		document.getElementById('dr' + sCurrentRentalTab).style.display = "none"
	}
	sCurrentRentalTab = sRentalTab
	document.getElementById('ar' + sCurrentRentalTab).className = "active"
	document.getElementById('dr' + sCurrentRentalTab).style.display = "block"

	if (sCurrentRentalTab == "Search" && brSearch == false) {ajaxLoad('ajax.asp?action=searchrentals&rnd=' + Math.random() * 5, 'drSearch')}
	if (sCurrentRentalTab == "Featured" && brFeatured == false) {ajaxLoad('ajax.asp?action=featuredrentals&rnd=' + Math.random() * 5, 'drFeatured')}
	if (sCurrentRentalTab == "Favorites" && brFavorites == false) {ajaxLoad('ajax.asp?action=favoriterentals&rnd=' + Math.random() * 5, 'drFavorites')}

	createCookie("currentTabRentals", sRentalTab, 1000)

	return false
}

var bsSearch = false
var bsFeatured = false
var bsFavorites = false

function showInnerSalesTab(sSalesTab)
{
	if (sCurrentSalesTab != "")
	{
		document.getElementById('as' + sCurrentSalesTab).className = ""
		document.getElementById('ds' + sCurrentSalesTab).style.display = "none"
	}
	sCurrentSalesTab = sSalesTab
	document.getElementById('as' + sCurrentSalesTab).className = "active"
	document.getElementById('ds' + sCurrentSalesTab).style.display = "block"

	if (sCurrentSalesTab == "Search" && bsSearch == false) {ajaxLoad('ajax.asp?action=searchsales&rnd=' + Math.random() * 5, 'dsSearch')}
	if (sCurrentSalesTab == "Featured" && bsFeatured == false) {ajaxLoad('ajax.asp?action=featuredsales&rnd=' + Math.random() * 5, 'dsFeatured')}
	if (sCurrentSalesTab == "Favorites" && bsFavorites == false) {ajaxLoad('ajax.asp?action=favoritesales&rnd=' + Math.random() * 5, 'dsFavorites')}

	createCookie("currentTabSales", sSalesTab, 1000)

	return false
}

function overButton(sButton) {if (sButton != sCurrentButton) {document.getElementById(sButton).style.backgroundPosition = '0 -49px'}}
function outButton(sButton) {if (sButton != sCurrentButton) {document.getElementById(sButton).style.backgroundPosition = '0 0'}}

function addEvent(oObject, sType, scFunction) {if (oObject.addEventListener) {oObject.addEventListener(sType, scFunction, false)} else {oObject.attachEvent("on" + sType, scFunction)}}
function addLoadEvent(func) {var oldonload = window.onload; if (typeof window.onload != 'function') {window.onload = func} else {window.onload = function() {if (oldonload) {oldonload()} func()}}}

function hiButton(sDir, sFeaturedName)
{
	var sName = ""
	if (sFeaturedName == 1) {sName = "Rentals"} else {sName = "Sales"}
	if (sDir == 1) {document.getElementById("btnLeft" + sName).src = 'http://www.bluewatergmac.com/images/button_Left_red_click.gif'} else {document.getElementById("btnRight" + sName).src = 'http://www.bluewatergmac.com/images/button_Right_red_click.gif'}
}

function loButton(sDir, sFeaturedName)
{
	var sName = ""
	if (sFeaturedName == 1) {sName = "Rentals"} else {sName = "Sales"}
	if (sDir == 1) {document.getElementById("btnLeft" + sName).src = 'http://www.bluewatergmac.com/images/button_Left_red_on.gif'} else {document.getElementById("btnRight" + sName).src = 'http://www.bluewatergmac.com/images/button_Right_red_on.gif'}
}

var iCurFeaturedRentals = 1
var iMaxFeaturedRentals = 0
var Rentaldelay = 7000; //Time delay between Slides in milliseconds
var PlayRentals = true;

var vfUrlsRentals
var vfDescRentals
var vfPhotosRentals

function displayCurFeaturedRentals()
{
	for (var iCounter = 1; iCounter <= iMaxFeaturedRentals; iCounter++) {document.getElementById('imgRentals_' + iCounter).src = 'http://www.bluewatergmac.com/images/status_gray_off.gif'}

	if (iCurFeaturedRentals > iMaxFeaturedRentals) {iCurFeaturedRentals = 1}
	if (iCurFeaturedRentals < 1) {iCurFeaturedRentals = iMaxFeaturedRentals}

	document.getElementById('imgRentals_' + iCurFeaturedRentals).src = 'http://www.bluewatergmac.com/images/status_gray_on.gif'
	document.getElementById('oftRentalUrl').href = vfUrlsRentals[iCurFeaturedRentals - 1]
	document.getElementById('oftRentalDesc').innerHTML = vfDescRentals[iCurFeaturedRentals - 1]
	document.getElementById('oftRental').src = vfPhotosRentals[iCurFeaturedRentals - 1]
}

function displayNextFeaturedRental()
{
	if (PlayRentals)
	{
		window.parent.iCurFeaturedRentals = window.parent.iCurFeaturedRentals + 1; 
		window.parent.displayCurFeaturedRentals();
	}
}

function toggleRentalsPlay()
{
	if (PlayRentals)
	{
		PlayRentals = false
		document.getElementById('imgRentals_Play').src = "/images/button_red_pause.gif"
	}
	else
	{
		document.getElementById('imgRentals_Play').src = "/images/button_red_play.gif"
		PlayRentals = true
	}
}

function hiPlay(iMode)
{
	if (iMode == 1) {
		if (PlayRentals)
		{document.getElementById('imgRentals_Play').src = "/images/button_red_play_click.gif"}
		else
		{document.getElementById('imgRentals_Play').src = "/images/button_red_pause_click.gif"}
	}
	else {
		if (PlayRentals)
		{document.getElementById('imgRentals_Play').src = "/images/button_red_play.gif"}
		else
		{document.getElementById('imgRentals_Play').src = "/images/button_red_pause.gif"}
	}
}


var iCurFeaturedSales = 1
var iMaxFeaturedSales = 0

var vfUrlsSales
var vfDescSales
var vfPhotosSales

function displayCurFeaturedSales()
{
	for (var iCounter = 1; iCounter <= iMaxFeaturedSales; iCounter++) {document.getElementById('imgs_' + iCounter).src = 'http://www.bluewatergmac.com/images/status_gray_off.gif'}

	if (iCurFeaturedSales > iMaxFeaturedSales) {iCurFeaturedSales = 1}
	if (iCurFeaturedSales < 1) {iCurFeaturedSales = iMaxFeaturedSales}

	document.getElementById('imgs_' + iCurFeaturedSales).src = 'http://www.bluewatergmac.com/images/status_gray_on.gif'
	document.getElementById('oftSalesUrl').href = vfUrlsSales[iCurFeaturedSales - 1]
	document.getElementById('oftSalesDesc').innerHTML = vfDescSales[iCurFeaturedSales - 1]
	document.getElementById('oftSales').src = vfPhotosSales[iCurFeaturedSales - 1]
}


function fetchRentalDates(sDay)
{
	ajaxLoad("http://www.bluewatergmac.com/search_rentals_SetDates.asp?day=" + sDay + "&rnd=" + Math.random() * 5, 'arrivaldate')
	ajaxLoad("http://www.bluewatergmac.com/search_rentals_SetCookies.asp?style=3&action=pricing&rnd=" + Math.random() * 5, 'resultsCount')
}

-->
