function open_FD() {
    popup = window.open("http://www.pleasantholidays.com/PleasantHolidaysWeb/PartnerLinkCmd.do?Partner_OAPartnerOID=partnerCode__.__53888__..__webSerialNumber__.__1203& TravelPackage_TravelPackagePackageOID=corporationCode__.__PTS__..__productCode__.__PHI__..__atlasPackageCode__.__FLY DRIVE__..__mainDestinationCode__.__HAW__..__packageTypeCode__.__FD", "res_mainwindow", "width=761,height=550,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
}

function open_HO() {
    popup = window.open("http://www.pleasantholidays.com/PleasantHolidaysWeb/PartnerLinkCmd.do?Partner_OAPartnerOID=partnerCode__.__53888__..__webSerialNumber__.__1203& TravelPackage_TravelPackagePackageOID=corporationCode__.__PTS__..__productCode__.__PHI__..__atlasPackageCode__.__IND__..__mainDestinationCode__.__HAW__..__packageTypeCode__.__HO", "res_mainwindow", "width=761,height=550,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
}

function open_AH() {
    popup = window.open("http://www.pleasantholidays.com/PleasantHolidaysWeb/PartnerLinkCmd.do?Partner_OAPartnerOID=partnerCode__.__53888__..__webSerialNumber__.__1203& TravelPackage_TravelPackagePackageOID=corporationCode__.__PTS__..__productCode__.__PHI__..__atlasPackageCode__.__IND__..__mainDestinationCode__.__HAW__..__packageTypeCode__.__AH", "res_mainwindow", "width=761,height=550,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
}

function open_CP() {
    popup = window.open("http://www.pleasantholidays.com/PleasantHolidaysWeb/PartnerLinkCmd.do?Partner_OAPartnerOID=partnerCode__.__53888__..__webSerialNumber__.__1203& TravelPackage_TravelPackagePackageOID=corporationCode__.__PTS__..__productCode__.__PHI__..__atlasPackageCode__.__IND__..__mainDestinationCode__.__HAW__..__packageTypeCode__.__CP", "res_mainwindow", "width=761,height=550,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
}

function open_win() {
    popup = window.open("http://www.pleasantholidays.com/webapp/wcs/stores/servlet/PartnerLinkCmd?Partner_PartnerOID=partnerCode__.__53888__..__webSerialNumber__.__1203&c=Lnk&n=GoHaw&r=gohawaiianvacations.com&t=aff", "res_mainwindow", "width=761,height=550,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
}

function open_spcl() {
    popup = window.open("http://www.pleasantholidays.com/PleasantHolidaysWeb/SpecialsDepartureToDestinationDisplay.do?CityOID=cityCode__.__LAX&key_MainDestinationOID=code__.__HAW&Partner_OAPartnerOID=partnerCode__.__53888__..__webSerialNumber__.__1203&c=Lnk&n=GoHaw&r=gohawaiianvacations.com&t=aff", "res_mainwindow", "width=761 height=550,toolbar=0,location=0,directories=0,status=1,menubar=1,scrollbars=1,resizable=1");
}

function Show_360(propID) {
    winMap = window.open("360/_" + propID + "/_property.htm", "Show_360", "height=460,width=301,cellpadding=0, cellspacing=0, toolbar=no,menubar=no,srollbars=no,resizable=yes,top=5, location=no,directories=no,status=no");
}

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_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 openWindow(pageName) {

    win1 = window.open(pageName,
"win1", "toolbar=no,location=no,status=no,scrollbars=no,resizable=no,width=580,height=538");

    win1.document.open;
    win1.focus();
}

function location_open(link) {
    var locationWindow = window.open(link, "Location", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=365,height=465');
    locationWindow.document.open;
    locationWindow.focus();
}


function vtour_open(link) {
    var locationWindow = window.open(link, "Location", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=525,height=525');
    locationWindow.document.open;
    locationWindow.focus();
}


function whats_this(link) {
    var whatsThisWindow = window.open(link, "WhatsThis", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=500,height=505');
    whatsThisWindow.document.open;
    whatsThisWindow.focus();
}

function photo_open(link, width, height) {
    var photoWindow = window.open(link, "Photo", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=0,width=' + width + ',height=' + height);
}

function OnToggleTOCLevel1(level2ID) {
    var elemLevel2 = document.getElementById(level2ID);
    if (elemLevel2.style.display == 'none') {
        elemLevel2.style.display = '';
    }
    else {
        elemLevel2.style.display = 'none';
    }
}

function autoCap(obj) {
    var newString;
    var pos = 0;
    var len;
    var preString;
    var postString;

    newString = (obj.value).toLowerCase();
    len = 1;
    pos = newString.indexOf(" ");
    if (pos == -1) {
        newString = ((newString.charAt(0)).toUpperCase()) + (newString.substring(1));
    } else {
        while (pos != -1) {
            preString = newString.substring(0, pos);
            preString = ((preString.charAt(0)).toUpperCase()) + (preString.substring(1));
            postString = newString.substring(pos + len, newString.length);
            postString = ((postString.charAt(0)).toUpperCase()) + (postString.substring(1));
            newString = preString + "," + postString;
            pos = newString.indexOf(" ");
        }
        pos = newString.indexOf(",");
        while (pos != -1) {
            preString = newString.substring(0, pos)
            postString = newString.substring(pos + len, newString.length);
            newString = preString + " " + postString;
            pos = newString.indexOf(",");
        }
    }
    obj.value = newString;
    obj.style.backgroundColor = '#ffffff';
}

function pviiW3Cbg(obj, pviiColor) { //v1.1 by Project VII
    obj.style.backgroundColor = pviiColor
}


function showpano(attractionid) {
    var settings = 'width=340,height=525,top=5,left=5,scrollbars=no,location=no,directories=no,status=no,menubar=no,toolbar=no,resizable=no';
    var win = window.open('http://display.maxvr.com/mapviewer/panoviewer1_1382.asp?pic=' + attractionid, 'maxvrviewer', settings);
    win.focus();
}


function hideElement(i) {
    var e = document.getElementById(i);
    if (e) {
        e.style.display = 'none';
    }
}

function hideAll() {
    hideElement('intro');
    hideElement('dining');
    hideElement('entry');
    hideElement('money');
    hideElement('weather');
    hideElement('mapofarea');
    hideElement('fun');
    hideElement('health');
    hideElement('flying');
}

function showElement(i) {
    var e = document.getElementById(i);
    if (e) {
        e.style.display = 'block';
        e.style.visibility = 'visible';
    }
}

function whats_this1(link) {
    var whatsThisWindow = window.open(link, "WhatsThis1", 'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=0,width=990,height=550');
    whatsThisWindow.document.open;
}

if (!ghvApp) var ghvApp = Sys.Application;
ghvApp.add_load(custom_rollovers);

function custom_rollovers() {

    var rollover = jQuery.noConflict();
    var src = "";

    rollover('img.customhover').mouseover(function () {
        src = rollover(this).attr("src");
        rollover(this).attr("src", rollover(this).attr("over"));
    });

    rollover('img.customhover').mouseout(function () {
        rollover(this).attr("src", src);
    });

}

function getParameterByName(name) {
    name = name.replace(/[\[]/, "\\\[").replace(/[\]]/, "\\\]");
    var regexS = "[\\?&]" + name + "=([^&#]*)";
    var regex = new RegExp(regexS);
    var results = regex.exec(window.location.href);
    if (results == null)
        return "";
    else
        return decodeURIComponent(results[1].replace(/\+/g, " "));
}


function OneBack(){
var miref=document.referrer;
document.location.href=miref;
return;
} 
