
 function TextSignup(el){    
   if(el.value == "Enter your email address"){
        el.value = "";
        $(el).css("color","#000000");
   }else if(el.value == ""){
        el.value = "Enter your email address";
        $(el).css("color","");
   }
}

function showNewsPopup(id) {  
    //we have to use iframe over ajax because the sharethis widget does not play nice with ajax  
    $("#newsItemPopup").html("<iframe src='/newsitem.aspx?newsid=" + id + "' frameborder='0' scrolling='no' width='512' height='535' id='ifrmNewsItem' ></iframe>");

    //$("#newsItemPopup").load('/newsitem.aspx?newsid=' + id, function () {
        $("#newsItemPopup").dialog({
            width: 512, modal: true, resizable: false
        });
   // });
       
    return false;
}


function showVideoPopup() {
    var params = {};
    params.menu = "false";
  
    swfobject.embedSWF("/CMSFlash/hardrockhotels/experienceVideo.swf", "videoPopupFlash", "640", "360", "8.0.0", "", "", params);
 

    $("#videoPopup").dialog({
        autoOpen: false, width: 672, height: 450, modal: true, resizable: false, beforeClose: function (event, ui) { $("#videoPopupFlash").html(""); $("#videoPopup").dialog('destroy'); return;}

    });

    $("#videoPopup").dialog('open');

    return false;
}

function show30secSpotPopup() {
    var params = {};
    params.menu = "false";
  
    swfobject.embedSWF("/CMSFlash/hardrockhotels/30secSpotVideo.swf", "30secPopupFlash", "640", "360", "8.0.0", "", "", params);
 

    $("#30secSpotPopup").dialog({
        autoOpen: false, width: 672, height: 450, modal: true, resizable: false, beforeClose: function (event, ui) { $("#30secPopupFlash").html(""); $("#30secSpotPopup").dialog('destroy'); return;}

    });

    $("#30secSpotPopup").dialog('open');

    return false;
}


function unblock() {
    $.unblockUI();
}

// submit search
function submitSearch(TrackingSrcPrefix){
   //window.location.href='/search/default.aspx?searchString=' + $('#txtSearch').val() + '&src=' + TrackingSrcPrefix + "_search";
   window.location='/search/default.aspx?searchString=' + $('#txtSearch').val() + '&src=' + TrackingSrcPrefix + "_search";
}

//check for enter key for search
function checkEnter(e){    
   
    if(window.event)
        key = window.event.keyCode; //IE
    else
        key = e.which; //firefox 
          
    if (key == 13)
    {        
        submitSearch();
        return false;
    }else{
        return true;
    }
}
 
 
 //dom ready functions
$(function () {
    //Add mouseover to all images with "hover" as classname  
    $("img.hover, input.hover").hover(function () {
        var imgOver = $(this).attr('src').replace(/(.*)\.(gif|jpg|png)/gi, "$1_over.$2");
        $(this).attr('src', imgOver);
    }, function () {
        var imgCurrent = $(this).attr('src').replace(/(.*)_over\.(gif|jpg|png)/gi, "$1.$2");
        $(this).attr('src', imgCurrent);
    });

    //Preload all hover images
    $("img.hover,input.hover").each(function () {
        var imgOver = $(this).attr('src').replace(/(.*)\.(gif|jpg|png)/gi, "$1_over.$2");
        jQuery("<img>").attr("src", imgOver);
    });


    $(".newsContainer .RSSItem a").each(function () {
        $(this).click(function () {
            //var strTitle = $(this).find(".RSSItemTitle").html();
            //strTitle = escape(strTitle);
            //showNewsPopup(strTitle);            
            return showNewsPopup($(this).parent().attr('id'));

        });
    });

    //aligns all the nav dropdowns
    // $("li.navItem ul:not(#lastSubMenu, #firstSubMenu)").each(function() {$(this).css("left",((($(this).width() - ($(this).parent().width() - 10) ) /2) * -1) - 50 + "px") });
    //$("li.navItem ul:last").css("left","inherit").css("right","-23px");;


});
 
 
function toggleDisclaimer(SpecialoffersID){
    var lnk = $('.lnk_'+ SpecialoffersID).find('img');
    $('.offer_' + SpecialoffersID).slideToggle(
    function () {

        if ($('.offer_' + SpecialoffersID).is(':visible')) {
            $(lnk).attr('src', $(lnk).attr('src').replace("view", "close"));            
        } else {
            $(lnk).attr('src', $(lnk).attr('src').replace("close", "view"));           
        }
    });    
}

function toggleMoreInfo(LocationID){
    var lnk = $('.moreinfoLnk_'+ LocationID).find('img');
    $('.moreinfo_' + LocationID).slideToggle(
     function () {
         if ($('.moreinfo_' + LocationID).is(':visible')) {
             $(lnk).attr('src', $(lnk).attr('src').replace("view", "close"));
         } else {
             $(lnk).attr('src', $(lnk).attr('src').replace("close", "view"));
         }
     });
 }


 function remote(url) {
     window.location = url;
 } 

