
function addFavorite()
{var url=window.location.href;var title=window.document.title;if(window.sidebar){window.sidebar.addPanel(title,url,"");}else if(window.external){window.external.AddFavorite(url,title);}else if(window.opera){return false;}else{alert('Unfortunately, this browser does not support the requested action,'
+' please bookmark this page manually.');}}
function GoToMediaKit()
{var frm=document.getElementById("frmMediaKit");frm.submit();}
function HotelSearch()
{if(checkFields())
{saveSearchCookies();$("#frmHome").submit();}}
function saveSearchCookies()
{cookieSave("RoomType5",$("#cboFrmRoomType5").attr("selectedIndex"));cookieSave("RoomType6",$("#cboFrmRoomType6").attr("selectedIndex"));cookieSave("RoomType7",$("#cboFrmRoomType7").attr("selectedIndex"));cookieSave("RoomType8",$("#cboFrmRoomType8").attr("selectedIndex"));cookieSave("CityName",$("#txtCityName").attr("value"));cookieSave("CityCode",$("#txtCityCode").attr("value"));}
function loadSearchCookies()
{var ckRoomType5=cookieGet("RoomType5");var ckRoomType6=cookieGet("RoomType6");var ckRoomType7=cookieGet("RoomType7");var ckRoomType8=cookieGet("RoomType8");var ckCityCode=cookieGet("CityCode");var ckCityName=cookieGet("CityName");if((ckRoomType5!=="")&&(ckRoomType5!==null))
{$('#cboFrmRoomType5').attr('selectedIndex',ckRoomType5);}
if((ckRoomType6!=="")&&(ckRoomType6!==null))
{$('#cboFrmRoomType6').attr('selectedIndex',ckRoomType6);}
if((ckRoomType7!=="")&&(ckRoomType7!==null))
{$('#cboFrmRoomType7').attr('selectedIndex',ckRoomType7);}
if((ckRoomType8!=="")&&(ckRoomType8!==null))
{$('#cboFrmRoomType8').attr('selectedIndex',ckRoomType8);}
if((ckCityCode!=="")&&(ckCityCode!==null))
{$('#txtCityCode').attr('value',ckCityCode);}
if((ckCityName!=="")&&(ckCityName!==null))
{$('#txtCityName').attr('value',ckCityName);}}
function checkFields(){if($('#txtCityCode').attr('value')=='')
{alert($('#txtWord122').attr('value'));return false;}
if(!isDate($('#txtFrmFechaCheckIn').attr('value'),$('#txtFormatDate').attr('value')))
{alert($('#txtWord26').attr('value'));$('#txtFrmFechaCheckIn').focus();$('#txtFrmFechaCheckIn').select();return false;}
if(!isDate($('#txtFrmFechaCheckOut').attr('value'),$('#txtFormatDate').attr('value')))
{alert($('#txtWord53').attr('value'));$('#txtFrmFechaCheckOut').focus();$('#txtFrmFechaCheckOut').select();return false;}
if(dateDiffCurrent($('#txtFrmFechaCheckIn').attr('value'),$('#txtFormatDate').attr('value'))<0){alert($('#txtWord26').attr('value'));return false;}
if(dateDiffCurrent($('#txtFrmFechaCheckIn').attr('value'),$('#txtFormatDate').attr('value'))>365){alert($('#txtWord26').attr('value'));return false;}
if(dateDiffCurrent($('#txtFrmFechaCheckOut').attr('value'),$('#txtFormatDate').attr('value'))>365){alert($('#txtWord53').attr('value'));return false;}
if(dateDiff($('#txtFrmFechaCheckIn').attr('value'),$('#txtFrmFechaCheckOut').attr('value'),$('#txtFormatDate').attr('value'))<1){alert($('#txtWord24').attr('value'));return false;}
if(dateDiff($('#txtFrmFechaCheckIn').attr('value'),$('#txtFrmFechaCheckOut').attr('value'),$('#txtFormatDate').attr('value'))>30){alert($('#txtWord51').attr('value'));return false;}
if(($('#cboFrmRoomType5').attr('selectedIndex')=='0')&&($('#cboFrmRoomType6').attr('selectedIndex')=='0')&&($('#cboFrmRoomType7').attr('selectedIndex')=='0')&&($('#cboFrmRoomType8').attr('selectedIndex')=='0')){alert($('#txtWord25').attr('value'));return false;}
return true;}
function ValidateNewsLettersForm()
{var nombre;var email;var word49;var word48;nombre=$("#txtNLNombre").attr('value');email=$("#txtNLEmail").attr('value');word49=$("#txtWord49").attr('value');word48=$("#txtWord48").attr('value');if((nombre==null)||(nombre=="")||(nombre=="Nombre")){alert(word49);$("#txtNLNombre").focus();return false;}
if((email==null)||(email=="")){alert(word48);$("#txtNLEmail").focus();return false;}
if(ValidarEmail(email)==false){alert(word48);$("#txtNLEmail").attr('value',"");$("#txtNLEmail").focus();return false;}
return true;}
function SendNewsletter()
{if(ValidateNewsLettersForm()!=false)
{CallActionMsg($("#txtPopNLAdvertenciaTitulo").attr("value"),$("#txtPopAdvertenciaPathImages").attr("value"))
$.post($("#txtAbsoluteURL").attr("value")+"Async/NewsletterSendMail.aspx",{txtClientCode:$('#txtClientCode').attr('value'),txtCountryCode:$('#txtPaxNationality').attr('value'),txtLenguajeCode:$('#txtLanguageCode').attr('value'),txtNombre:$('#txtNLNombre').attr('value'),txtEmail:$('#txtNLEmail').attr('value')},SendNewsletter_Finished)}}
function SendNewsletter_Finished(Resultado)
{$.unblockUI();asyncResponseHandle(Resultado);}
function ConfirmSubscriptionEmailMsg()
{$.unblockUI();var strHTML='';strHTML=strHTML+'<div class="Popadvertencia">';strHTML=strHTML+'<div class="Popadvertencia_titulo">';strHTML=strHTML+'</div>';strHTML=strHTML+'<div class="Popadvertencia_descripcion">';strHTML=strHTML+$("#txtMsgSuccessValue").attr("value");strHTML=strHTML+'</div>';strHTML=strHTML+'<div class="Popadvertencia_links">';strHTML=strHTML+'<a href="javascript:$.unblockUI();" class="botonInterno_1">'+$("#txtPopAdvertenciaBtnYes").attr("value")+'</a>';strHTML=strHTML+'</div>';strHTML=strHTML+'</div>';$.blockUI({message:strHTML,css:{height:'160px',width:'300px'}});}
function ErrorSubscriptionEmailMsg(){$.unblockUI();}