﻿function CreateBookmarkLink() {
    bookmarkurl = "http://www.xapa.com/"
    bookmarktitle = "Xapa Vacations | All Inclusive | Great Deals on Travel Packages"
    if (document.all)
        window.external.AddFavorite(bookmarkurl,bookmarktitle)
    else {
        var chr = 'CTRL-D';
        var agt = navigator.userAgent.toLowerCase();
        if (agt.substr(agt.indexOf('opera') + 6, 1) < 9) chr = 'CTRL-T';
        alert('Press '+chr+' to bookmark this page.');
    
    //else if (window.sidebar.addPanel != null) {                           // Mozilla Firefox Bookmark
    
    //window.sidebar.addPersistentPanel(bookmarktitle, bookmarkurl, "");
    }
    return;

    title = "Xapa Vacations | All Inclusive | Great Deals on Travel Packages";
    url = "http://www.xapa.com/";

    if (window.sidebar.addPanel!=null) {                           // Mozilla Firefox Bookmark
        window.sidebar.addPanel(title, url, "");

    } else if (window.external) {                   // IE Favorite
        window.external.AddFavorite(url, title);

    } else if (window.opera && window.print) {       // Opera Hotlist
        return true;
    } else {
        $('.btnBookmark').hide();
    }
}
function genericDealPopup(dealID) {
    var domain = document.location.host;
    var url = 'http://' + domain + '/XapaDeal.aspx?ID=' + dealID;

    var myRadwindow = window.radopen(null, null);
    myRadwindow.setUrl(url);
    if (dealID != "75minutes") {
        myRadwindow.setSize(575, 530);
    } else {
        myRadwindow.setSize(575, 395);
    }
    myRadwindow.set_modal(true);
    myRadwindow.set_status(" ");
    myRadwindow.Center();
    //myRadwindow.add_close(closeGenericWindow);
    return false;
}
function mailingListPopup() {
    var domain = document.location.host;
    var url = 'http://' + domain + '/MailSignup.aspx';

    var myRadwindow = window.radopen(null, null);
    myRadwindow.setUrl(url);
    myRadwindow.setSize(575, 300);
    myRadwindow.set_modal(true);
    myRadwindow.set_status(" ");
    myRadwindow.Center();
    return false;
}
function DealLocation() { }
DealLocation.radWindow = null;
DealLocation.showLocations = function() {
    var domain = document.location.host;
    var url = 'http://' + domain + '/XapaDealLocation.aspx';

    this.radwindow = window.radopen(null, null);
    this.radwindow.setUrl(url);
    this.radwindow.setSize(400, 400);
    this.radwindow.set_modal(false);
    this.radwindow.set_status(" ");
    this.radwindow.Center();
    return false;
}
DealLocation.change = function(newLoc) {
    var today = new Date();
    today.setTime(today.getTime());

    /*
    if the expires variable is set, make the correct
    expires time, the current script below will set
    it for x number of days, to make it for hours,
    delete * 24, for minutes, delete * 60 * 24
    */
    var expires = 10 * 365 * 1000 * 60 * 60 * 24; // 10 years
    var expires_date = new Date(today.getTime() + (expires));

    document.cookie = "location=" + escape(newLoc) + ";expires=" + expires_date.toGMTString();

    $('#ctl00_dealLocation').val(newLoc);
    geoLocation = newLoc;
    parent.RotatorInit();
    $('html, body').animate({ scrollTop: 0 }, 'fast');
    this.radwindow.Close();
}