// JavaScript Document

function loadSettings() {

    var cat1 = document.frmHidValues.hidCategory1.value;
    var cat2 = document.frmHidValues.hidCategory2.value;
    //alert(document.frmHidValues.hidCategory1.value);
    if (cat1 == 'Home') {
        tdBodyCell.style.backgroundImage = 'url(images/backgrounds/bgBodyHome.jpg)';
        document.btnHome.src = "images/buttons/btnOver_Home.gif";
        //document.imgHistoricText.src="images/imgHistoricTextHome.jpg";
    }
    else if (cat1 == 'Amenities') {
        tdBodyCell.style.backgroundImage = 'url(images/backgrounds/bgBodyAmenities.jpg)';
        document.btnAmenities.src = "images/buttons/btnOver_Amenities.gif";
        //document.imgHistoricText.src="images/imgHistoricTextAmenities.jpg";
    }
    else if (cat1 == 'Residences') {
        tdBodyCell.style.backgroundImage = 'url(images/backgrounds/bgBodyResidences.jpg)';
        document.btnFloorplans.src = "images/buttons/btnOver_Floorplans.gif";
        //document.imgHistoricText.src="images/imgHistoricTextResidences.jpg";
        //document.btnResidences.src="images/buttons/btnOver_Residences.gif";
        //resize window to work with positioning bug in ie:mac
        window.resizeBy(0, 1);

        if (cat2 == '3') {
            tdFPN3.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '4') {
            tdFPN4.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '5') {
            tdFPN5.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '6') {
            tdFPN6.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '7') {
            tdFPN7.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '8') {
            tdFPN8.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '9') {
            tdFPN9.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '10') {
            tdFPN10.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '11') {
            tdFPN11.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '12') {
            tdFPN12.style.backgroundColor = '#3f3015';
        }
    }
    else if (cat1 == 'Leasing') {
        tdBodyCell.style.backgroundImage = 'url(images/backgrounds/bgBodyLeasing.jpg)';
        document.btnLeasing.src = "images/buttons/btnOver_Leasing.gif";
        //document.imgHistoricText.src = "images/imgHistoricTextLeasing.jpg";
    }
    else if (cat1 == 'Location') {
        //tdBodyCell.style.backgroundImage='url(images/backgrounds/bgBodyLocation.jpg)';
        document.btnLocation.src = "images/buttons/btnOver_Location.gif";
        //document.imgHistoricText.src = "images/imgHistoricTextLocation.jpg";
    }
    else if (cat1 == 'Contact') {
        tdBodyCell.style.backgroundImage = 'url(images/backgrounds/bgBodyContact_New.jpg)';
        document.btnContact.src = "images/buttons/btnOver_Contact.gif";
    }
    else if ((cat1 == 'History') | (cat1 == 'Gallery')) {
        if (cat1 == 'Gallery') {
            tdBodyCell.style.background = 'url(images/backgrounds/bgBodyGallery.jpg)';
            document.btnGallery.src = "images/buttons/btnOver_Gallery.gif";
        }
        else {
            tdBodyCell.style.backgroundImage = 'url(images/backgrounds/bgBodyHistory.jpg)';
            document.btnHistory.src = "images/buttons/btnOver_History.gif";
        }
        if (cat2 == '1') {
            tdLeftNav1.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '2') {
            tdLeftNav2.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '3') {
            tdLeftNav3.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '4') {
            tdLeftNav4.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '5') {
            tdLeftNav5.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '6') {
            tdLeftNav6.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '7') {
            tdLeftNav7.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '8') {
            tdLeftNav8.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '9') {
            tdLeftNav9.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == '10') {
            tdLeftNav10.style.backgroundColor = '#3f3015';
        }
        else if (cat2 == 'tour') {
            aLeftNavTour.style.background = 'none';
            aLeftNavTour.style.textIndent = '0';
            aLeftNavTour.style.backgroundColor = '#3f3015';
            aLeftNavTour.onmouseout = '';
        }
    }




}


function MM_swapImgRestore() { //v3.0
    var i, x, a = document.MM_sr; for (i = 0; a && i < a.length && (x = a[i]) && x.oSrc; i++) x.src = x.oSrc;
}

function MM_preloadImages() { //v3.0
    var d = document; if (d.images) {
        if (!d.MM_p) d.MM_p = new Array();
        var i, j = d.MM_p.length, a = MM_preloadImages.arguments; for (i = 0; i < a.length; i++)
            if (a[i].indexOf("#") != 0) { d.MM_p[j] = new Image; d.MM_p[j++].src = a[i]; } 
    }
}

function MM_findObj(n, d) { //v4.01
    var p, i, x; if (!d) d = document; if ((p = n.indexOf("?")) > 0 && parent.frames.length) {
        d = parent.frames[n.substring(p + 1)].document; n = n.substring(0, p);
    }
    if (!(x = d[n]) && d.all) x = d.all[n]; for (i = 0; !x && i < d.forms.length; i++) x = d.forms[i][n];
    for (i = 0; !x && d.layers && i < d.layers.length; i++) x = MM_findObj(n, d.layers[i].document);
    if (!x && d.getElementById) x = d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
    var i, j = 0, x, a = MM_swapImage.arguments; document.MM_sr = new Array; for (i = 0; i < (a.length - 2); i += 3)
        if ((x = MM_findObj(a[i])) != null) { document.MM_sr[j++] = x; if (!x.oSrc) x.oSrc = x.src; x.src = a[i + 2]; }
}


function MM_reloadPage(init) {  //reloads the window if Nav4 resized
    if (init == true) with (navigator) {
        if ((appName == "Netscape") && (parseInt(appVersion) == 4)) {
            document.MM_pgW = innerWidth; document.MM_pgH = innerHeight; onresize = MM_reloadPage;
        } 
    }
    else if (innerWidth != document.MM_pgW || innerHeight != document.MM_pgH) location.reload();
}
MM_reloadPage(true);

function highlightFPNav(cell) {
    if (cell == 'tdLeftNavTour') {
        tdLeftNavTour.style.background = 'none';
        tdLeftNavTour.style.textIndent = '0';
        tdLeftNavTour.style.backgroundColor = '#3f3015';
    } else {
        cell.style.backgroundColor = '#3f3015';
    }
}

function unhighlightFPNav(cell) {
    if (cell == 'tdLeftNavTour') {
        tdLeftNavTour.style.background = 'url(images/buttons/btnVirtualTour.gif) no-repeat';
        tdLeftNavTour.style.height = '42px';
        tdLeftNavTour.style.color = '#DDB04B';
        tdLeftNavTour.style.textIndent = '-999em';
    } else {
        cell.style.backgroundColor = '#685742';
    }
}

function openFloorPlanWindow(whichOne) {
    fpwindow = window.open(whichOne, 'window1', 'left=20,top=20,width=640,height=580,toolbar=0,resizable=0,scrollbars=0');
    fpwindow.focus();
}

function highlightFPLink(txtLink) {
    txtLink.style.color = 'white';
}

function unhighlightFPLink(txtLink) {
    txtLink.style.color = '#dddddd';
}

// adding map scripting


function MM_callJS(jsStr) { //v2.0
    return eval(jsStr)
}


function highlightMap(divTag) {
    divTag.style.backgroundColor = '#464491';
    divTag.style.color = 'white';
}

function highlightMapRed(divTag) {
    divTag.style.backgroundColor = '#ff0000';
    divTag.style.color = 'white';
}

function unhighlightMap(divTag) {
    divTag.style.backgroundColor = '#b4ac7c';
    divTag.style.color = 'black';
}

function playMusic() {
    if (!window.screenLeft) {
        windowCoordinatesLeft = '200px';
        windowCoordinatesTop = '200px';
    }
    else {
        windowCoordinatesLeft = window.screenLeft;
        windowCoordinatesTop = window.screenTop;
    }
    mpwindow = window.open('musicPlayer.asp', 'mpwindow', 'left=' + windowCoordinatesLeft + ', top=' + windowCoordinatesTop + ', width=180,height=60,toolbar=0,scrollbars=0');
    self.focus();
}

function stopMusic() {
    if (!window.screenLeft) {
        windowCoordinatesLeft = '200px';
        windowCoordinatesTop = '200px';
    }
    else {
        windowCoordinatesLeft = window.screenLeft;
        windowCoordinatesTop = window.screenTop;
    }
    mpwindow = window.open('musicPlayer.asp', 'mpwindow', 'left=' + windowCoordinatesLeft + ', top=' + windowCoordinatesTop + ', width=180,height=60,toolbar=0,scrollbars=0');
    mpwindow.close();
    mpwindow = "";
    self.focus();
}



function dogBark() {
    if (!window.screenLeft) {
        windowCoordinatesLeft = '200px';
        windowCoordinatesTop = '200px';
    }
    else {
        windowCoordinatesLeft = window.screenLeft;
        windowCoordinatesTop = window.screenTop;
    }
    mpwindowBark = window.open('barkPlayer.asp', 'mpwindowBark', 'left=' + windowCoordinatesLeft + ', top=' + windowCoordinatesTop + ', width=180,height=60,toolbar=0,scrollbars=0');
    self.focus();

}


//-->
