

s_userAgent = window.navigator.userAgent;
KON = (s_userAgent.indexOf("KHTML") > -1) ? 1 : 0;
isKON = KON;
isOp = (s_userAgent.toLowerCase().indexOf("opera") > -1) ? 1 : 0;
posX = 0;
posY = 0;
if (!Array.prototype.push) {
    Array.prototype.push = function(e){
        this[this.length] = e;
    };
}
function $(){
    var elements = new Array();
    for (var i = 0; i < arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == "string") {
            element = document.getElementById(element);
        }
        if (arguments.length == 1) {
            return element;
        }
        elements.push(element);
    }
    return elements;
}

function launchWindow(url, w, h){
    winName = "_new";
    if (!h) {
        popHeight = screen.availHeight - 100;
    }
    else {
        popHeight = h;
    }
    winParams = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + popHeight;
    newwin = window.open(url, winName, winParams);
    newwin.focus();
}

function SetCookie(cookieName, cookieValue, nDays){
    var today = new Date();
    var expire = new Date();
    if (nDays == null || nDays == 0) {
        nDays = 1;
    }
    expire.setTime(today.getTime() + 24 * 60 * 60 * 1000 * nDays);
    document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString();
}

function GetCookie(Name){
    var search = Name + "=";
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length;
            }
            returnvalue = unescape(document.cookie.substring(offset, end));
        }
    }
    return returnvalue;
}

function pauseJS(mill){
    var d = new Date();
    var cD = null;
    do {
        cD = new Date();
    }
    while (cD - d < mill);
}

function vsTrackClick(VStrackingUrl, VS_var, rtAnchor){
    var __img = new Image(1, 1);
    var rnum = parseInt((Math.random() * Math.random()) * 100000000);
    __img.src = VStrackingUrl + "?WAPageName=" + VS_var + "&rand=" + rnum;
    if (typeof(rtAnchor) == "object" && rtAnchor.tagName.toLowerCase() == "a") {
        pauseJS(100);
    }
    else {
        return false;
    }
}

function vsRedirectClick(re, wap){
    window.location.href = ("/vstrack?WAPageName=" + wap + "&dst=" + re.href);
}

function noneBlock(){
    a_arguments = noneBlock.arguments;
    for (var i = 0; i < a_arguments.length; i++) {
        a_nB = a_arguments[i].split("!");
        s_nBit = a_nB[0];
        i_nBdisplay = a_nB[1];
        o_showHide = document.getElementById(s_nBit);
        if(o_showHide) o_showHide.style.display = (i_nBdisplay == 0) ? "none" : (i_nBdisplay == 1) ? "block" : (i_nBdisplay == 2) ? "inline" : "";
    }
}

function noneBlock_v2(){
    var a_args = noneBlock_v2.arguments;
    for (var i = a_args.length - 1; i > -1; i--) {
        var a_nb2 = a_args[i].split("|");
        var o_block = document.getElementById(a_nb2[0]);
        var o_img = document.getElementById(a_nb2[1]);
        switch (a_nb2[2]) {
            case "flip":
                switch (o_img.src.indexOf("show")) {
                    case -1:
                        o_img.src = o_img.src.replace("hide", "show");
                        o_block.style.display = "none";
                        break;
                    default:
                        o_img.src = o_img.src.replace("show", "hide");
                        o_block.style.display = a_nb2[3];
                }
                break;
            default:
                o_img.src = (a_nb2[2] != "none") ? o_img.src.replace("show", "hide") : o_img.src.replace("hide", "show");
                o_block.style.display = a_nb2[2];
        }
    }
}

function showHide(){
    for (i = 0; i < showHide.arguments.length; i++) {
        o_showHide = document.getElementById(showHide.arguments[i]);
        s_showHide = (o_showHide.style.display != "") ? o_showHide.style.display : "none";
        o_showHide.style.display = (s_showHide == "none") ? (o_showHide.nodeName == "SPAN") ? "inline" : "block" : "none";
    }
}

function swapText(el, cn, txt1, txt2){
    var d = document.getElementsByTagName("*");
    dL = d.length;
    for (i = 0; i < dL; i++) {
        if (d[i].className == cn && d[i].id != el) {
            d[i].innerHTML = txt1;
        }
        else {
            document.getElementById(el).innerHTML == txt1 ? nTxt = txt2 : nTxt = txt1;
            document.getElementById(el).innerHTML = nTxt;
        }
    }
}

function visHidden(){
    for (i = 0; i < visHidden.arguments.length; i++) {
        o_visHidden = document.getElementById(visHidden.arguments[i]);
        s_visHidden = (o_visHidden.style.visibility != "") ? o_visHidden.style.visibility : "visible";
        o_visHidden.style.visibility = (s_visHidden == "visible") ? "hidden" : "visible";
    }
}

function jump(menu){
    var loc = menu[menu.selectedIndex].value.split("|");
    if (loc.length == 2) {
        window.open(loc[1], loc[0]);
    }
}

function cssSwitch(){
    a_cS = cssSwitch.arguments;
    for (i = 0; i < a_cS.length; i++) {
        a_cSsplit = (a_cS[i].indexOf("&") != -1) ? a_cS[i].split("&") : a_cS[i].split("!");
        document.getElementById(a_cSsplit[0]).className = a_cSsplit[1];
    }
}

function cssSwitch2(s_cSValue){
    a_cS = s_cSValue.split("&");
    o_cS = document.getElementById(a_cS[0]);
    if (o_cS.style.display == "none") {
        document.getElementById(a_cS[1]).className = a_cS[3];
    }
    else {
        document.getElementById(a_cS[1]).className = a_cS[2];
    }
}

function fltrObj(s_fOValue){
    a_fO = s_fOValue.split("|");
    document.getElementById(a_fO[0]).innerHTML = a_fO[1];
}

function funSort(){
    a_fSarg = funSort.arguments;
    for (var i = 0; i < a_fSarg.length; i++) {
        (a_fSarg[i].indexOf("!") > 0) ? noneBlock(a_fSarg[i]) : (a_fSarg[i].indexOf("|") > 0) ? fltrObj(a_fSarg[i]) : cssSwitch(a_fSarg[i]);
    }
}

function chkOther(form){
    var reason = document.getElementById("reason");
    var num_reason = reason.options[reason.selectedIndex].value;
    if (num_reason == "HE") {
        document.getElementById("otherReason").style.display = "block";
    }
    else {
        document.getElementById("otherReason").style.display = "none";
    }
}

function openHere(){
    a_args = openHere.arguments;
    eval("window." + a_args[1] + ".location.replace(a_args[2])");
    o_content = document.getElementById("mainContent");
    if (a_args[3]) {
        o_div = document.getElementById(a_args[3]);
    }
    if (!o_content) {
        o_content = 0;
    }
    if (window.event) {
        yPos = window.event.clientY;
        xPos = window.event.clientX;
    }
    else {
        if (document.getElementById && !document.all) {
            xPos = a_args[0].clientX;
            yPos = a_args[0].clientY;
        }
        else {
            xPos = 0;
            yPos = 0;
        }
    }
    i_scrollAmount = (isKON) ? 0 : document.body.scrollTop;
    o_div.style.top = yPos + 10 - o_content.offsetTop + i_scrollAmount;
    o_div.style.left = xPos + 10 - o_content.offsetLeft;
    o_div.style.visibility = "visible";
}

function emailValue(){
    emailval = document.getElementById("email").value;
}

function clearVerify(){
    newemailval = document.getElementById("email").value;
    confemailval = document.getElementById("confemail").value;
    if ((newemailval != emailval) && (confemailval != newemailval)) {
        document.getElementById("confemail").value = "";
    }
}

var o_popurl = "#";
var o_popwindow = 0;
var b_popwindow = 1;
function checkpopUp(){
    b_popwindow = (o_popwindow) ? o_popwindow.closed : 1;
    if (b_popwindow) {
        document.location = o_popurl;
    }
    else {
        o_popwindow.focus();
    }
}

function popUp(s_url, s_name, s_attrib){
    o_popurl = s_url;
    o_popwindow = window.open(s_url, s_name, s_attrib);
}

s_userAgent = window.navigator.userAgent;
isIE = (navigator.userAgent.indexOf("MSIE") > -1) ? 1 : 0;
isWin = (navigator.userAgent.indexOf("Windows") > -1) ? 1 : 0;
isWinIE = (isWin && isIE) ? 1 : 0;
function showrow(s_tableid){
    o_table = document.getElementById(s_tableid);
    a_tr = o_table.getElementsByTagName("tr");
    for (var i = 0; i < a_tr.length; i++) {
        if (a_tr[i].className == "hiderow") {
            a_tr[i].style.display = (isWinIE) ? "inline" : "table-row";
        }
    }
}

function showrowlinks(o_link1, o_link2){
    o_link1.parentNode.innerHTML = o_link1.innerHTML;
    o_link2.parentNode.innerHTML = o_link2.innerHTML;
}

function dataSwitchPhone(i_Select){
    document.CheckoutForm.telephoneNumber.value = a_ccDisplay[i_Select];
    document.CheckoutForm.telephoneNumberID.value = phoneIDs[i_Select];
}

function dataSwitchAlternatePhone(i_Select){
    document.CheckoutForm.alternateTelephoneNumber.value = a_ccDisplay[i_Select];
    document.CheckoutForm.alternateTelephoneNumberID.value = phoneIDs[i_Select];
}

var o_slide;
var i_slideH;
var i_slidespeed;
var i_slidedelay;
var i_initslidedelay;
var t_slidetimer = null;
function slideDiv(s_slideid, i_speed, i_delay, i_initdelay){
    o_slide = document.getElementById(s_slideid);
    i_slidespeed = i_speed;
    i_slidedelay = i_delay;
    i_initslidedelay = i_initdelay;
    i_slideH = o_slide.offsetHeight;
    t_slidetimer = setTimeout("doSlideDiv()", i_initslidedelay);
}

function doSlideDiv(){
    if (i_slideH > 0) {
        o_slide.style.height = i_slideH + "px";
        i_slideH -= i_slidespeed;
        t_slidetimer = setTimeout("doSlideDiv()", i_slidedelay);
    }
    else {
        i_slideH = 0;
        o_slide.style.height = "0px";
        o_slide.style.clip = "rect(auto auto 0px auto)";
        clearTimeout(t_slidetimer);
    }
}

function findairport(s_url, s_form, s_input){
    s_popurl = s_url;
    s_popurl += "?formName=" + document.getElementById(s_form).name + "&fieldName=" + document.getElementById(s_input).name;
    o_popwindow = window.open(s_popurl, "airportlookup", "height=300,width=450,scrollbars=yes");
    if (o_popwindow) {
        o_popwindow.focus();
    }
}

var b_loaded;
function setUpJSF(s_formname){
    b_loaded = true;
    o_cbnav = document.getElementById("cbNav");
    if (o_cbnav) {
        a_radio = o_cbnav.getElementsByTagName("input");
        for (var i = 0; i < a_radio.length; i++) {
            _s_formname = a_radio[i].value;
            if (a_radio[i].checked) {
                document.getElementById(_s_formname).style.display = "block";
            }
            else {
                document.getElementById(_s_formname).style.display = "none";
            }
        }
    }
    s_formname = s_formname || _s_formname;
    s_formbit = getFormPrefix(s_formname);
    if (s_formbit != "") {
        multirooms(s_formbit + "totalrooms");
    }
}

function maintainState(o_input){
    if (!b_loaded || !document.cbNav) {
        return false;
    }
    a_bit = o_input.id.split("_");
    s_bit = a_bit[1];
    for (i = 0; i < document.cbNav.nav.length; i++) {
        a_formbit = document.cbNav.nav[i].value.split("form");
        s_formbit = a_formbit[1];
        o_formelement = document.getElementById(s_formbit + "_" + s_bit);
        if (eval("document." + document.cbNav.nav[i].value) && o_formelement != o_input) {
            if (o_formelement && o_formelement != o_input && o_input.type != "radio") {
                if (o_formelement.type == "select-one" && o_formelement.length > o_input.selectedIndex) {
                    o_formelement.selectedIndex = o_input.selectedIndex;
                }
                else {
                    if (o_formelement.type == o_input.type) {
                        o_formelement.value = o_input.value;
                    }
                }
            }
            else {
                a_input = eval("document." + document.cbNav.nav[i].value + "." + o_input.name);
                if (a_input) {
                    for (j = 0; j < a_input.length; j++) {
                        if (a_input[j] != o_input && a_input[j].value == o_input.value) {
                            a_input[j].checked = "checked";
                        }
                    }
                }
            }
        }
    }
}

function globalMaintainState(o_input){
    oTag = o_input.tagName.toLowerCase();
    tagCheck = "select input";
    if (!o_input.id || tagCheck.indexOf(oTag) == -1) {
        return false;
    }
    if (!o_input.type) {
        return false;
    }
    oFormType = o_input.type.toLowerCase();
    a_bit = o_input.id.split("_");
    s_bit = a_bit[1];
    aForms = document.forms;
    for (h = 0; h < aForms.length; h++) {
        oFormTag = aForms[h].getElementsByTagName(oTag);
        for (i = 0; i < oFormTag.length; i++) {
            o_bit = oFormTag[i].id.split("_");
            if (oFormTag[i].id != o_input.id) {
                if (o_bit[1] == s_bit) {
                    switch (oFormType) {
                        case "hidden":
                        case "text":
                            oFormTag[i].value = o_input.value;
                            break;
                        case "select-one":
                            o_index = o_input.selectedIndex;
                            o_val = o_input.options[o_index].text;
                            o_formTagLength = oFormTag[i].options.length;
                            for (j = 0; j < o_formTagLength; j++) {
                                if (oFormTag[i].options[j].text == o_val) {
                                    oFormTag[i].selectedIndex = j;
                                }
                            }
                            break;
                        case "radio":
                        case "checkbox":
                            o_input.checked ? oFormTag[i].checked = true : oFormTag[i].checked = false;
                            break;
                    }
                }
            }
        }
    }
}

function getFormPrefix(s_id){
    s_formbit = s_id.replace("form", "");
    switch (s_formbit) {
        case "HO":
        case "FH":
            return s_formbit + "_";
            break;
        default:
            return "";
    }
}

function multiroomchild(i_rooms, i_maxrooms, s_prefix){
    o_childrooms = document.getElementById(s_prefix + "multichildroom");
    o_childrooms.style.display = "none";
    for (var i = 1; i <= i_maxrooms; i++) {
        document.getElementById(s_prefix + "childroom" + i).style.display = "none";
    }
    for (var i = 0; i < i_rooms; i++) {
        o_children = document.getElementById(s_prefix + "f_child" + (i + 1));
        i_ages = o_children.selectedIndex;
        o_childrow = document.getElementById(s_prefix + "childroom" + (i + 1));
        if (i_ages > 0) {
            o_childrooms.style.display = "block";
            o_childrow = document.getElementById(s_prefix + "childroom" + (i + 1));
            a_select = o_childrow.getElementsByTagName("select");
            for (var j = 0; j < o_children.options.length - 1; j++) {
                a_select[j].parentNode.style.display = (j < i_ages) ? "block" : "none";
            }
            o_childrow.style.display = "block";
        }
        else {
            o_childrow.style.display = "none";
        }
    }
}

function multirooms(s_rooms){
    o_rooms = document.getElementById(s_rooms);
    s_prefix = getFormPrefix(o_rooms.form.id);
    i_rooms = parseInt(o_rooms.options[o_rooms.selectedIndex].text);
    i_maxrooms = parseInt(o_rooms.options[o_rooms.options.length - 1].text);
    for (var i = 0; i < i_maxrooms; i++) {
        document.getElementById(s_prefix + "room" + (i + 1)).style.display = "none";
    }
    for (var i = 0; i < i_rooms; i++) {
        document.getElementById(s_prefix + "room" + (i + 1)).style.display = "block";
    }
    if (document.getElementById(s_prefix + "multichildroom")) {
        multiroomchild(i_rooms, i_maxrooms, s_prefix);
    }
}

function modifysearch(s_mod, s_modicon){
    o_mod = document.getElementById(s_mod);
    o_modicon = document.getElementById(s_modicon);
    switch (modifysearch.arguments[2]) {
        case 1:
            o_mod.style.display = "block";
            if ((o_modicon.src.indexOf("show") > -1)) {
                o_modicon.src = o_modicon.src.replace("show", "hide");
            }
            break;
        default:
            o_mod.style.display = (o_mod.style.display == "none") ? "block" : "none";
            o_modicon.src = (o_modicon.src.indexOf("show") > -1) ? o_modicon.src.replace("show", "hide") : o_modicon.src.replace("hide", "show");
    }
}

function newImage(s_name, s_url, i_height, i_width){
    this.name = s_name;
    this.url = s_url;
    this.height = i_height;
    this.width = i_width;
    this.cache = new Image();
    this.cache.src = s_url + s_name;
}

var i_slideimg = 0;
var a_slideimages = new Array();
function setslideheight(){
    i_slideheight = 0;
    o_slideheight = document.getElementById("slideimgbox");
    for (var i = 0; i < a_slideimages.length; i++) {
        if (a_slideimages[i].height > i_slideheight) {
            i_slideheight = a_slideimages[i].height;
        }
    }
    o_slideheight.style.height = i_slideheight;
}

function doslideshow(i_dir, o_links){
    a_slideshow = o_links.getElementsByTagName("a");
    o_slideimg = document.getElementById("slideimg");
    o_currentslide = document.getElementById("currentslide");
    switch (i_dir) {
        case -1:
            if (i_dir + i_slideimg == 0) {
                a_slideshow[0].style.visibility = "hidden";
            }
            a_slideshow[1].style.visibility = "visible";
            break;
        case 1:
            if (i_dir + i_slideimg == (a_slideimages.length - 1)) {
                a_slideshow[1].style.visibility = "hidden";
            }
            a_slideshow[0].style.visibility = "visible";
            break;
    }
    o_slideimg.src = a_slideimages[i_slideimg + i_dir].cache.src;
    i_slideimg += i_dir;
    o_currentslide.firstChild.nodeValue = i_slideimg + 1;
}

function jump(menu){
    var loc = menu[menu.selectedIndex].value.split("|");
    if (loc.length == 2) {
        window.open(loc[1], loc[0]);
    }
}

function showhidestate(s_country, s_statefield){
    o_country = document.getElementById(s_country);
    o_statefield = document.getElementById(s_statefield);
    s_value = o_country.options[o_country.selectedIndex].value;
    switch (s_value.toLowerCase()) {
        case "us":
        case "ca":
            o_statefield.style.display = "block";
            break;
        default:
            o_statefield.style.display = "none";
    }
}

function amenErrorCheck(o_checkbox){
    s_checkboxname = o_checkbox.name;
    a_checkbox = eval("o_checkbox.form." + s_checkboxname);
    x = 0;
    for (i = 0; i < a_checkbox.length; i++) {
        if (a_checkbox[i].checked) {
            x++;
        }
    }
    for (i = 0; i < a_checkbox.length; i++) {
        a_checkbox[i].disabled = (x >= 3 && !a_checkbox[i].checked) ? true : false;
    }
}

function showHideDiv(showHide){
    for (i = 0; i < showHideDiv.arguments.length; i++) {
        o_showHide = document.getElementById(showHideDiv.arguments[i]);
        s_showHide = (o_showHide.style.display != "") ? o_showHide.style.display : "none";
        o_showHide.style.display = (s_showHide == "none") ? (o_showHide.nodeName == "SPAN") ? "inline" : "block" : "none";
    }
}

a_amenLabel = new Array("Fitness Room", "Dining Room", "Swimming Pool", "Kids Activities", "Shuttle Service", "Business Center", "Meeting Rooms", "Data Port", "Golf Course", "Tennis Courts", "Game Room", "Pets Allowed", "Drycleaning Onsite", "Wheelchair Accessible", "Non-Smoking Available");
a_amenLabelOff = new Array("No Fitness Room", "No Dining Room", "No Swimming Pool", "No Kids Activities", "No Shuttle Service", "No Business Center", "No Meeting Rooms", "No Data Port", "No Golf Course", "No Tennis Courts", "No Game Room", "No Pets Allowed", "No Drycleaning Onsite", "No Wheelchair Accessible", "No Non-Smoking Available");
s_amenOtherOffers = "Other Amenities Offered:";
a_amenImgOff = new Array('<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_fitness_off.gif"name="fitness_facility_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Fitness Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dining_off.gif"name="dining_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Dining Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pool_off.gif"name="swimming_pool_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Swimming Pool">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_kids_off.gif"name="kids_allowed_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Kids Activities">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_shuttle_off.gif"name="shuttle_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Shuttle Service">', '<imgsrc="http://rg.travelocity.com.edgesuite.net/graphics/amenity_businesscenter_off.gif"name="business_center_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Business Center">', '<imgsrc="http://rg.travelocity.com.edgesuite.net/graphics/amenity_meetingroom_off.gif"name="meeting_room_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Meeting Rooms">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_data_off.gif"name="data_port_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Data Port">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_golf_off.gif"name="golf_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Golf Course">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_tennis_off.gif"name="tennis_court_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Tennis Courts">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_casino_off.gif"name="game_room_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Game Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pet_off.gif"name="pets_allowed_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Pets Allowed">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dryclean_off.gif"name="dry_cleaning_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Drycleaning Onsite">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_handicap_off.gif"name="wheel_chair_access_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Wheelchair Accessible">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/icon_nonSmo_off.gif"name="nonsmoking_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Non-Smoking Available">');
a_amenImgOn = new Array('<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_fitness.gif" name="fitness_facility_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Fitness Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dining.gif" name="dining_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Dining Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pool.gif" name="swimming_pool_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Swimming Pool">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_kids.gif" name="kids_allowed_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Kids Activities">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_shuttle.gif" name="shuttle_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Shuttle Service">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_businesscenter.gif" name="business_center_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Business Center">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_meetingroom.gif" name="meeting_room_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Meeting Rooms">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_data.gif" name="data_port_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Data Port">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_golf.gif" name="golf_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Golf Course">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_tennis.gif" name="tennis_court_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Tennis Courts">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_casino.gif" name="game_room_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Game Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pet.gif" name="pets_allowed_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Pets Allowed">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dryclean.gif" name="dry_cleaning_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Drycleaning Onsite">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_handicap.gif" name="wheel_chair_access_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Wheelchair Accessible">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/icon_nonSmo.gif" name="nonsmoking_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Non-Smoking Available">');
function buildAmenCell(s_yesno, i_amen){
    s_cell = "";
    s_text = (s_yesno == "Y") ? a_amenLabel[parseInt(i_amen)] : a_amenLabelOff[parseInt(i_amen)];
    s_imgSrc = (s_yesno == "Y") ? a_amenImgOn[parseInt(i_amen)] : a_amenImgOff[parseInt(i_amen)];
    s_cell = "<li>" + s_imgSrc + "<br />" + s_text + "</li>";
    return s_cell;
}

function buildOtherAmenText(s_yesno, i_amen){
    s_cell = "";
    if (s_yesno == "Y") {
        s_text = a_amenLabel[i_amen];
        s_cell = "<li>" + s_text + "</li>";
    }
    return s_cell;
}

function buildOtherAmenities(s_amenities){
    h_ul_1 = "<ul class='noicon'>";
    h_ul_2 = "<ul class='noicon'>";
    var j = 0;
    for (i = 0; i < s_amenities.length; i++) {
        if (s_amenities.charAt(i) == "Y") {
            if (j % 2 == 0) {
                h_ul_1 += buildOtherAmenText(s_amenities.charAt(i), i);
                j = 1;
            }
            else {
                h_ul_2 += buildOtherAmenText(s_amenities.charAt(i), i);
                j = 0;
            }
        }
    }
    h_ul_1 += "</ul>";
    h_ul_2 += "</ul>";
    h_ul = h_ul_1 + h_ul_2;
    return h_ul;
}

function buildAmenities(s_amenities){
    s_ul = '<ul class="amenlist mid">';
    for (i = 0; i < s_amenities.length; i = i + 3) {
        s_ul += buildAmenCell(s_amenities.charAt(i), s_amenities.charAt(i + 1) + s_amenities.charAt(i + 2));
    }
    s_ul += "</ul>";
    return s_ul;
}

function showAmenities(s_url, s_otherAmenities, evt){
    s_amenpopup = buildAmenities(s_url);
    s_amenpopup += '<div class="superclear"></div>';
    s_amenpopup += "<h4>" + s_amenOtherOffers + "</h4>";
    s_amenpopup += buildOtherAmenities(s_otherAmenities);
    s_amenpopup += '<div class="superclear"></div>';
    document.getElementById("amenupdate").innerHTML = s_amenpopup;
    e_event = (window.event) ? window.event : evt;
    i_scrollX = (window.event) ? document.body.scrollLeft : window.scrollX;
    i_scrollY = (window.event) ? document.body.scrollTop : window.scrollY;
    i_mainY = document.getElementById("mainContent").offsetTop;
    posX = e_event.clientX + 10 + i_scrollX;
    posY = e_event.clientY - i_mainY;
    if (!KON) {
        posY += i_scrollY;
    }
    document.getElementById("amenPopUp").style.top = (isOp) ? posY + "px !important" : posY + "px";
    document.getElementById("amenPopUp").style.left = (isOp) ? posX + "px!important" : posX + "px";
    if (document.getElementById("amenPopUp").style.display == "none" || document.getElementById("amenPopUp").style.display == "") {
        showHideDiv("amenPopUp");
    }
}

function add2onload(__fn){
    var fn_onload = window.onload;
    window.onload = function(){
        if (typeof fn_onload == "function") {
            fn_onload();
        }
        __fn();
    };
}

function cb_addrscope(o_select){
    var o_addr;
    if (cb_addrscope.arguments[1]) {
        o_addr = cb_addrscope.arguments[1];
    }
    else {
        o_addr = "address|stateblock|zip";
    }
    var cb_addr = o_addr.split("|");
    var cbPrefix = o_select.id.substr(0, 2);
    var selVal = o_select.options[o_select.selectedIndex].value.toLowerCase();
    if (selVal == "us" || selVal == "ca") {
        for (x in cb_addr) {
            if ($(cbPrefix + cb_addr[x])) {
                noneBlock(cbPrefix + cb_addr[x] + "!1");
            }
        }
    }
    else {
        for (y in cb_addr) {
            if ($(cbPrefix + cb_addr[y])) {
                noneBlock(cbPrefix + cb_addr[y] + "!0");
            }
        }
    }
}

roID = 0;
function needsID(obj){
    if (obj.id === null || obj.id === "") {
        roID++;
        obj.id = "roID" + roID;
    }
}

function formatEvents(o, elist){
    var nolines = elist.replace(/[nr]/g, "");
    var norel = nolines.replace(/this/g, "$('" + o.id + "')");
    var nofocus = norel.replace(/.focus()/gi, "");
    return nofocus;
}

function reloadEvents(oCont){
    var e = $(oCont).getElementsByTagName("*");
    for (var i = 0; i < e.length; i++) {
        var eFunc = "";
        var etag = "";
        var ffunc;
        var n;
        if (e[i].tagName) {
            etag = e[i].tagName.toLowerCase();
        }
        switch (etag) {
            case "input":
                if (e[i].type == "radio" || e[i].type == "checkbox") {
                    if (e[i].getAttribute("onclick") !== null && e[i].getAttribute("onclick") !== "" && e[i].checked) {
                        needsID(e[i]);
                        n = e[i].getAttribute("onclick") + "";
                        ffunc = formatEvents(e[i], n);
                        eFunc += ffunc;
                    }
                    else {
                        if (e[i].getAttribute("onchange") !== null && e[i].getAttribute("onchange") !== "" && e[i].checked) {
                            needsID(e[i]);
                            n = e[i].getAttribute("onchange") + "";
                            ffunc = formatEvents(e[i], n);
                            eFunc += ffunc;
                        }
                    }
                }
                break;
            case "select":
                if (e[i].getAttribute("onchange") !== null && e[i].getAttribute("onchange") !== "") {
                    needsID(e[i]);
                    n = e[i].getAttribute("onchange") + "";
                    ffunc = formatEvents(e[i], n);
                    eFunc += ffunc;
                }
                break;
        }
        if (eFunc !== "") {
            if (eFunc.search(/function/gi) == -1) {
                eval(eFunc);
            }
            else {
                var ef = eFunc.toString();
                ef = ef.substr(ef.search(/{/g) + 1);
                ef = ef.replace(/}/g, "");
                eval(ef);
            }
        }
    }
}

var e_className;
var once_per_session = "0";
var s_navigator = navigator.userAgent.toLowerCase();
var isIE5 = (s_navigator.indexOf("msie 5") > -1 && s_navigator.indexOf("opera") == -1) ? 1 : 0;
var isMac = (s_navigator.indexOf("mac") > -1) ? 1 : 0;
var prevErrorField;
var e_className;
function show_e(s_emsg, o_input){
    if ($("cb-alert")) {
        noneBlock("cb-alert!0");
    }
    $("book-trip").className = "section alert";
    o_from = document.cbErrorMsg;
    o_e = eval("o_from." + s_emsg);
    document.getElementById("cb-error-msg").innerHTML = o_e.value;
    o_input.blur();
    o_input.focus();
    document.getElementById("cb-error").style.display = "block";
    e_className = "cb-efield";
    if (typeof(prevErrorField) == "object") {
        prevErrorField.className = prevErrorField.className.replace(e_className, "");
    }
    prevErrorField = o_input;
    o_input.className = e_className;
}

function clearErrorFields(){
    noneBlock("cb-error!0");
    if ($("cb-alert")) {
        if ($("cb-alert").style.display != "block") {
            $("book-trip").className = "section";
        }
    }
    if (typeof(prevErrorField) == "object") {
        prevErrorField.className = prevErrorField.className.replace(e_className, "");
    }
}

function close_e(){
    $("book-trip").className = "section";
    document.getElementById("cb-error").style.display = "none";
}

function e_checklength(o_input, i_min, i_max){
    b_valid = true;
    if (o_input.value.length < i_min || o_input.value.length > i_max) {
        show_e("e_length", o_input);
        b_valid = false;
    }
    return b_valid;
}

function e_checkspace(o_input){
    b_valid = true;
    if (o_input.value.charCodeAt(0) == 32) {
        show_e("e_space", o_input);
        b_valid = false;
    }
    return b_valid;
}

function e_checkchar(o_input){
    b_valid = true;
    b_charCodeError = false;
    s_checkvalue = o_input.value;
    s_checkvalue = s_checkvalue.toLowerCase();
    for (var i = 0; i < s_checkvalue.length; i++) {
        if (s_checkvalue.charCodeAt(i) != 46 && s_checkvalue.charCodeAt(i) != 47 && s_checkvalue.charCodeAt(i) != 44 && s_checkvalue.charCodeAt(i) != 32 && s_checkvalue.charCodeAt(i) != 39 && (s_checkvalue.charCodeAt(i) < 97 || s_checkvalue.charCodeAt(i) > 122)) {
            b_charCodeError = true;
        }
        if (s_type == "FH") {
            if (s_checkvalue.charCodeAt(i) == 47) {
                b_charCodeError = true;
            }
        }
    }
    return b_valid;
}

function e_same(o_inputT, o_inputF){
    b_valid = true;
    if (o_inputT.value == o_inputF.value) {
        show_e("e_same", o_inputT);
        b_valid = false;
    }
    return b_valid;
}

function e_children(o_select, s_idbit){
    b_valid = true;
    if (o_select.selectedIndex > 0) {
        var k = 1;
        while ($(s_idbit + "-minor" + k) && k <= o_select.selectedIndex) {
            var minorAges = $(s_idbit + "-minor" + k).getElementsByTagName("select")[0];
            if (minorAges.selectedIndex == 0) {
                show_e("e_child", minorAges);
                b_valid = false;
                return b_valid;
            }
            k++;
        }
    }
    return b_valid;
}

function e_dates(o_fromM, o_toM, o_fromD, o_toD){
    b_valid = true;
    if (o_fromM.selectedIndex == o_toM.selectedIndex) {
        if (o_fromD.selectedIndex > o_toD.selectedIndex) {
            show_e("e_date", o_toD);
            b_valid = false;
        }
    }
    else {
        if ((o_fromM.selectedIndex - o_toM.selectedIndex) == 1) {
            show_e("e_date", o_toM);
            b_valid = false;
        }
    }
    return b_valid;
}

function e_validdate(o_date){
    b_valid = true;
    s_odate = o_date.value;
    s_delimitor = (s_odate.indexOf("/") > -1) ? "/" : (s_odate.indexOf(".") > -1) ? "." : (s_odate.indexOf("-") > -1) ? "-" : (s_odate.indexOf(",") > -1) ? "," : "/";
    a_sodate = s_odate.split(s_delimitor);
    if (a_sodate.length != 3) {
        b_valid = false;
    }
    for (var i = 0; i < a_sodate.length; i++) {
        if (isNaN(a_sodate[i]) || a_sodate[i] == "") {
            b_valid = false;
        }
    }
    if (!b_valid) {
        show_e("e_validdate", o_date);
    }
    return b_valid;
}

function e_childrooms(s_type){
    var o_rooms = document.getElementById(s_type + "-rooms");
    var i_rooms = o_rooms.selectedIndex + 1;
    for (var i = 1; i <= i_rooms; i++) {
        var o_children = document.getElementById(s_type + "-minors" + i);
        var i_ages = o_children.selectedIndex + 1;
        if (i_ages != 0) {
            for (var j = 1; j < i_ages; j++) {
                var a_select = $(s_type + "-minor" + j + "room" + i).getElementsByTagName("select")[0];
                if (a_select.selectedIndex == 0) {
                    show_e("e_child", a_select);
                    b_valid = false;
                    return b_valid;
                }
                else {
                    if ($("cb-error").style.display == "block") {
                        noneBlock("cb-error!0");
                    }
                }
            }
        }
    }
    b_valid = true;
    return b_valid;
}

function checkform(){
    a_arguments = checkform.arguments;
    o_form = a_arguments[0];
    a_form = o_form.id.split("-");
    s_type = a_form[1];
    s_type2 = s_type;
    s_airflex = 0;
    s_airbit = "";
    if (s_type2 == "fo") {
        var formfo = $("form-fo");
        if (formfo.flightType.type != "hidden") {
            for (var i = 0; i < formfo.flightType.length; i++) {
                if (formfo.flightType[i].checked) {
                    s_airbit = formfo.flightType[i].value;
                }
            }
            if (s_airbit == "multicity") {
                s_type2 += "mc";
            }
        }
        if (formfo.dateTypeSelect) {
            for (var i = 0; i < formfo.dateTypeSelect.length; i++) {
                if (formfo.dateTypeSelect[i].checked && formfo.dateTypeSelect[i].value == "flexibleDates") {
                    s_airflex = 1;
                }
            }
        }
    }
    b_submit = true;
    for (var i = 1; i < a_arguments.length; i++) {
        switch (a_arguments[i]) {
            case 1:
                if ($(s_type2 + "-from")) {
                    b_submit = e_checklength($(s_type2 + "-from"), 3, 25);
                }
                if (b_submit) {
                    if ($(s_type2 + "-to")) {
                        b_submit = e_checklength($(s_type2 + "-to"), 3, 25);
                    }
                }
                break;
            case 2:
                if (document.getElementById(s_type2 + "-from")) {
                    b_submit = e_checkspace(document.getElementById(s_type2 + "-from"));
                }
                if (b_submit) {
                    if (document.getElementById(s_type2 + "-to")) {
                        b_submit = e_checkspace(document.getElementById(s_type2 + "-to"));
                    }
                }
                break;
            case 3:
                if (document.getElementById(s_type2 + "-from")) {
                    b_submit = e_checkchar(document.getElementById(s_type2 + "-from"));
                }
                if (b_submit) {
                    if (document.getElementById(s_type2 + "-to")) {
                        b_submit = e_checkchar(document.getElementById(s_type2 + "-to"));
                    }
                }
                break;
            case 4:
                b_submit = e_same($(s_type2 + "-from"), $(s_type2 + "-to"));
                break;
            case 5:
                if (document.getElementById(s_type + "-minors").selectedIndex > 0) {
                    b_submit = e_children(document.getElementById(s_type + "-minors"), s_type);
                }
                break;
            case 6:
                if ($(s_type2 + "-tomonth")) {
                    b_submit = e_dates($(s_type2 + "-frommonth"), $(s_type2 + "-tomonth"), $(s_type2 + "-fromdate"), $(s_type2 + "-todate"));
                }
                break;
            case 7:
                if ($(s_type + "-adults").selectedIndex == 0 && $(s_type + "-children").selectedIndex == 0 && $(s_type + "-seniors").selectedIndex == 0) {
                    show_e("e_pass", $(s_type + "-adults"));
                    b_submit = false;
                }
                break;
            case 8:
                if (!s_airflex) {
                    b_oneway = 0;
                    b_submit = e_validdate($(s_type2 + "-fromdate"));
                    if (s_airbit == "multicity" || s_airbit == "oneway") {
                        b_oneway = 1;
                    }
                    if ($(s_type2 + "-todate") && b_submit && !b_oneway) {
                        b_submit = e_validdate($(s_type2 + "-todate"));
                    }
                }
                else {
                    b_submit = true;
                }
                break;
            case 9:
                if ($(s_type + "-minors1")) {
                    b_submit = e_childrooms(s_type);
                }
                break;
            default:
        }
        if (!b_submit) {
            i = a_arguments.length;
        }
    }
    return b_submit;
}

var o_navigator = navigator.userAgent.toLowerCase();
var isMacIE = (o_navigator.indexOf("msie 5") > -1 && o_navigator.indexOf("mac") > -1) ? 1 : 0;
var isPCIE = (o_navigator.indexOf("msie") > -1 && !isMacIE && o_navigator.indexOf("opera") == -1) ? 1 : 0;
var isOpera = o_navigator.indexOf("opera") > -1 ? 1 : 0;
var isKHTML = o_navigator.indexOf("khtml") > -1 ? 1 : 0;
var mArray = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");
var dArray = new Array("Su", "Mo", "Tu", "We", "Th", "Fr", "Sa");
var datesArray = new Array(31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31);
var today = new Date();
var cD = today.getDay();
var cT = today.getDate();
var cM = today.getMonth();
var cMDs = datesArray[cM];
var cY = today.getFullYear();
var newT = cT;
var newM = cM;
var newY = cY;
var newDs = cMDs;
var newD = cD;
var numCalendars = 2;
var calDirection = "vertical";
var calopen = 0;
var o_windowparent = top;
var o_input = 0;
var o_month = 0;
var o_date = 0;
var o_iframecal = 0;
var o_from;
var o_to;
var v_from;
var v_to;
var d_makefrom = 0;
var d_maketo = 0;
var s_lang = "us";
var o_currentDate = false;
var i_firstMonth = cM;
var i_sfirstYear = cY;
var i_sfirstMonth = cM;
var i_ofirstYear = cY;
var i_ofirstMonth = cM;
var b_calinit = 0;
var o_row = null;
var i_numcal = 0;
var o_calbody = null;
var s_jscall = (isPCIE) ? "parent." : "";
var s_closecal = "<div class='calClose'><a href='#' onclick='" + s_jscall + "closeCal();return false;'>close</a>Select a Date:</div>";
var b_date331 = 0;
var a_input = 0;
var o_parent;
var s_inputtype = "object";
var a_v_input = null;
function findFirstDay(){
    firstDay = new Date();
    firstDay.setDate(1);
    firstDay.setMonth(newM);
    firstDay.setFullYear(newY);
    return firstDay.getDay();
}

function check331(d_date){
    i_date331 = Math.floor((d_date - today) / 86400000);
    b_check331 = (i_date331 > 330) ? 1 : 0;
    return b_check331;
}

function vm_setupCal(){
    i_numcal = 0;
    vm_makeCal(cM);
}

var prevDef = 0;
function preventClose(evt){
    prevDef = 1;
    if (isKHTML || isOpera) {
        evt.stopPropagation();
    }
    setTimeout("prevDef = 0", 500);
    clearTimeout(t_calcloser);
}

function ty_makeDate(which){
    d_makedate = new Date(newY, newM, which);
    b_date331 = check331(d_makedate);
    if ((cT > which && cM == newM && cY == newY) || b_date331) {
        s_makeDate = "<td class='calDateOff'>";
        s_makeDate += which;
    }
    else {
        if (d_makefrom || d_maketo) {
            s_makeDate = ((d_makedate.toString() == d_makefrom.toString()) || (d_makedate.toString() == d_maketo.toString())) ? "<td class='calDateSel'>" : (d_makedate > d_makefrom && d_makedate < d_maketo && d_makefrom) ? "<td class='calDateRng'>" : "<td class='calDate'>";
        }
        else {
            s_makeDate = "<td class='calDate'>";
        }
        s_makeDate += "<a href='#" + o_input.id + "' onclick='" + s_jscall + "ty_setDate(" + newM + "," + which + ",this.parentNode," + newY + ");return false;' class='calDateA'>";
        s_makeDate += which;
        s_makeDate += "</a>";
    }
    s_makeDate += "</td>\n";
    return s_makeDate;
}

function ty_maketr(what){
    s_tr = "<tr>\n";
    s_tr += what;
    s_tr += "</tr>\n";
    return s_tr;
}

function ty_changeMonths(which){
    if (typeof(o_input) == "object") {
        o_input.focus();
    }
    i_numcal = 0;
    o_calbody.innerHTML = "";
    if (which < 0) {
        which = 11;
        newY--;
    }
    vm_makeCal(which);
}

function vm_makeCal(whichMonth){
    b_calinit = 1;
    o_cal = "";
    o_caltr = "";
    o_caltd = "";
    newM = whichMonth;
    if (newM < cM) {
        newY = cY + 1;
    }
    if (newM >= 12) {
        newM = whichMonth - 12;
        newY++;
    }
    if (i_numcal == 0) {
        i_firstMonth = newM;
        switch (s_inputtype) {
            case "object":
                i_ofirstMonth = newM;
                i_ofirstYear = newY;
                break;
            default:
                i_sfirstMonth = newM;
                i_sfirstYear = newY;
        }
    }
    newDs = datesArray[newM];
    isLeap = (newY % 4 == 0 && (newY % 100 != 0 || newY % 400 == 0)) ? 1 : 0;
    if (newM == 1) {
        newDs = newDs + isLeap;
    }
    newD = findFirstDay();
    countDay = newD;
    s_calclass = (calDirection == "vertical") ? "calTableV" : "calTableH";
    o_cal += "<table month='" + newM + "' year='" + newY + "' cellpadding='0' cellspacing='0' border='0' class='" + s_calclass + "'>\n";
    o_caltr += "<tr class='calRowHighlight'>\n";
    o_caltd += "<td colspan='7' class='calLabel'>";
    o_caltd += mArray[newM] + "&nbsp;" + newY;
    o_caltd += "</td>";
    o_caltr += o_caltd;
    o_caltr += "</tr>\n";
    o_cal += o_caltr;
    o_caltd = "";
    for (i = 0; i < dArray.length; i++) {
        o_caltd += "<td class='calDayName'>";
        o_caltd += dArray[i];
        o_caltd += "</td>\n";
    }
    o_caltr = ty_maketr(o_caltd);
    o_cal += o_caltr;
    o_caltd = "";
    i_calRows = 0;
    for (d = 1; d <= newDs; d++) {
        if (d == 1) {
            for (bd = 0; bd < newD; bd++) {
                o_caltd += "<td class='calDate'>&nbsp;</td>\n";
            }
        }
        o_caltd += ty_makeDate(d);
        countDay++;
        if (countDay == 7) {
            countDay = 0;
            o_caltr = ty_maketr(o_caltd);
            o_cal += o_caltr;
            o_caltd = "";
            i_calRows++;
        }
        if (d == newDs && countDay != 0) {
            for (bd = countDay; bd < 7; bd++) {
                o_caltd += "<td class='calDate'>&nbsp;</td>\n";
            }
            o_caltr = ty_maketr(o_caltd);
            o_cal += o_caltr;
            o_caltd = "";
            i_calRows++;
        }
    }
    if (i_calRows < 6) {
        o_caltd = "";
        for (bd = 0; bd < 7; bd++) {
            o_caltd += "<td class='calDate'>&nbsp;</td>\n";
        }
        o_caltr = ty_maketr(o_caltd);
        o_cal += o_caltr;
    }
    o_cal += "</table>";
    o_calbody.innerHTML += (i_numcal == 0) ? (newM == cM && newY == cY) ? s_closecal + "<span class='calNavA'>&nbsp;</span>" : s_closecal + "<a href='#" + o_input.id + "' onclick='" + s_jscall + "ty_changeMonths(" + i_firstMonth + "-1);" + s_jscall + "preventClose(event);return false' class='calNavA' id='calNrev'>previous month</a>" : "";
    o_calbody.innerHTML += o_cal;
    i_numcal++;
    if (i_numcal == numCalendars && !(newM == cM - 1) && !b_date331) {
        o_calbody.innerHTML += "<a href='#" + o_input.id + "' onclick='" + s_jscall + "ty_changeMonths(" + i_firstMonth + "+1);" + s_jscall + "preventClose(event);return false;' class='calNavA' id='calNext'>next month</a>";
    }
    if (i_numcal < numCalendars) {
        vm_makeCal(newM + 1);
    }
    else {
        if (i_firstMonth > newM) {
            newY--;
        }
    }
}

function ty_setDate(whatMonth, whatDate, whatTD, whatYear){
    prevDef = 1;
    if (typeof(o_input) == "object") {
        o_input.focus();
    }
    o_currentDate = whatTD;
    o_currentDate.className = "calDateSel";
    if (typeof(o_input) == "object") {
        o_input.value = (s_lang == "us") ? (whatMonth + 1) + "/" + whatDate + "/" + whatYear : whatDate + "/" + (whatMonth + 1) + "/" + whatYear;
        cannonball.maintainState(o_input);
    }
    else {
        document.getElementById(a_v_input[0]).selectedIndex = whatMonth;
        document.getElementById(a_v_input[1]).selectedIndex = whatDate - 1;
    }
    closeCal();
    setTimeout("prevDef = 0", 500);
}

function hideCalendar(){
    if (typeof(o_input) == "object") {
        var o_class = o_input.className;
        o_input.className = o_class.replace("cbrowon", "");
    }
    else {
        var dminputs = o_input.split("|");
        $(dminputs[0]).className = $(dminputs[0]).className.replace(" cbrowon", "");
        $(dminputs[1]).className = $(dminputs[1]).className.replace(" cbrowon", "");
    }
    o_caldiv.style.display = "none";
    calopen = 0;
    cannonball.maintainState(o_input);
}

function splitDate(s_input, s_mode){
    this.delimitor = (s_input.indexOf("/") > -1) ? "/" : (s_input.indexOf(".") > -1) ? "." : (s_input.indexOf("-") > -1) ? "-" : (s_input.indexOf(",") > -1) ? "," : "/";
    a_input = s_input.split(this.delimitor);
    this.date = -1;
    this.month = -1;
    this.year = -1;
    if (a_input.length == 3 && !isNaN(a_input[0]) && !isNaN(a_input[1]) && !isNaN(a_input[2])) {
        this.month = (s_mode == "us") ? parseInt(a_input[0], 10) - 1 : parseInt(a_input[1], 10) - 1;
        this.date = (s_mode == "us") ? parseInt(a_input[1], 10) : parseInt(a_input[0], 10);
        this.year = a_input[2];
        if (this.month > 11 || this.month < 0) {
            this.month = -1;
        }
        if (this.date > 31 || this.month < 0) {
            this.date = -1;
        }
        i_yrlength = this.year.toString().length;
        if (i_yrlength == 2) {
            this.year = "20" + this.year;
        }
        if (i_yrlength < 1 || i_yrlength == 3 || this.year < cY) {
            this.year = -1;
        }
    }
}

var o_caldiv = 0;
var calopen = 0;
var t_calcloser = null;
function buildDate(s_monthdate){
    a_monthdate = s_monthdate.split("|");
    bd_oMonth = document.getElementById(a_monthdate[0]);
    bd_oDate = document.getElementById(a_monthdate[1]);
    i_month = bd_oMonth.selectedIndex + 1;
    i_date = bd_oDate.selectedIndex + 1;
    s_date = "";
    s_date = i_month + "/" + i_date + "/";
    s_date += (i_month - 1 < cM) ? cY + 1 : cY;
    return s_date;
}

var s_lastinputtype = null;
function makeCalendar(v_input, s_from, s_to, s_mode){
    o_input = v_input;
    if (isPCIE) {
        document.getElementById("calbox").innerHTML = '<iframe id="calframe" src="javascript:\'calendar\'" scrolling="no" marginheight="0" marginwidth="0" frameborder="0"></iframe>';
        s_iecalcss = "<link rel='stylesheet' type='text/css' href='/promotions/css_cb_377/1,1320,,00.css' />";
        o_califrame = document.getElementById("calframe");
        calframe.document.open();
        calframe.document.write("<html><head>" + s_iecalcss + "</head><body id='calbox' class='calendar'></body></html>");
        calframe.document.close();
    }
    i_numcal = 0;
    if (isPCIE) {
        document.getElementById("calframe").className = "calframe";
    }
    o_calbody = (isPCIE) ? calframe.document.getElementById("calbox") : document.getElementById("calbox");
    o_calbody.innerHTML = "";
    o_udate = (typeof(o_input) == "object") ? new splitDate(o_input.value, "us") : new splitDate(buildDate(o_input), "us");
    a_from = s_from.split("|");
    v_from = (a_from.length == 1) ? new splitDate(document.getElementById(s_from).value, s_mode) : new splitDate(buildDate(s_from), s_mode);
    a_to = s_to.split("|");
    v_to = (a_to.length == 2) ? new splitDate(buildDate(s_to), s_mode) : (document.getElementById(s_to)) ? new splitDate(document.getElementById(s_to).value, s_mode) : new splitDate("", s_mode);
    d_makefrom = (v_from.month != -1) ? new Date(v_from.year, v_from.month, v_from.date) : 0;
    if (d_makefrom < today) {
        b_calinit = 1;
    }
    d_maketo = (v_to.month != -1) ? new Date(v_to.year, v_to.month, v_to.date) : 0;
    if (d_maketo < today) {
        b_calinit = 1;
    }
    switch (b_calinit) {
        case 0:
            if (o_udate.month != -1 && o_udate.year != -1 && o_udate.date != -1) {
                newY = o_udate.year;
                newM = o_udate.month;
                newD = o_udate.date;
                vm_makeCal(o_udate.month);
            }
            else {
                if (o_udate != document.getElementById(s_from) && d_makefrom) {
                    newY = v_from.year;
                    newM = v_from.month;
                    newD = v_from.date;
                    vm_makeCal(v_from.month);
                }
                else {
                    if (o_udate != document.getElementById(s_to) && d_maketo) {
                        newY = v_to.year;
                        newM = v_to.month;
                        newD = v_to.date;
                        vm_makeCal(v_to.month);
                    }
                    else {
                        newY = cY;
                        newM = cM;
                        newD = cD;
                        vm_makeCal(cM);
                    }
                }
            }
            break;
        default:
            switch (s_inputtype) {
                case "object":
                    newM = i_ofirstMonth;
                    newY = i_ofirstYear;
                    break;
                default:
                    newM = i_sfirstMonth;
                    newY = i_sfirstYear;
            }
            vm_makeCal(newM);
    }
    s_lastinputtype = typeof(o_input);
}

var calwait = 0;
function openCal(v_input, s_from, s_to, s_cal, s_parent, s_mode, s_caldir){
    if (o_parent) {
        o_parent.className = "cbrow";
    }
    clearTimeout(t_calcloser);
    s_inputtype = typeof(v_input);
    a_v_input = null;
    if (s_inputtype != "object") {
        a_v_input = v_input.split("|");
    }
    o_caldiv = document.getElementById(s_cal);
    o_caldiv.style.display = "block";
    o_caldiv.className = "calboxon";
    makeCalendar(v_input, s_from, s_to, s_mode);
    o_inputright = (s_inputtype != "object") ? document.getElementById(a_v_input[1]) : v_input;
    o_parent = document.getElementById(s_parent);
    o_cal = document.getElementById(s_cal);
    if (a_v_input != null) {
        o_inputright.className += " cbrowon";
        var o_inputleft = document.getElementById(a_v_input[0]);
        o_inputleft.className += " cbrowon";
    }
    else {
        o_parent.className += " cbrowon";
    }
    i_calx = parseInt(o_inputright.offsetLeft) + parseInt(o_inputright.offsetWidth);
    i_caly = parseInt(o_parent.offsetTop) + (parseInt(o_parent.offsetHeight) / 2) - (parseInt(o_cal.offsetHeight) / 2);
    o_cal.style.top = (i_caly > 0) ? i_caly + "px" : "0px";
    o_cal.style.left = i_calx + "px";
    calopen = 1;
}

function closeCal(e){
    if (o_caldiv && (calopen == 1)) {
        t_calcloser = setTimeout("hideCalendar()", 1);
    }
}

function doBodyClick(){
    if (prevDef == 0) {
        closeCal();
    }
}

function setBodyClick(e){
    YAHOO.util.Event.addListener(window.document, "click", doBodyClick);
}
/*

s_userAgent = window.navigator.userAgent;
KON = (s_userAgent.indexOf("KHTML") > -1) ? 1 : 0;
isKON = KON;
isOp = (s_userAgent.toLowerCase().indexOf("opera") > -1) ? 1 : 0;
posX = 0;
posY = 0;
if (!Array.prototype.push) {
    Array.prototype.push = function(e){
        this[this.length] = e;
    };
}
function $(){
    var elements = new Array();
    for (var i = 0; i < arguments.length; i++) {
        var element = arguments[i];
        if (typeof element == "string") {
            element = document.getElementById(element);
        }
        if (arguments.length == 1) {
            return element;
        }
        elements.push(element);
    }
    return elements;
}

function launchWindow(url, w, h){
    winName = "_new";
    if (!h) {
        popHeight = screen.availHeight - 100;
    }
    else {
        popHeight = h;
    }
    winParams = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width=" + w + ",height=" + popHeight;
    newwin = window.open(url, winName, winParams);
    newwin.focus();
}

function SetCookie(cookieName, cookieValue, nDays){
    var today = new Date();
    var expire = new Date();
    if (nDays == null || nDays == 0) {
        nDays = 1;
    }
    expire.setTime(today.getTime() + 24 * 60 * 60 * 1000 * nDays);
    document.cookie = cookieName + "=" + escape(cookieValue) + ";expires=" + expire.toGMTString();
}

function GetCookie(Name){
    var search = Name + "=";
    var returnvalue = "";
    if (document.cookie.length > 0) {
        offset = document.cookie.indexOf(search);
        if (offset != -1) {
            offset += search.length;
            end = document.cookie.indexOf(";", offset);
            if (end == -1) {
                end = document.cookie.length;
            }
            returnvalue = unescape(document.cookie.substring(offset, end));
        }
    }
    return returnvalue;
}

function pauseJS(mill){
    var d = new Date();
    var cD = null;
    do {
        cD = new Date();
    }
    while (cD - d < mill);
}

function vsTrackClick(VStrackingUrl, VS_var, rtAnchor){
    var __img = new Image(1, 1);
    var rnum = parseInt((Math.random() * Math.random()) * 100000000);
    __img.src = VStrackingUrl + "?WAPageName=" + VS_var + "&rand=" + rnum;
    if (typeof(rtAnchor) == "object" && rtAnchor.tagName.toLowerCase() == "a") {
        pauseJS(100);
    }
    else {
        return false;
    }
}

function vsRedirectClick(re, wap){
    window.location.href = ("/vstrack?WAPageName=" + wap + "&dst=" + re.href);
}

function noneBlock(){
    a_arguments = noneBlock.arguments;
    for (var i = 0; i < a_arguments.length; i++) {
        a_nB = a_arguments[i].split("!");
        s_nBit = a_nB[0];
        i_nBdisplay = a_nB[1];
        o_showHide = document.getElementById(s_nBit);
        o_showHide.style.display = (i_nBdisplay == 0) ? "none" : (i_nBdisplay == 1) ? "block" : (i_nBdisplay == 2) ? "inline" : "";
    }
}

function noneBlock_v2(){
    var a_args = noneBlock_v2.arguments;
    for (var i = a_args.length - 1; i > -1; i--) {
        var a_nb2 = a_args[i].split("|");
        var o_block = document.getElementById(a_nb2[0]);
        var o_img = document.getElementById(a_nb2[1]);
        switch (a_nb2[2]) {
            case "flip":
                switch (o_img.src.indexOf("show")) {
                    case -1:
                        o_img.src = o_img.src.replace("hide", "show");
                        o_block.style.display = "none";
                        break;
                    default:
                        o_img.src = o_img.src.replace("show", "hide");
                        o_block.style.display = a_nb2[3];
                }
                break;
            default:
                o_img.src = (a_nb2[2] != "none") ? o_img.src.replace("show", "hide") : o_img.src.replace("hide", "show");
                o_block.style.display = a_nb2[2];
        }
    }
}

function showHide(){
    for (i = 0; i < showHide.arguments.length; i++) {
        o_showHide = document.getElementById(showHide.arguments[i]);
        s_showHide = (o_showHide.style.display != "") ? o_showHide.style.display : "none";
        o_showHide.style.display = (s_showHide == "none") ? (o_showHide.nodeName == "SPAN") ? "inline" : "block" : "none";
    }
}

function swapText(el, cn, txt1, txt2){
    var d = document.getElementsByTagName("*");
    dL = d.length;
    for (i = 0; i < dL; i++) {
        if (d[i].className == cn && d[i].id != el) {
            d[i].innerHTML = txt1;
        }
        else {
            document.getElementById(el).innerHTML == txt1 ? nTxt = txt2 : nTxt = txt1;
            document.getElementById(el).innerHTML = nTxt;
        }
    }
}

function visHidden(){
    for (i = 0; i < visHidden.arguments.length; i++) {
        o_visHidden = document.getElementById(visHidden.arguments[i]);
        s_visHidden = (o_visHidden.style.visibility != "") ? o_visHidden.style.visibility : "visible";
        o_visHidden.style.visibility = (s_visHidden == "visible") ? "hidden" : "visible";
    }
}

function jump(menu){
    var loc = menu[menu.selectedIndex].value.split("|");
    if (loc.length == 2) {
        window.open(loc[1], loc[0]);
    }
}

function cssSwitch(){
    a_cS = cssSwitch.arguments;
    for (i = 0; i < a_cS.length; i++) {
        a_cSsplit = (a_cS[i].indexOf("&") != -1) ? a_cS[i].split("&") : a_cS[i].split("!");
        document.getElementById(a_cSsplit[0]).className = a_cSsplit[1];
    }
}

function cssSwitch2(s_cSValue){
    a_cS = s_cSValue.split("&");
    o_cS = document.getElementById(a_cS[0]);
    if (o_cS.style.display == "none") {
        document.getElementById(a_cS[1]).className = a_cS[3];
    }
    else {
        document.getElementById(a_cS[1]).className = a_cS[2];
    }
}

function fltrObj(s_fOValue){
    a_fO = s_fOValue.split("|");
    document.getElementById(a_fO[0]).innerHTML = a_fO[1];
}

function funSort(){
    a_fSarg = funSort.arguments;
    for (var i = 0; i < a_fSarg.length; i++) {
        (a_fSarg[i].indexOf("!") > 0) ? noneBlock(a_fSarg[i]) : (a_fSarg[i].indexOf("|") > 0) ? fltrObj(a_fSarg[i]) : cssSwitch(a_fSarg[i]);
    }
}

function chkOther(form){
    var reason = document.getElementById("reason");
    var num_reason = reason.options[reason.selectedIndex].value;
    if (num_reason == "HE") {
        document.getElementById("otherReason").style.display = "block";
    }
    else {
        document.getElementById("otherReason").style.display = "none";
    }
}

function openHere(){
    a_args = openHere.arguments;
    eval("window." + a_args[1] + ".location.replace(a_args[2])");
    o_content = document.getElementById("mainContent");
    if (a_args[3]) {
        o_div = document.getElementById(a_args[3]);
    }
    if (!o_content) {
        o_content = 0;
    }
    if (window.event) {
        yPos = window.event.clientY;
        xPos = window.event.clientX;
    }
    else {
        if (document.getElementById && !document.all) {
            xPos = a_args[0].clientX;
            yPos = a_args[0].clientY;
        }
        else {
            xPos = 0;
            yPos = 0;
        }
    }
    i_scrollAmount = (isKON) ? 0 : document.body.scrollTop;
    o_div.style.top = yPos + 10 - o_content.offsetTop + i_scrollAmount;
    o_div.style.left = xPos + 10 - o_content.offsetLeft;
    o_div.style.visibility = "visible";
}

function emailValue(){
    emailval = document.getElementById("email").value;
}

function clearVerify(){
    newemailval = document.getElementById("email").value;
    confemailval = document.getElementById("confemail").value;
    if ((newemailval != emailval) && (confemailval != newemailval)) {
        document.getElementById("confemail").value = "";
    }
}

var o_popurl = "#";
var o_popwindow = 0;
var b_popwindow = 1;
function checkpopUp(){
    b_popwindow = (o_popwindow) ? o_popwindow.closed : 1;
    if (b_popwindow) {
        document.location = o_popurl;
    }
    else {
        o_popwindow.focus();
    }
}

function popUp(s_url, s_name, s_attrib){
    o_popurl = s_url;
    o_popwindow = window.open(s_url, s_name, s_attrib);
}

s_userAgent = window.navigator.userAgent;
isIE = (navigator.userAgent.indexOf("MSIE") > -1) ? 1 : 0;
isWin = (navigator.userAgent.indexOf("Windows") > -1) ? 1 : 0;
isWinIE = (isWin && isIE) ? 1 : 0;
function showrow(s_tableid){
    o_table = document.getElementById(s_tableid);
    a_tr = o_table.getElementsByTagName("tr");
    for (var i = 0; i < a_tr.length; i++) {
        if (a_tr[i].className == "hiderow") {
            a_tr[i].style.display = (isWinIE) ? "inline" : "table-row";
        }
    }
}

function showrowlinks(o_link1, o_link2){
    o_link1.parentNode.innerHTML = o_link1.innerHTML;
    o_link2.parentNode.innerHTML = o_link2.innerHTML;
}

function dataSwitchPhone(i_Select){
    document.CheckoutForm.telephoneNumber.value = a_ccDisplay[i_Select];
    document.CheckoutForm.telephoneNumberID.value = phoneIDs[i_Select];
}

function dataSwitchAlternatePhone(i_Select){
    document.CheckoutForm.alternateTelephoneNumber.value = a_ccDisplay[i_Select];
    document.CheckoutForm.alternateTelephoneNumberID.value = phoneIDs[i_Select];
}

var o_slide;
var i_slideH;
var i_slidespeed;
var i_slidedelay;
var i_initslidedelay;
var t_slidetimer = null;
function slideDiv(s_slideid, i_speed, i_delay, i_initdelay){
    o_slide = document.getElementById(s_slideid);
    i_slidespeed = i_speed;
    i_slidedelay = i_delay;
    i_initslidedelay = i_initdelay;
    i_slideH = o_slide.offsetHeight;
    t_slidetimer = setTimeout("doSlideDiv()", i_initslidedelay);
}

function doSlideDiv(){
    if (i_slideH > 0) {
        o_slide.style.height = i_slideH + "px";
        i_slideH -= i_slidespeed;
        t_slidetimer = setTimeout("doSlideDiv()", i_slidedelay);
    }
    else {
        i_slideH = 0;
        o_slide.style.height = "0px";
        o_slide.style.clip = "rect(auto auto 0px auto)";
        clearTimeout(t_slidetimer);
    }
}

function findairport(s_url, s_form, s_input){
    s_popurl = s_url;
    s_popurl += "?formName=" + document.getElementById(s_form).name + "&fieldName=" + document.getElementById(s_input).name;
    o_popwindow = window.open(s_popurl, "airportlookup", "height=300,width=450,scrollbars=yes");
    if (o_popwindow) {
        o_popwindow.focus();
    }
}

var b_loaded;
function setUpJSF(s_formname){
    b_loaded = true;
    o_cbnav = document.getElementById("cbNav");
    if (o_cbnav) {
        a_radio = o_cbnav.getElementsByTagName("input");
        for (var i = 0; i < a_radio.length; i++) {
            _s_formname = a_radio[i].value;
            if (a_radio[i].checked) {
                document.getElementById(_s_formname).style.display = "block";
            }
            else {
                document.getElementById(_s_formname).style.display = "none";
            }
        }
    }
    s_formname = s_formname || _s_formname;
    s_formbit = getFormPrefix(s_formname);
    if (s_formbit != "") {
        multirooms(s_formbit + "totalrooms");
    }
}

function maintainState(o_input){
    if (!b_loaded || !document.cbNav) {
        return false;
    }
    a_bit = o_input.id.split("_");
    s_bit = a_bit[1];
    for (i = 0; i < document.cbNav.nav.length; i++) {
        a_formbit = document.cbNav.nav[i].value.split("form");
        s_formbit = a_formbit[1];
        o_formelement = document.getElementById(s_formbit + "_" + s_bit);
        if (eval("document." + document.cbNav.nav[i].value) && o_formelement != o_input) {
            if (o_formelement && o_formelement != o_input && o_input.type != "radio") {
                if (o_formelement.type == "select-one" && o_formelement.length > o_input.selectedIndex) {
                    o_formelement.selectedIndex = o_input.selectedIndex;
                }
                else {
                    if (o_formelement.type == o_input.type) {
                        o_formelement.value = o_input.value;
                    }
                }
            }
            else {
                a_input = eval("document." + document.cbNav.nav[i].value + "." + o_input.name);
                if (a_input) {
                    for (j = 0; j < a_input.length; j++) {
                        if (a_input[j] != o_input && a_input[j].value == o_input.value) {
                            a_input[j].checked = "checked";
                        }
                    }
                }
            }
        }
    }
}

function globalMaintainState(o_input){
    oTag = o_input.tagName.toLowerCase();
    tagCheck = "select input";
    if (!o_input.id || tagCheck.indexOf(oTag) == -1) {
        return false;
    }
    if (!o_input.type) {
        return false;
    }
    oFormType = o_input.type.toLowerCase();
    a_bit = o_input.id.split("_");
    s_bit = a_bit[1];
    aForms = document.forms;
    for (h = 0; h < aForms.length; h++) {
        oFormTag = aForms[h].getElementsByTagName(oTag);
        for (i = 0; i < oFormTag.length; i++) {
            o_bit = oFormTag[i].id.split("_");
            if (oFormTag[i].id != o_input.id) {
                if (o_bit[1] == s_bit) {
                    switch (oFormType) {
                        case "hidden":
                        case "text":
                            oFormTag[i].value = o_input.value;
                            break;
                        case "select-one":
                            o_index = o_input.selectedIndex;
                            o_val = o_input.options[o_index].text;
                            o_formTagLength = oFormTag[i].options.length;
                            for (j = 0; j < o_formTagLength; j++) {
                                if (oFormTag[i].options[j].text == o_val) {
                                    oFormTag[i].selectedIndex = j;
                                }
                            }
                            break;
                        case "radio":
                        case "checkbox":
                            o_input.checked ? oFormTag[i].checked = true : oFormTag[i].checked = false;
                            break;
                    }
                }
            }
        }
    }
}

function getFormPrefix(s_id){
    s_formbit = s_id.replace("form", "");
    switch (s_formbit) {
        case "HO":
        case "FH":
            return s_formbit + "_";
            break;
        default:
            return "";
    }
}

function multiroomchild(i_rooms, i_maxrooms, s_prefix){
    o_childrooms = document.getElementById(s_prefix + "multichildroom");
    o_childrooms.style.display = "none";
    for (var i = 1; i <= i_maxrooms; i++) {
        document.getElementById(s_prefix + "childroom" + i).style.display = "none";
    }
    for (var i = 0; i < i_rooms; i++) {
        o_children = document.getElementById(s_prefix + "f_child" + (i + 1));
        i_ages = o_children.selectedIndex;
        o_childrow = document.getElementById(s_prefix + "childroom" + (i + 1));
        if (i_ages > 0) {
            o_childrooms.style.display = "block";
            o_childrow = document.getElementById(s_prefix + "childroom" + (i + 1));
            a_select = o_childrow.getElementsByTagName("select");
            for (var j = 0; j < o_children.options.length - 1; j++) {
                a_select[j].parentNode.style.display = (j < i_ages) ? "block" : "none";
            }
            o_childrow.style.display = "block";
        }
        else {
            o_childrow.style.display = "none";
        }
    }
}

function multirooms(s_rooms){
    o_rooms = document.getElementById(s_rooms);
    s_prefix = getFormPrefix(o_rooms.form.id);
    i_rooms = parseInt(o_rooms.options[o_rooms.selectedIndex].text);
    i_maxrooms = parseInt(o_rooms.options[o_rooms.options.length - 1].text);
    for (var i = 0; i < i_maxrooms; i++) {
        document.getElementById(s_prefix + "room" + (i + 1)).style.display = "none";
    }
    for (var i = 0; i < i_rooms; i++) {
        document.getElementById(s_prefix + "room" + (i + 1)).style.display = "block";
    }
    if (document.getElementById(s_prefix + "multichildroom")) {
        multiroomchild(i_rooms, i_maxrooms, s_prefix);
    }
}

function modifysearch(s_mod, s_modicon){
    o_mod = document.getElementById(s_mod);
    o_modicon = document.getElementById(s_modicon);
    switch (modifysearch.arguments[2]) {
        case 1:
            o_mod.style.display = "block";
            if ((o_modicon.src.indexOf("show") > -1)) {
                o_modicon.src = o_modicon.src.replace("show", "hide");
            }
            break;
        default:
            o_mod.style.display = (o_mod.style.display == "none") ? "block" : "none";
            o_modicon.src = (o_modicon.src.indexOf("show") > -1) ? o_modicon.src.replace("show", "hide") : o_modicon.src.replace("hide", "show");
    }
}

function newImage(s_name, s_url, i_height, i_width){
    this.name = s_name;
    this.url = s_url;
    this.height = i_height;
    this.width = i_width;
    this.cache = new Image();
    this.cache.src = s_url + s_name;
}

var i_slideimg = 0;
var a_slideimages = new Array();
function setslideheight(){
    i_slideheight = 0;
    o_slideheight = document.getElementById("slideimgbox");
    for (var i = 0; i < a_slideimages.length; i++) {
        if (a_slideimages[i].height > i_slideheight) {
            i_slideheight = a_slideimages[i].height;
        }
    }
    o_slideheight.style.height = i_slideheight;
}

function doslideshow(i_dir, o_links){
    a_slideshow = o_links.getElementsByTagName("a");
    o_slideimg = document.getElementById("slideimg");
    o_currentslide = document.getElementById("currentslide");
    switch (i_dir) {
        case -1:
            if (i_dir + i_slideimg == 0) {
                a_slideshow[0].style.visibility = "hidden";
            }
            a_slideshow[1].style.visibility = "visible";
            break;
        case 1:
            if (i_dir + i_slideimg == (a_slideimages.length - 1)) {
                a_slideshow[1].style.visibility = "hidden";
            }
            a_slideshow[0].style.visibility = "visible";
            break;
    }
    o_slideimg.src = a_slideimages[i_slideimg + i_dir].cache.src;
    i_slideimg += i_dir;
    o_currentslide.firstChild.nodeValue = i_slideimg + 1;
}

function jump(menu){
    var loc = menu[menu.selectedIndex].value.split("|");
    if (loc.length == 2) {
        window.open(loc[1], loc[0]);
    }
}

function showhidestate(s_country, s_statefield){
    o_country = document.getElementById(s_country);
    o_statefield = document.getElementById(s_statefield);
    s_value = o_country.options[o_country.selectedIndex].value;
    switch (s_value.toLowerCase()) {
        case "us":
        case "ca":
            o_statefield.style.display = "block";
            break;
        default:
            o_statefield.style.display = "none";
    }
}

function amenErrorCheck(o_checkbox){
    s_checkboxname = o_checkbox.name;
    a_checkbox = eval("o_checkbox.form." + s_checkboxname);
    x = 0;
    for (i = 0; i < a_checkbox.length; i++) {
        if (a_checkbox[i].checked) {
            x++;
        }
    }
    for (i = 0; i < a_checkbox.length; i++) {
        a_checkbox[i].disabled = (x >= 3 && !a_checkbox[i].checked) ? true : false;
    }
}

function showHideDiv(showHide){
    for (i = 0; i < showHideDiv.arguments.length; i++) {
        o_showHide = document.getElementById(showHideDiv.arguments[i]);
        s_showHide = (o_showHide.style.display != "") ? o_showHide.style.display : "none";
        o_showHide.style.display = (s_showHide == "none") ? (o_showHide.nodeName == "SPAN") ? "inline" : "block" : "none";
    }
}

a_amenLabel = new Array("Fitness Room", "Dining Room", "Swimming Pool", "Kids Activities", "Shuttle Service", "Business Center", "Meeting Rooms", "Data Port", "Golf Course", "Tennis Courts", "Game Room", "Pets Allowed", "Drycleaning Onsite", "Wheelchair Accessible", "Non-Smoking Available");
a_amenLabelOff = new Array("No Fitness Room", "No Dining Room", "No Swimming Pool", "No Kids Activities", "No Shuttle Service", "No Business Center", "No Meeting Rooms", "No Data Port", "No Golf Course", "No Tennis Courts", "No Game Room", "No Pets Allowed", "No Drycleaning Onsite", "No Wheelchair Accessible", "No Non-Smoking Available");
s_amenOtherOffers = "Other Amenities Offered:";
a_amenImgOff = new Array('<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_fitness_off.gif"name="fitness_facility_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Fitness Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dining_off.gif"name="dining_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Dining Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pool_off.gif"name="swimming_pool_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Swimming Pool">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_kids_off.gif"name="kids_allowed_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Kids Activities">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_shuttle_off.gif"name="shuttle_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Shuttle Service">', '<imgsrc="http://rg.travelocity.com.edgesuite.net/graphics/amenity_businesscenter_off.gif"name="business_center_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Business Center">', '<imgsrc="http://rg.travelocity.com.edgesuite.net/graphics/amenity_meetingroom_off.gif"name="meeting_room_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Meeting Rooms">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_data_off.gif"name="data_port_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Data Port">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_golf_off.gif"name="golf_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Golf Course">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_tennis_off.gif"name="tennis_court_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Tennis Courts">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_casino_off.gif"name="game_room_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Game Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pet_off.gif"name="pets_allowed_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Pets Allowed">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dryclean_off.gif"name="dry_cleaning_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Drycleaning Onsite">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_handicap_off.gif"name="wheel_chair_access_off" height="15" width="17" border="0" hspace="0"vspace="0" alt="No Wheelchair Accessible">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/icon_nonSmo_off.gif"name="nonsmoking_off" height="15" width="17" border="0" hspace="0" vspace="0"alt="No Non-Smoking Available">');
a_amenImgOn = new Array('<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_fitness.gif" name="fitness_facility_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Fitness Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dining.gif" name="dining_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Dining Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pool.gif" name="swimming_pool_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Swimming Pool">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_kids.gif" name="kids_allowed_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Kids Activities">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_shuttle.gif" name="shuttle_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Shuttle Service">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_businesscenter.gif" name="business_center_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Business Center">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_meetingroom.gif" name="meeting_room_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Meeting Rooms">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_data.gif" name="data_port_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Data Port">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_golf.gif" name="golf_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Golf Course">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_tennis.gif" name="tennis_court_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Tennis Courts">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_casino.gif" name="game_room_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Game Room">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_pet.gif" name="pets_allowed_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Pets Allowed">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_dryclean.gif" name="dry_cleaning_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Drycleaning Onsite">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/amenity_handicap.gif" name="wheel_chair_access_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Wheelchair Accessible">', '<img src="http://rg.travelocity.com.edgesuite.net/graphics/icon_nonSmo.gif" name="nonsmoking_on" height="15" width="17" border="0" hspace="0" vspace="0" alt="Non-Smoking Available">');
function buildAmenCell(s_yesno, i_amen){
    s_cell = "";
    s_text = (s_yesno == "Y") ? a_amenLabel[parseInt(i_amen)] : a_amenLabelOff[parseInt(i_amen)];
    s_imgSrc = (s_yesno == "Y") ? a_amenImgOn[parseInt(i_amen)] : a_amenImgOff[parseInt(i_amen)];
    s_cell = "<li>" + s_imgSrc + "<br />" + s_text + "</li>";
    return s_cell;
}

function buildOtherAmenText(s_yesno, i_amen){
    s_cell = "";
    if (s_yesno == "Y") {
        s_text = a_amenLabel[i_amen];
        s_cell = "<li>" + s_text + "</li>";
    }
    return s_cell;
}

function buildOtherAmenities(s_amenities){
    h_ul_1 = "<ul class='noicon'>";
    h_ul_2 = "<ul class='noicon'>";
    var j = 0;
    for (i = 0; i < s_amenities.length; i++) {
        if (s_amenities.charAt(i) == "Y") {
            if (j % 2 == 0) {
                h_ul_1 += buildOtherAmenText(s_amenities.charAt(i), i);
                j = 1;
            }
            else {
                h_ul_2 += buildOtherAmenText(s_amenities.charAt(i), i);
                j = 0;
            }
        }
    }
    h_ul_1 += "</ul>";
    h_ul_2 += "</ul>";
    h_ul = h_ul_1 + h_ul_2;
    return h_ul;
}

function buildAmenities(s_amenities){
    s_ul = '<ul class="amenlist mid">';
    for (i = 0; i < s_amenities.length; i = i + 3) {
        s_ul += buildAmenCell(s_amenities.charAt(i), s_amenities.charAt(i + 1) + s_amenities.charAt(i + 2));
    }
    s_ul += "</ul>";
    return s_ul;
}

function showAmenities(s_url, s_otherAmenities, evt){
    s_amenpopup = buildAmenities(s_url);
    s_amenpopup += '<div class="superclear"></div>';
    s_amenpopup += "<h4>" + s_amenOtherOffers + "</h4>";
    s_amenpopup += buildOtherAmenities(s_otherAmenities);
    s_amenpopup += '<div class="superclear"></div>';
    document.getElementById("amenupdate").innerHTML = s_amenpopup;
    e_event = (window.event) ? window.event : evt;
    i_scrollX = (window.event) ? document.body.scrollLeft : window.scrollX;
    i_scrollY = (window.event) ? document.body.scrollTop : window.scrollY;
    i_mainY = document.getElementById("mainContent").offsetTop;
    posX = e_event.clientX + 10 + i_scrollX;
    posY = e_event.clientY - i_mainY;
    if (!KON) {
        posY += i_scrollY;
    }
    document.getElementById("amenPopUp").style.top = (isOp) ? posY + "px !important" : posY + "px";
    document.getElementById("amenPopUp").style.left = (isOp) ? posX + "px!important" : posX + "px";
    if (document.getElementById("amenPopUp").style.display == "none" || document.getElementById("amenPopUp").style.display == "") {
        showHideDiv("amenPopUp");
    }
}

function add2onload(__fn){
    var fn_onload = window.onload;
    window.onload = function(){
        if (typeof fn_onload == "function") {
            fn_onload();
        }
        __fn();
    };
}

function cb_addrscope(o_select){
    var o_addr;
    if (cb_addrscope.arguments[1]) {
        o_addr = cb_addrscope.arguments[1];
    }
    else {
        o_addr = "address|stateblock|zip";
    }
    var cb_addr = o_addr.split("|");
    var cbPrefix = o_select.id.substr(0, 2);
    var selVal = o_select.options[o_select.selectedIndex].value.toLowerCase();
    if (selVal == "us" || selVal == "ca") {
        for (x in cb_addr) {
            if ($(cbPrefix + cb_addr[x])) {
                noneBlock(cbPrefix + cb_addr[x] + "!1");
            }
        }
    }
    else {
        for (y in cb_addr) {
            if ($(cbPrefix + cb_addr[y])) {
                noneBlock(cbPrefix + cb_addr[y] + "!0");
            }
        }
    }
}

roID = 0;
function needsID(obj){
    if (obj.id === null || obj.id === "") {
        roID++;
        obj.id = "roID" + roID;
    }
}

function formatEvents(o, elist){
    var nolines = elist.replace(/[nr]/g, "");
    var norel = nolines.replace(/this/g, "$('" + o.id + "')");
    var nofocus = norel.replace(/.focus()/gi, "");
    return nofocus;
}

function reloadEvents(oCont){
    var e = $(oCont).getElementsByTagName("*");
    for (var i = 0; i < e.length; i++) {
        var eFunc = "";
        var etag = "";
        var ffunc;
        var n;
        if (e[i].tagName) {
            etag = e[i].tagName.toLowerCase();
        }
        switch (etag) {
            case "input":
                if (e[i].type == "radio" || e[i].type == "checkbox") {
                    if (e[i].getAttribute("onclick") !== null && e[i].getAttribute("onclick") !== "" && e[i].checked) {
                        needsID(e[i]);
                        n = e[i].getAttribute("onclick") + "";
                        ffunc = formatEvents(e[i], n);
                        eFunc += ffunc;
                    }
                    else {
                        if (e[i].getAttribute("onchange") !== null && e[i].getAttribute("onchange") !== "" && e[i].checked) {
                            needsID(e[i]);
                            n = e[i].getAttribute("onchange") + "";
                            ffunc = formatEvents(e[i], n);
                            eFunc += ffunc;
                        }
                    }
                }
                break;
            case "select":
                if (e[i].getAttribute("onchange") !== null && e[i].getAttribute("onchange") !== "") {
                    needsID(e[i]);
                    n = e[i].getAttribute("onchange") + "";
                    ffunc = formatEvents(e[i], n);
                    eFunc += ffunc;
                }
                break;
        }
        if (eFunc !== "") {
            if (eFunc.search(/function/gi) == -1) {
                eval(eFunc);
            }
            else {
                var ef = eFunc.toString();
                ef = ef.substr(ef.search(/{/g) + 1);
                ef = ef.replace(/}/g, "");
                eval(ef);
            }
        }
    }
}
*/

var b_stopBit = 0;
var b_overide = 0;
var s_userAgent = window.navigator.userAgent;
var KON = (s_userAgent.indexOf("KHTML") > -1) ? 1 : 0;
var isMac = (navigator.userAgent.indexOf("Mac") > -1) ? 1 : 0;
var isIE = (navigator.userAgent.indexOf("MSIE") > -1) ? 1 : 0;
var isNN6 = (navigator.userAgent.indexOf("Netscape6") > -1) ? 1 : 0;
var isMacIE = (isMac && isIE) ? 1 : 0;
var isOpera = (s_userAgent.indexOf("opera") > -1) ? 1 : 0;
var navTimer = null;
var currentNav = 0;
var b_loaded = 0;
function fixMacIEselect(s_formdivid, o_radio){
    o_formdiv = document.getElementById(s_formdivid);
    a_modOptions = o_formdiv.getElementsByTagName("select");
    if (a_modOptions) {
        for (i = 0; i < a_modOptions.length; i++) {
            a_modOptions[i].focus();
            a_modOptions[i].blur();
        }
    }
    o_radio.focus();
}

function getfw(uid){
    if (uid != "" && typeof(uid) != "undefined") {
        transaction = YAHOO.util.Connect.asyncRequest("GET", "/xmlfw/1,,,00.xml", fwcallback, null);
        document.getElementById("fwheadline").innerHTML = "Loading FareWatcher Plus<sup>SM</sup>...";
        document.getElementById("fwintro").innerHTML = "Please wait, we are loading your FareWatcher Plus<sup>SM</sup>...";
    }
}

var fwSuccess = function(o){
    var fwxml = o.responseXML.documentElement;
    if (typeof(fwxml) == "undefined") {
        return false;
    }
    var hpsubs = o.responseXML.getElementsByTagName("homepageSubscriptions");
    var isDef = hpsubs[0].getAttribute("defaultUser");
    var fwcont = document.getElementById("fwdata");
    fwcont.innerHTML = "";
    var fworig = fwxml.getElementsByTagName("origin");
    var maxfw = 2;
    for (var i = 0; i < fworig.length; i++) {
        if (i < maxfw) {
            var newH3 = document.createElement("h3");
            var newUL = document.createElement("ul");
            newUL.id = "fw-offer" + i;
            var OrigName = fworig[i].getAttribute("name");
            if (OrigName == "null") {
                OrigName = "";
            }
            var OrigCode = fworig[i].getAttribute("code");
            var DestName = fworig[i].getElementsByTagName("destination")[0].getAttribute("name");
            if (DestName == "null") {
                DestName = "";
            }
            var DestCode = fworig[i].getElementsByTagName("destination")[0].getAttribute("code");
            newH3.innerHTML += (OrigName + " (" + OrigCode + ") to " + DestName + " (" + DestCode + ")");
            fwcont.appendChild(newH3);
            var fData = Math.round(fworig[i].getElementsByTagName("flight")[0].firstChild.nodeValue);
            var hData = Math.round(fworig[i].getElementsByTagName("hotel")[0].firstChild.nodeValue);
            var pData = Math.round(fworig[i].getElementsByTagName("package")[0].firstChild.nodeValue);
            var cData = "&#036;";
            var ddata = [fData, hData, pData];
            var dtags = ["Flights from ", "Hotels from ", "Packages from "];
            var dclass = ["fw-flight", "fw-hotel", "fw-package"];
            var cDate = new Date();
            var months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"];
            var cMonth = months[cDate.getMonth()];
            var nMonth = months[cDate.getMonth() + 1];
            for (var j = 0; j < ddata.length; j++) {
                var newLI = document.createElement("li");
                newLI.className = dclass[j];
                var newA = document.createElement("a");
                var aURL = ["http://travel.travelocity.com/mystuff/SearchFareWatcher.do?goingTo=" + DestCode + "&leavingFrom=" + OrigCode + "&departure_dt=" + cMonth + "&arrival_dt=" + nMonth + "&airFareAmount=" + ddata[j], "http://travel.travelocity.com/hotel/HotelCobrand.do?city=" + DestCode, "http://travel.travelocity.com/trips/InitialSearch.do?leavingFrom=" + OrigCode + "&goingTo=" + DestCode];
                var searchFlightsURL = "http://travel.travelocity.com/flights/InitialSearch.do?goingTo=" + DestCode + "&leavingFrom=" + OrigCode;
                var whatLob = dtags[j].replace(" from", "");
                if (ddata[j] != "-1") {
                    newLI.innerHTML += dtags[j];
                    newA.innerHTML += cData + "" + ddata[j];
                    newA.href = aURL[j];
                }
                else {
                    newA.innerHTML += ("Search " + whatLob);
                    if (whatLob == "Flights ") {
                        newA.href = searchFlightsURL;
                    }
                    else {
                        newA.href = aURL[j];
                    }
                }
                newLI.appendChild(newA);
                newUL.appendChild(newLI);
            }
            fwcont.appendChild(newUL);
            if (i == 0) {
                var newClear = document.createElement("div");
                newClear.style.clear = "both";
                fwcont.appendChild(newClear);
            }
        }
    }
    if (!$("fw-clear-div")) {
        var newClearDiv = document.createElement("div");
        newClearDiv.style.clear = "both";
        newClearDiv.id = "fw-clear-div";
        fwcont.appendChild(newClearDiv);
    }
    if (isDef != 1) {
        document.getElementById("fwheadline").innerHTML = "You are watching...";
        document.getElementById("fwintro").innerHTML = "the following trips and destinations using FareWatcher Plus<sup>SM</sup> :";
        YAHOO.util.Event.addListener("fw-fare-info-link", "click", function(){
            launchWindow(this.href, 400, 300);
        });
        noneBlock("fwoptions!1", "fwintro!1");
    }
    else {
        document.getElementById("fwheadline").innerHTML = "Track Deals with FareWatcher Plus<sup>SM</sup>";
        document.getElementById("fwintro").innerHTML = "Start watching your favorite destinations with FareWatcher Plus<sup>SM</sup> today.";
        $("fw-fare-info-link").innerHTML = "Learn More";
        $("fw-fare-info-link").href = "http://svc.travelocity.com/info/info_popup/0,,TRAVELOCITY:EN|FW_LEGAL,00.html";
        YAHOO.util.Event.addListener("fw-fare-info-link", "click", function(){
            launchWindow(this.href, 400, 300);
        });
        $("fw-button-img").setAttribute("src", "http://i.travelpn.com.edgesuite.net/images/i/homepage/fw_login_button.gif");
        $("fw-button-img").setAttribute("alt", "Create Your Own List");
        noneBlock("fwoptions!1", "fwintro!1");
    }
    sectionNav.fwCalled = 1;
};
fwFailure = function(o){
    return false;
};
fwcallback = {
    success: fwSuccess,
    failure: fwFailure
};
function prvtDef(e){
    YAHOO.util.Event.preventDefault(e);
}

var sectionNav = {
    fwCalled: 0,
    fwUser: "",
    init: function(fwUID){
        this.fwUser = fwUID;
        this.nav = $("section-navigation");
        this.navItems = this.nav.getElementsByTagName("li");
        this.navLinks = this.nav.getElementsByTagName("a");
        for (var x = 0; x < this.navLinks.length; x++) {
            YAHOO.util.Event.addListener(this.navLinks[x], "click", function(e){
                prvtDef(e);
                sectionNav.changeNav(this);
            });
        }
        var sectNav = $("section-navigation-q");
        var sectRadios = sectNav.getElementsByTagName("input");
        for (var i = 0; i < sectRadios.length; i++) {
            if (sectRadios[i].type == "radio" && sectRadios[i].name == "section-radio") {
                var srVal = sectRadios[i].value;
                if (sectRadios[i].checked) {
                    $(srVal + "-nav-link").className = "current";
                    noneBlock(srVal + "!1");
                    this.changeNav($(srVal + "-nav-link"), 1);
                }
                else {
                    $(srVal + "-nav-link").className = "";
                    noneBlock(srVal + "!0");
                }
            }
        }
    },
    changeNav: function(o_nav){
        var navID = o_nav.id;
        var navS = navID.split("-");
        var navSection = navS[0] + "-" + navS[1];
        var initFromReload = this.changeNav.arguments[1];
        switch (navSection) {
            case "book-trip":
                if (initFromReload != 1) {
                    vsTrackClick("http://travel.travelocity.com/___waseq.img", "GLB_HOMEPAGE.BOOKING", 1);
                }
                $("book-trip-radio").checked = true;
                noneBlock("book-trip!1", "expl-dest!0", "my-trav!0", "find-deal!0");
                cssSwitch("book-trip-nav-link!current", "expl-dest-nav-link!", "my-trav-nav-link!", "find-deal-nav-link!");
                $("misc-links").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/misc_links_bg.gif)";
                $("content").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/content_bg.gif)";
                break;
            case "expl-dest":
                if (initFromReload != 1) {
                    vsTrackClick("http://travel.travelocity.com/___waseq.img", "GLB_HOMEPAGE.EXPLORE", 1);
                }
                $("expl-dest-radio").checked = true;
                noneBlock("book-trip!0", "expl-dest!1", "my-trav!0", "find-deal!0");
                cssSwitch("book-trip-nav-link!", "expl-dest-nav-link!current", "my-trav-nav-link!", "find-deal-nav-link!");
                $("misc-links").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/misc_links_bg.gif)";
                $("content").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/content_bg.gif)";
                break;
            case "my-trav":
                if (initFromReload != 1) {
                    vsTrackClick("http://travel.travelocity.com/___waseq.img", "GLB_HOMEPAGE.MYTRAVELOCITY", 1);
                }
                if (this.fwCalled == 0) {
                    getfw(this.fwUser);
                }
                $("my-trav-radio").checked = true;
                noneBlock("book-trip!0", "expl-dest!0", "my-trav!1", "find-deal!0");
                cssSwitch("book-trip-nav-link!", "expl-dest-nav-link!", "my-trav-nav-link!current", "find-deal-nav-link!");
                $("misc-links").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/misc_links_bg.gif)";
                $("content").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/content_bg.gif)";
                break;
            case "find-deal":
                if (initFromReload != 1) {
                    vsTrackClick("http://travel.travelocity.com/___waseq.img", "GLB_HOMEPAGE.FINDDEALS", 1);
                }
                $("find-deal-radio").checked = true;
                noneBlock("book-trip!0", "expl-dest!0", "my-trav!0", "find-deal!1");
                cssSwitch("book-trip-nav-link!", "expl-dest-nav-link!", "my-trav-nav-link!", "find-deal-nav-link!current");
                $("misc-links").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/misc_links_bg_on.gif)";
                $("content").style.backgroundImage = "url(http://i.travelpn.com/images/i/homepage/content_bg_on.gif)";
                break;
        }
        return false;
    }
};
var cannonball = {
    maintainItems: ["country", "from", "to", "fromdate", "todate", "fromtime", "totime", "state", "rooms", "minors", "adults", "seniors"],
    fodatetypes: ["fo-exact", "fo-plus-minus", "fo-flex"],
    startDate: new Date(),
    checkStartDate: new Date(),
    checkStartDate2: new Date(),
    cbStartMonth: 0,
    cbCheckStartMonth: 0,
    cbCheckStartMonth2: 0,
    endDate: new Date(),
    checkEndDate: new Date(),
    checkEndDate2: new Date(),
    cbEndMonth: 0,
    cbCheckEndMonth: 0,
    cbCheckEndMonth2: 0,
    init: function(){
        this.cbNav = $("cb-nav-form").nav;
		if(typeof this.cbNav == "object" && typeof this.cbNav.length == "undefined" && this.cbNav.tagName.toLowerCase() == "input"){ 
			this.cbNav = new Array(this.cbNav);
			}
        for (var z = 0; z < this.cbNav.length; z++) {
            this.cbNav[z].onclick = function(e){
                cannonball.setUp(e);
            };
            var cbLob = this.cbNav[z].value;
            var cancelFromFocus = function(e){
                e.cancelBubble = true;
                openCal(this, this.id, this.id.split("-")[0] + "-todate", "calbox", this.id, "us", "vertical");
            };
            var calFromOpener = function(){
                if (prevDef == 0) {
                    openCal(this, this.id, this.id.split("-")[0] + "-todate", "calbox", this.id, "us", "vertical");
                }
            };
            var calFromCloser = function(){
                t_calcloser = setTimeout("closeCal()", 500);
            };
            if ($(cbLob + "-fromdate")) {
                if ($(cbLob + "-fromdate").value == "") {
                    $(cbLob + "-fromdate").value = "mm/dd/yyyy";
                }
                YAHOO.util.Event.addListener($(cbLob + "-fromdate"), "focus", calFromOpener);
                YAHOO.util.Event.addListener($(cbLob + "-fromdate"), "blur", calFromCloser);
                YAHOO.util.Event.addListener($(cbLob + "-fromdate"), "click", cancelFromFocus);
            }
            var cancelToFocus = function(e){
                e.cancelBubble = true;
                openCal(this, this.id.split("-")[0] + "-fromdate", this.id, "calbox", this.id, "us", "vertical");
            };
            var calToOpener = function(){
                if (prevDef == 0) {
                    openCal(this, this.id.split("-")[0] + "-fromdate", this.id, "calbox", this.id, "us", "vertical");
                }
            };
            var calToCloser = function(){
                t_calcloser = setTimeout("closeCal()", 500);
            };
            if ($(cbLob + "-todate")) {
                if ($(cbLob + "-todate").value == "") {
                    $(cbLob + "-todate").value = "mm/dd/yyyy";
                }
                YAHOO.util.Event.addListener($(cbLob + "-todate"), "focus", calToOpener);
                YAHOO.util.Event.addListener($(cbLob + "-todate"), "blur", calToCloser);
                YAHOO.util.Event.addListener($(cbLob + "-todate"), "click", cancelToFocus);
            }
        }
        if ($("book-trip")) {
            var cbitems = $("book-trip").getElementsByTagName("*");
            for (var a = 0; a < cbitems.length; a++) {
                if (cbitems[a].id && cbitems[a].id.indexOf("-") > -1) {
                    var kwd = cbitems[a].id.split("-")[1];
                    cbkwd = kwd.replace(/[0-9]/g, "");
                    for (var b = 0; b < this.maintainItems.length; b++) {
                        if (cbkwd == this.maintainItems[b]) {
                            switch (cbkwd) {
                                case "minors":
                                    var changed = function(){
                                        var lob = this.id.split("-")[0];
                                        if ($(lob + "-rooms")) {
                                            cannonball.multirooms($(lob + "-rooms"));
                                        }
                                        else {
                                            cannonball.multirooms(this);
                                        }
                                        cannonball.maintainState(this);
                                    };
                                    break;
                                case "rooms":
                                    var changed = function(){
                                        cannonball.multirooms(this);
                                        if (this.options[this.selectedIndex].text != "5+") {
                                            cannonball.maintainState(this);
                                        }
                                    };
                                    break;
                                case "country":
                                    var changed = function(){
                                        cb_hoscope(this, this.id.split("-")[0] + "-state-span");
                                        cannonball.maintainState(this);
                                    };
                                    break;
                                default:
                                    var changed = function(){
                                        cannonball.maintainState(this);
                                    };
                            }
                            var theEl = cbitems[a];
                            if (typeof(theEl) != "undefined") {
                                YAHOO.util.Event.addListener(theEl, "change", changed);
                            }
                        }
                    }
                }
            }
            this.ls();
            this.setUp();
            for (var a = 0; a < this.fodatetypes.length; a++) {
                YAHOO.util.Event.addListener(this.fodatetypes[a], "click", function(){
                    cb_airDateType(this);
                });
            }
        }
    },
    setUp: function(cbradio){
        noneBlock("ddate-flex!0", "rdate-flex!0", "flex-dates!0");
        var selform = "";
        noneBlock("cb-error!0", "cb-alert!0");
		if(typeof this.cbNav == "object" && typeof this.cbNav.length == "undefined" && this.cbNav.tagName.toLowerCase() == "input"){ 
			this.cbNav = new Array(this.cbNav);
			}
	    for (var i = 0; i < this.cbNav.length ; i++) {
			if (this.cbNav[i].checked) { 
                switch (this.cbNav[i].value) {
                    case "fhc":
                        noneBlock("form-fhc!1", "fhc-adv-options!1");
                        this.cbAlert("Car pick-up/drop-off based on selected departure and return times.");
                        this.multirooms($("fhc-rooms"));
                        break;
                    case "fh":
                        noneBlock("form-fh!1", "fh-adv-options!1", "cb-alert!0");
                        $("book-trip").className = "section";
                        this.multirooms($("fh-rooms"));
                        break;
                    case "hc":
                        noneBlock("form-hc!1", "hc-adv-options!1", "cb-alert!0");
                        $("book-trip").className = "section";
                        cb_hoscope($("hc-country"), "hc-state-span");
                        this.multirooms($("hc-rooms"));
                        break;
                    case "cro":
                        noneBlock("form-cro!1", "cro-adv-options!1", "cb-alert!0");
                        $("book-trip").className = "section";
                        if ($("cro-tk").checked) {
                            noneBlock("cro-tkcruiselines!1");
                        }
                        else {
                            noneBlock("cro-tkcruiselines!0");
                        }
                        break;
                    case "fo":
                        noneBlock("form-fo!1", "fo-adv-options!1", "cb-alert!0");
                        $("book-trip").className = "section";
                        for (var x = 0; x < $("form-fo").dateTypeSelect.length; x++) {
                            if ($("form-fo").dateTypeSelect[x].checked) {
                                cb_airDateType($("form-fo").dateTypeSelect[x]);
                            }
                        }
                        this.multirooms($("fo-minors"));
                        break;
                    case "ho":
                        noneBlock("form-ho!1", "ho-adv-options!1", "cb-alert!0");
                        $("book-trip").className = "section";
                        cb_hoscope($("ho-country"), "ho-state-span");
                        this.multirooms($("ho-rooms"));
                        break;
                    case "co":
                        noneBlock("form-co!1", "co-adv-options!1", "cb-alert!0");
                        $("book-trip").className = "section";
                        $("co-pickupoption").selectedIndex = 0;
                        break;
					case "lmpo": 
						noneBlock("form-lmpo!1", "lmpo-adv-options!1", "cb-alert!0") ;
						$("book-trip").className = "section";
						break;	
                }
                clearErrorFields();
            }
            else {
                switch (this.cbNav[i].value) {
                    case "fhc":
                        noneBlock("form-fhc!0", "fhc-adv-options!0");
                        break;
                    case "fh":
                        noneBlock("form-fh!0", "fh-adv-options!0");
                        break;
                    case "hc":
                        noneBlock("form-hc!0", "hc-adv-options!0");
                        break;
                    case "cro":
                        noneBlock("form-cro!0", "cro-adv-options!0");
                        break;
                    case "fo":
                        noneBlock("form-fo!0", "fo-adv-options!0");
                        break;
                    case "ho":
                        noneBlock("form-ho!0", "ho-adv-options!0");
                        break;
                    case "co":
                        noneBlock("form-co!0", "co-adv-options!0");
                        break;
					case "lmpo":
						noneBlock("form-lmpo!0", "lmpo-adv-options!0");;
					break;	
                }
            }
        }
    },
    maintainState: function(o_input){
        var cbnavform = $("cb-nav-form");
        if (!cbnavform || typeof(o_input) != "object") {
            return false;
        }
        var s_bit = o_input.id.split("-")[1];
        for (var i = 0; i < cbnavform.nav.length; i++) {
            var s_formbit = cbnavform.nav[i].value;
            var o_formelement = $(s_formbit + "-" + s_bit);
            if (cbnavform.nav[i].value && o_formelement != o_input) {
                if (o_formelement && o_formelement != o_input && o_input.type != "radio") {
                    if (o_formelement.type == "select-one" && o_formelement.length > o_input.selectedIndex) {
                        o_formelement.selectedIndex = o_input.selectedIndex;
                    }
                    else {
                        if (o_formelement.type == o_input.type) {
                            o_formelement.value = o_input.value;
                        }
                    }
                }
                else {
                    var theForm = "$('form-" + cbnavform.nav[i].value + "')";
                    if (eval(theForm) != null) {
                        var a_input = eval(theForm + "." + o_input.name);
                        if (a_input) {
                            for (j = 0; j < a_input.length; j++) {
                                if (a_input[j] != o_input && a_input[j].value == o_input.value) {
                                    a_input[j].checked = "checked";
                                }
                            }
                        }
                    }
                }
            }
        }
    },
    multirooms: function(oSel){
        var numrooms = parseInt(oSel.options[oSel.selectedIndex].text);
        var roomlob = oSel.id.split("-")[0];
        if (numrooms == "5" && roomlob != "fo") {
            noneBlock("ho-minorrooms-span!0");
            clearErrorFields();
            this.cbAlert('To request 5+ rooms, please access our <a href="http://www.travelocity.com/HotelPlanner" target="_blank">group booking tool</a> or reduce the number of rooms.');
        }
        else {
            if (roomlob == "ho") {
                noneBlock("ho-minorrooms-span!3", "cb-alert!0");
                clearErrorFields();
            }
        }
        var isHO = (roomlob == "ho") ? 0 : 1;
        var childrenExist = 0;
        if (roomlob != "fo") {
            for (var i = 1; i < oSel.options.length + isHO; i++) {
                if (i <= numrooms) {
                    document.getElementById(roomlob + "-multiroom" + (i)).style.display = "";
                    var childopt = document.getElementById(roomlob + "-minors" + (i));
                    var numChild = childopt.options[childopt.selectedIndex].text;
                    if (numChild > 0) {
                        childrenExist = 1;
                        noneBlock(roomlob + "-minorroom" + i + "!1", roomlob + "-minorroom" + (i) + "-ages!3");
                        if ($(roomlob + "-minorcaption")) {
                            noneBlock(roomlob + "-minorcaption!2");
                        }
                        for (var j = 1; j < childopt.options.length + 1; j++) {
                            if (j <= numChild) {
                                noneBlock(roomlob + "-minor" + j + "room" + i + "!3");
                            }
                            else {
                                if ($(roomlob + "-minor" + j + "room" + i)) {
                                    noneBlock(roomlob + "-minor" + j + "room" + i + "!0");
                                }
                            }
                        }
                    }
                    else {
                        noneBlock(roomlob + "-minorroom" + i + "!0", roomlob + "-minorroom" + (i) + "-ages!0");
                    }
                }
                else {
                    noneBlock(roomlob + "-multiroom" + (i) + "!0", roomlob + "-minorroom" + (i) + "!0", roomlob + "-minorroom" + (i) + "-ages!0");
                }
            }
        }
        else {
            var numChildren = numrooms;
            if (numChildren > 0) {
                childrenExist = 1;
                noneBlock("fo-minorages!1", "fo-minorcaption!1");
                for (var k = 1; k < oSel.options.length + 1; k++) {
                    if (k <= numChildren) {
                        noneBlock(roomlob + "-minor" + k + "!1");
                    }
                    else {
                        if ($(roomlob + "-minor" + k)) {
                            noneBlock(roomlob + "-minor" + k + "!0");
                        }
                    }
                }
            }
            else {
                noneBlock("fo-minorages!0", "fo-minorcaption!0");
            }
        }
        if (childrenExist == 0) {
            if ($(roomlob + "-minorcaption")) {
                noneBlock(roomlob + "-minorcaption!0");
            }
        }
    },
    ls: function(){
        ssCookie = lscookie.split("|");
        if (ssCookie != "") {
            var ssLob = ssCookie[0];
            var ssOrig = ssCookie[1];
            var ssDest = ssCookie[2];
            var ssFromDate = ssCookie[3];
            var ssToDate = ssCookie[4];
            var ssFD = ssFromDate.split("/");
            var ssFDCheck = new Date(ssFD[2], (ssFD[0] - 1), ssFD[1]);
            var ssTD = ssToDate.split("/");
            var ssTDCheck = new Date(ssTD[2], (ssTD[0] - 1), ssTD[1]);
            var todaysDate = new Date();
            if ((todaysDate > ssFDCheck) || (todaysDate > ssTDCheck)) {
                ssFromDate = "mm/dd/yyyy";
                ssToDate = "mm/dd/yyyy";
            }
            var ssCountry = ssCookie[5].replace(":", "");
            switch (ssLob.toLowerCase()) {
                case "air":
                    var fofrom = $("fo-from");
                    fofrom.value = ssOrig;
                    this.maintainState(fofrom);
                    var foto = $("fo-to");
                    foto.value = ssDest;
                    this.maintainState(foto);
                    var fofromdate = $("fo-fromdate");
                    fofromdate.value = ssFromDate;
                    this.maintainState(fofromdate);
                    var fotodate = $("fo-todate");
                    fotodate.value = ssToDate;
                    this.maintainState(fotodate);
                    break;
                case "totaltrip":
                    var fhfrom = $("fh-from");
                    fhfrom.value = ssOrig;
                    this.maintainState(fhfrom);
                    var fhto = $("fh-to");
                    fhto.value = ssDest;
                    this.maintainState(fhto);
                    var fhfromdate = $("fh-fromdate");
                    fhfromdate.value = ssFromDate;
                    this.maintainState(fhfromdate);
                    var fhtodate = $("fh-todate");
                    fhtodate.value = ssToDate;
                    this.maintainState(fhtodate);
                    break;
                case "hotel":
                    var hoto = $("ho-to");
                    if (ssDest.indexOf(",") > -1) {
                        sss = ssDest;
                        hodest = ssDest.split(",");
                        hoto.value = hodest[0];
                        for (var x = 0; x < $("ho-state").options.length; x++) {
                            hostate = $("ho-state").options[x].value.replace(" ", "");
                            if (hostate == hodest[1].replace(" ", "")) {
                                $("ho-state").options[x].selected = "selected";
                            }
                        }
                    }
                    else {
                        hoto.value = ssDest;
                    }
                    this.maintainState(hoto);
                    var hofromdate = $("ho-fromdate");
                    if (ssFromDate != "") {
                        hofromdate.value = ssFromDate;
                    }
                    this.maintainState(hofromdate);
                    var hotodate = $("ho-todate");
                    if (ssToDate != "") {
                        hotodate.value = ssToDate;
                    }
                    this.maintainState(hotodate);
                    for (var x = 0; x < $("ho-country").options.length; x++) {
                        if ($("ho-country").options[x].value == ssCountry) {
                            $("ho-country").selectedIndex = x;
                        }
                    }
                    this.maintainState($("ho-country"));
                    break;
                case "car":
                    var coto = $("co-to");
                    coto.value = ssDest;
                    this.maintainState(coto);
                    var cofromdate = $("co-fromdate");
                    cofromdate.value = ssFromDate;
                    this.maintainState(cofromdate);
                    var cotodate = $("co-todate");
                    cotodate.value = ssToDate;
                    this.maintainState(cotodate);
                    break;
                case "cruise":
                    break;
            }
        }
    },
    cbAlert: function(alMsg){
        if ($("cb-alert")) {
            $("cb-alert-msg").innerHTML = alMsg;
            $("book-trip").className = "section alert";
            noneBlock("cb-alert!1");
        }
    }
};
var footerlinks = {
    activeSection: "",
    sections: ["tvl-hot-dest", "vac-dest-links", "intl-sites"],
    activeHClass: "active-heading",
    inactiveHClass: "inactive-heading",
    init: function(){
        for (var x = 0; x < this.sections.length; x++) {
            var sectionH = $(this.sections[x] + "-heading").getElementsByTagName("a")[0];
            YAHOO.util.Event.addListener(sectionH, "mouseover", function(){
                footerlinks.hoverin(this.parentNode);
            });
            YAHOO.util.Event.addListener(sectionH, "mouseout", function(){
                footerlinks.hoverout(this.parentNode);
            });
            YAHOO.util.Event.addListener(sectionH, "click", function(e){
                prvtDef(e);
                footerlinks.activate(this.parentNode);
            });
        }
    },
    hoverin: function(oLink){
        oLink.className = this.activeHClass;
    },
    hoverout: function(oLink){
        if (oLink != this.activeSection) {
            oLink.className = this.inactiveHClass;
        }
    },
    activate: function(oLink){
        var olID = (oLink == this.activeSection) ? "" : oLink.id;
        this.activeSection = (olID == "") ? "" : oLink;
        for (var x = 0; x < this.sections.length; x++) {
            var odID = olID.replace("-heading", "");
            var olDiv = $(odID);
            if (odID == this.sections[x]) {
                $(this.sections[x] + "-heading").className = this.activeHClass;
                noneBlock(this.sections[x] + "!1");
            }
            else {
                $(this.sections[x] + "-heading").className = this.inactiveHClass;
                noneBlock(this.sections[x] + "!0");
            }
        }
    }
};
function gnomeImageOffset(){
    var gnomeOffset = 0;
    var gnomeTop = parseInt(YAHOO.util.Dom.getStyle("gnome-image", "top"));
    var tvlAlerts = YAHOO.util.Dom.getElementsByClassName("trav-alert", "p");
    for (var a = 0; a < tvlAlerts.length; a++) {
        gnomeOffset += parseInt(YAHOO.util.Dom.getStyle(tvlAlerts[a], "height"));
    }
    var tvlAdvisories = YAHOO.util.Dom.getElementsByClassName("trav-advisory", "p");
    for (var b = 0; b < tvlAdvisories.length; b++) {
        gnomeOffset += parseInt(YAHOO.util.Dom.getStyle(tvlAdvisories[b], "height"));
    }
    YAHOO.util.Dom.setStyle("gnome-image", "top", (gnomeTop + gnomeOffset + 2) + "px");
    YAHOO.util.Event.addListener("gnome-image", "mouseover", function(){
        this.style.backgroundImage = "url(http://i.travelocity.com.edgesuite.net/images/i/homepage/gnome_sun_shine.gif)";
    });
    YAHOO.util.Event.addListener("gnome-image", "mouseout", function(){
        this.style.backgroundImage = "none";
    });
}

function formCtrl(o_form){
    s_formName = o_form.id;
    var b_submit = false;
    var s_popFlag = arguments[1] || "0";
    switch (s_formName) {
        case "form-co":
            o_select = document.getElementById("co-pickupoption");
            switch (o_select.options[o_select.selectedIndex].value) {
                case "pu_poi":
                    b_submit = checkform(o_form, 2, 3, 6, 8);
                    break;
                case "pu_addr":
                    b_submit = checkform(o_form, 6);
                    break;
                default:
                    b_submit = checkform(o_form, 1, 2, 3, 6, 8);
            }
            break;
        case "form-fo":
            var airDateTyp;
            for (var t = 0; t < o_form.dateTypeSelect.length; t++) {
                if (o_form.dateTypeSelect[t].checked) {
                    airDateTyp = o_form.dateTypeSelect[t].value;
                }
            }
            if (airDateTyp != "flexibleDates") {
                b_submit = checkform(o_form, 1, 2, 3, 4, 5, 8);
            }
            else {
                b_submit = checkform(o_form, 1, 2, 3, 5);
            }
            break;
        case "form-fh":
            b_submit = checkform(o_form, 1, 2, 3, 4, 8, 9);
            break;
        case "form-fow":
            b_submit = checkform(o_form, 1, 2, 3, 4, 5);
            break;
        case "form-hc":
            o_select = document.getElementById("hc-pickupoption");
            b_submit = checkform(o_form, 1, 2, 3, 8, 9);
            break;
        case "form-ho":
            b_submit = cb_hosubmit(o_form, formCtrl.arguments[2]);
            break;
        case "form-fhc":
            o_select = document.getElementById("fhc-pickupoption");
            if (o_select) {
                switch (o_select.options[o_select.selectedIndex].value) {
                    case "pu_poi":
                        b_submit = checkform(o_form, 2, 3, 6);
                        break;
                    case "pu_addr":
                        b_submit = checkform(o_form, 6);
                        break;
                    default:
                        b_submit = checkform(o_form, 1, 2, 3, 8, 9);
                }
            }
            else {
                b_submit = checkform(o_form, 1, 2, 3, 8, 9);
            }
            break;
        case "form-act":
            b_submit = checkform(o_form, 8);
            break;
		case "form-lmpo":
            b_submit = checkform(o_form);
            break;		
    }
    return b_submit;
}

function cb_hosubmit(o_form){
    b_form = false;
    var numRooms = $("ho-rooms");
    if (numRooms.options[numRooms.selectedIndex].text.indexOf("+") > -1 || cb_hosubmit.arguments[1] == "undefined") {
        s_groople = "/Groople?";
        s_groople += "Checkin=" + o_form.leavingDate.value;
        s_groople += "&Checkout=" + o_form.returningDate.value;
        switch (o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.toLowerCase()) {
            case "us":
            case "ca":
                s_groople += "&City=" + escape(o_form.city.value);
                if (o_form.state.options[o_form.state.selectedIndex].value != "") {
                    s_groople += ",%20" + o_form.state.options[o_form.state.selectedIndex].value;
                }
                break;
            default:
                s_groople += "&City=" + escape(o_form.city.value) + ",%20" + o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.substr(0, 2);
        }
        s_groople += "&Rooms=5";
        window.open(s_groople, null, "width=954,height=730,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes");
    }
    else {
        var __toDate = document.getElementById("ho-todate");
        var __fromDate = document.getElementById("ho-fromdate");
        b_form = ((__toDate.value == "mm/dd/yyyy" || __toDate.value == "") && (__fromDate.value == "mm/dd/yyyy" || __fromDate.value == "")) ? checkform(o_form, 1, 2, 3, 9) : checkform(o_form, 1, 2, 3, 8, 9);
    }
    return b_form;
}

function LinkSubmitGroople(o_form){
    groople_url = "/Groople?";
    groople_url += "Checkin=" + o_form.leavingDate.value;
    groople_url += "&Checkout=" + o_form.returningDate.value;
    switch (o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.toLowerCase()) {
        case "us":
        case "ca":
            groople_url += "&City=" + escape(o_form.city.value);
            if (o_form.state.options[o_form.state.selectedIndex].value != "") {
                s_groople += ",%20" + o_form.state.options[o_form.state.selectedIndex].value;
            }
            break;
        default:
            groople_url += "&City=" + escape(o_form.city.value) + ",%20" + o_form.cityCountryCode.options[o_form.cityCountryCode.selectedIndex].value.substr(0, 2);
    }
    groople_url += "&Rooms=5";
    window.open(groople_url, null, "width=954,height=730,resizable=yes,scrollbars=yes,toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,copyhistory=yes");
}

var oairType;
function cb_airDateType(o_radio){
    var selval = o_radio.value;
    switch (selval) {
        case "exactDates":
            noneBlock("nonflex-dates!1", "flex-dates!0", "fo-fromtime-span!3", "fo-fromtime!3", "fo-totime-span!3", "fo-totime!3", "ddate-flex-span!0", "rdate-flex-span!0");
            break;
        case "plusMinusDates":
            noneBlock("nonflex-dates!3", "flex-dates!0", "fo-fromtime-span!0", "fo-fromtime!0", "fo-totime-span!0", "fo-totime!0", "ddate-flex-span!3", "ddate-flex!3", "rdate-flex-span!3", "rdate-flex!3");
            break;
        case "flexibleDates":
            noneBlock("nonflex-dates!0", "flex-dates!3", "fo-fromtime!0", "fo-fromtime-span!0", "fo-totime!0", "fo-totime-span!0", "ddate-flex!0", "ddate-flex-span!0", "rdate-flex!0", "rdate-flex-span!0");
            break;
    }
    oairType = selval;
}

function carPUDO(o_select){
    sPfx = o_select.id.split("-");
    sPrefix = sPfx[0].toLowerCase();
    switch (o_select.options[o_select.selectedIndex].value) {
        case "pu_air":
            $("co-to").removeAttribute("name");
            $("co-to").setAttribute("name", "pickupCity");
            $("co-poi-state-span").style.visibility = "hidden";
            break;
        case "pu_poi":
            $("co-to").removeAttribute("name");
            $("co-to").setAttribute("name", "pickupPoi");
            $("co-poi-state-span").style.visibility = "visible";
            break;
        default:
            window.location = o_select.options[o_select.selectedIndex].value;
    }
}

function cb_hoscope(o_select, s_state){
    switch (o_select.value.toLowerCase()) {
        case "us":
        case "ca":
            document.getElementById(s_state).style.visibility = "visible";
            break;
        default:
            document.getElementById(s_state).style.visibility = "hidden";
    }
}

function addvars(url, o_form){
    s_url = new String(url);
    s_url += "&expr_path=" + o_form.expr_path.value;
    s_url += (o_form.name == "formHOgbl") ? "&airport=" + o_form.airport.value : "&city=" + o_form.city.value;
    s_url += "&searchMode=" + o_form.searchMode.value;
    o_hototalrooms = document.getElementById("ho-totalrooms");
    s_url += "&numRooms=" + o_hototalrooms.options[o_hototalrooms.selectedIndex].text;
    s_url += "&leavingDate=" + document.getElementById("ho-fromdate").value;
    s_url += "&returningDate=" + document.getElementById("ho-todate").value;
    if (o_hototalrooms.options[o_hototalrooms.selectedIndex].text.indexOf("+") == -1) {
        for (var i = 1; i < o_hototalrooms.selectedIndex + 2; i++) {
            o_adult = document.getElementById("ho-adult" + i);
            s_url += "&adult" + (i) + "=" + o_adult.options[o_adult.selectedIndex].text;
            o_child = document.getElementById("ho-minor" + i);
            s_url += "&child" + (i) + "=" + o_child.options[o_child.selectedIndex].text;
        }
    }
    s_url += "&state=" + o_form.state.value;
    if (o_form.cityCountryCode) {
        s_url += "&cityCountryCode=" + o_form.cityCountryCode.value;
    }
    parent.window.location = s_url;
}

function getElementByValue(ElementCollection, Value){
    var i, Element;
    for (i = 0; i < ElementCollection.length; i++) {
        if (ElementCollection[i].value == Value) {
            return ElementCollection[i];
        }
    }
    return null;
}

var lscookie = "";

function on_load(){
    setBodyClick();
    cannonball.init();
}

/*YAHOO.util.Event.onDOMReady(on_load);*/

 add2onload(on_load);
