
var map;var map_mini_1;var loadedMap=false;var temp=0;var slide=0;var imgActual=0;var imgActualBig=0;var timeout;jQuery(document).ready(function(){jQuery.getScript(aa_config.STATIC_URL+'/js/ui.tabs.js',function(){jQuery('#availability').data('loaded',false);var tabs=jQuery('#content-tabs');tabs.tabs();tabs.bind('tabsshow',function(event,ui){if(ui.panel.id=="mapContainer")
{if(!loadedMap){initialize();}else{resizeMap();}}
else if(ui.panel.id=="details"){if(map_mini_1)map_mini_1.checkResize();}
else if(ui.panel.id=="photos"){if(!$('#photos').data('loaded')){$('#photos').data('loaded',true);$.ajax({method:"GET",data:"hotel=true&longitude="+AAH02_DDCLongitude+"&latitude="+AAH02_DDCLatitude,url:"/util/panoramio.php",success:function(datos){$('#panoramio').html(datos);$('#image-container').append($('#panoramio-all-photo'));}});}}});jQuery('#content-tabs').show();if(AAH02_currentTab!=''){tabs.tabs('select',AAH02_currentTab);}
$('.tooltip_desc').tooltip({showURL:false});setTimeout("initialize_mini()",300);});var img=new Image();jQuery('#imgFicha,#imgFicha1,#panoramio-photo').load(function(){jQuery('#loader').removeClass('loading')
jQuery(this).css({opacity:0}).show().stop().fadeTo(600,'1');}).error(function(){});jQuery('#imgBig').load(function(){jQuery('#loaderBig').removeClass('loading')
jQuery(this).css({opacity:1}).show().stop().fadeTo(600,'1');}).error(function(){});jQuery(window).load(function(){slide=1;setCurrent('0');if(AAH02_images>1){imgActual++;}})});function checkForAvailability(){jQuery('#availabilityLink').click();if(jQuery('#selectdates').css('display')=='none')
{jQuery.blockUI({showOverlay:false,message:jQuery('#selectdates')});setTimeout(hideMsg,1500);}}
function PreSubmitGuestInfoForm(form,searchString){$('#more_results').html('');document.getElementById('waiter').style.display='block';if(submitGuestInfoFormAsync(form,searchString)==false){document.getElementById('waiter').style.display='none';}}
function submitGuestInfoFormAsync(form,message){setSearchCacheID();if(validateGuests(form)){searchHotAsync(message);}}
function searchHotAsync(message,anchor)
{setEdades(0);if(valFechas(document.getElementById('varR_HIDIA').value,document.getElementById('varR_HIMES').value,document.getElementById('varR_HIANY').value,document.getElementById('varR_HFDIA').value,document.getElementById('varR_HFMES').value,document.getElementById('varR_HFANY').value))
{document.getElementById('bisR_HINI').value=document.getElementById('varR_HIANY').value+'-'+document.getElementById('varR_HIMES').value+'-'+document.getElementById('varR_HIDIA').value;document.getElementById('bisR_HFIN').value=document.getElementById('varR_HFANY').value+'-'+document.getElementById('varR_HFMES').value+'-'+document.getElementById('varR_HFDIA').value;reload('.CM'+message,'COMPXXH12','<div class="loading-bar"><oh id=23116>Buscando disponibilidad para las fechas elegidas</oh></div>',checkAvailabilityResult);}}
function hotelEval(item,message)
{document.OH.parCTLPag.value=0;document.OH.parCTLTPag.value=1;document.OH.parAL_ITEM.value=item;doSubmit(message);}
function cambiarImagen(imgGral,hrefGral,imgChg)
{imgGral.src=imgChg;hrefGral.href="javascript:popUpImage('"+imgChg+"')";}
function capas(idCapa)
{if(idCapa=='precios')
{document.getElementById("precios").style.visibility="visible";document.getElementById("precios").style.display="block";document.getElementById("reservar").style.visibility="hidden";document.getElementById("reservar").style.display="none";}
else
{document.getElementById("precios").style.visibility="hidden";document.getElementById("precios").style.display="none";document.getElementById("reservar").style.visibility="visible";document.getElementById("reservar").style.display="block";}}
function pre(message)
{document.OH.parCTLPag.value=0;document.OH.parCTLTPag.value=1;doSubmit(message);}
function doBook(ref,cont,type,board,message)
{ini=(document.getElementById('bisR_HINI').value).split("-");document.getElementById('varR_HIDIA').value=ini[2];document.getElementById('varR_HIMES').value=ini[1];document.getElementById('varR_HIANY').value=ini[0];document.getElementById('varR_HIMERGE').value=ini[0]+'-'+ini[1];fin=(document.getElementById('bisR_HFIN').value).split("-");document.getElementById('varR_HFDIA').value=fin[2];document.getElementById('varR_HFMES').value=fin[1];document.getElementById('varR_HFANY').value=fin[0];document.getElementById('varR_HFMERGE').value=fin[0]+'-'+fin[1];document.OH.parH_REF.value=ref;document.OH.parH_CONT.value=cont;document.OH.parHR_TYPE.value=type;document.OH.parHR_BOARD.value=board;doSubmitSSL(message);}
function newSearch(message)
{document.OH.parCTLPag.value=0;document.OH.parCTLTPag.value=1;doSubmit(message);}
function checkAvailabilityResult(){setSearchCacheID();$('#navigator').hide();$('#travel-details,#travel-details2').html($('#travel-details-ajax').html());$('#book-total,#book-total2').html($('#book-total-result').html());var total=$("#book-total-result").html();if(total!='&nbsp;'&&total!='')
{$('#reservation-details,#reservation-details2').html($('#reservation-details-ajax').html()).show();$('#bookDetails,#bookDetails2').show();$('#bookNoPrice,#bookNoPrice2').hide();$('#more-results').show();$('#availability-data').removeClass('none').html($('#availability-data-results').html());$('#starting_from').hide();}else{$('#reservation-details,#reservation-details2').hide();$('#more-results').hide();$('#availability-data').addClass('none').html('');$('#bookDetails,#bookDetails2').hide();$('#bookNoPrice,#bookNoPrice2').show();$('#starting_from').show();}
$('.tooltip_desc').tooltip({showURL:false});}
function hotelCard(ref,cont,message)
{setSearchCacheID();recuperarParams();document.OH.parH_REF.value=ref;document.OH.parH_CONT.value=cont;doSubmit(message,ref);}
function recuperarParams()
{var ini=($('#parR_HINI').val()).split("-");$('#varR_HIDIA').val(ini[2]);$('#varR_HIMES').val(ini[1]);$('#varR_HIANY').val(ini[0]);$('#varR_HIMERGE').val(ini[0]+'-'+ini[1]);var fin=($('#parR_HFIN').val()).split("-");$('#varR_HFDIA').val(fin[2]);$('#varR_HFMES').val(fin[1]);$('#varR_HFANY').val(fin[0]);$('#varR_HFMERGE').val(fin[0]+'-'+fin[1]);$('#varM_HZONE').val($('#parM_HZONE').val());if($('#varM_HZONE').val()=='BAR'){if($('#varM_HDSTR'))
$('#varM_HDSTR').val($('#parM_HDSTR').val());}
else{if($('#varM_HCITY'))
$('#varM_HCITY').val($('#parM_HCITY').val());}}
function changePanoramioImage(url,owner_name,owner_url,title,url_photo)
{$('.mini-big-sel').css({opacity:'1'}).removeClass('mini-big-sel');$('#image-big').hide();$('#panoramio-all-photo').show();$('#panoramio-photo-url').attr('href',url_photo);$('#panoramio-owner-url').attr('href',owner_url);$('#panoramio-owner').html(owner_name);$('#panoramio-photo').attr('src',url);$('#panoramio-title').html(title);}
function initialize_mini()
{if(AAH02_DDCLatitude&&AAH02_DDCLongitude){if(AAH02_showmap==true)
{if(GBrowserIsCompatible()&&!loadedMap)
{$(window).unload(function(){GUnload();});var icon=new GIcon();icon.image=aa_config.STATIC_URL+"/images/ico_map01.png";icon.iconSize=new GSize(30,30);icon.iconAnchor=new GPoint(15,30);map_mini_1=new GMap2(document.getElementById("map_mini_1"));var point=new GLatLng(AAH02_DDCLatitude,AAH02_DDCLongitude);map_mini_1.setCenter(point,AAH02_ZOOM);map_mini_1.addControl(new GSmallMapControl());map_mini_1.addControl(new GMapTypeControl());map_mini_1.addControl(new GScaleControl());map_mini_1.addOverlay(new GMarker(point,icon),1);resizeMap();}}}}
var loadedMap=false;function resizeMap(){if(loadedMap){if(AAH02_showmap){map.checkResize();if(!firstLoad)
{firstLoad=true;var point=new GLatLng(AAH02_DDCLatitude,AAH02_DDCLongitude);map.setCenter(point,AAH02_ZOOM);}}}}
var firstLoad=false;function initialize(){if(AAH02_DDCLatitude&&AAH02_DDCLongitude){if(GBrowserIsCompatible()&&!loadedMap){jQuery.getScript(aa_config.STATIC_URL+'/js/tLabel.js',function(){jQuery(window).unload(function(){GUnload();});loadedMap=true;map=new GMap2(document.getElementById("map_canvas_ficha"));var point=new GLatLng(AAH02_DDCLatitude,AAH02_DDCLongitude);map.setCenter(point,AAH02_ZOOM);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());addPOISToMap(map);var bounds=map.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var lngSpan=northEast.lng()-southWest.lng();var latSpan=northEast.lat()-southWest.lat();var icon2=new GIcon();var icon2_sel=new GIcon();icon2.image=aa_config.STATIC_URL+"/images/ico_map01.png";icon2_sel.image=aa_config.STATIC_URL+"/images/ico_map01.png";icon2.iconSize=new GSize(30,30);icon2_sel.iconSize=new GSize(30,30);icon2.shadowSize=new GSize(30,30);icon2_sel.shadowSize=new GSize(30,30);icon2.iconAnchor=new GPoint(15,30);icon2_sel.iconAnchor=new GPoint(15,30);icon2.infoWindowAnchor=new GPoint(15,20);icon2_sel.infoWindowAnchor=new GPoint(15,20);map.addOverlay(new GMarker(point,{icon:icon2,zIndexProcess:secondLayer}),1);});}}}
function changeTab(id){jQuery('.tab2-sel').removeClass('tab2-sel').addClass('tab2');jQuery('#'+id).addClass('tab2-sel');if(id=='howto-tab'){jQuery('#precios').hide();jQuery('#reservar').show();}else{jQuery('#reservar').hide();jQuery('#precios').show();}}
function resizeMap(){if(loadedMap){if(AAH02_showmap){map.checkResize();if(!firstLoad)
{firstLoad=true;var point=new GLatLng(AAH02_DDCLatitude,AAH02_DDCLongitude);map.setCenter(point,AAH02_ZOOM);}}}}
function secondLayer(marker,b){return 2;}
var firstLoad=false;function initialize(){if(AAH02_DDCLatitude&&AAH02_DDCLongitude){if(AAH02_showmap){if(GBrowserIsCompatible()&&!loadedMap){jQuery.getScript(aa_config.STATIC_URL+'/js/tLabel.js',function(){jQuery(window).unload(function(){GUnload();});loadedMap=true;map=new GMap2(document.getElementById("map_canvas_ficha"));var point=new GLatLng(AAH02_DDCLatitude,AAH02_DDCLongitude);map.setCenter(point,AAH02_ZOOM);map.addControl(new GLargeMapControl());map.addControl(new GMapTypeControl());map.addControl(new GScaleControl());map.addControl(new GOverviewMapControl());addPOISToMap(map);var bounds=map.getBounds();var southWest=bounds.getSouthWest();var northEast=bounds.getNorthEast();var lngSpan=northEast.lng()-southWest.lng();var latSpan=northEast.lat()-southWest.lat();var icon2=new GIcon();var icon2_sel=new GIcon();icon2.image=aa_config.STATIC_URL+"/images/ico_map01.png";icon2_sel.image=aa_config.STATIC_URL+"/images/ico_map01.png";icon2.iconSize=new GSize(30,30);icon2_sel.iconSize=new GSize(30,30);icon2.shadowSize=new GSize(30,30);icon2_sel.shadowSize=new GSize(30,30);icon2.iconAnchor=new GPoint(15,30);icon2_sel.iconAnchor=new GPoint(15,30);icon2.infoWindowAnchor=new GPoint(15,20);icon2_sel.infoWindowAnchor=new GPoint(15,20);map.addOverlay(new GMarker(point,{icon:icon2,zIndexProcess:secondLayer}),1);});}}}}
function changeTab(id){jQuery('.tab2-sel').removeClass('tab2-sel').addClass('tab2');jQuery('#'+id).addClass('tab2-sel');if(id=='howto-tab'){jQuery('#precios').hide();jQuery('#reservar').show();}else{jQuery('#reservar').hide();jQuery('#precios').show();}}
function moveACCOM(num,ref,cod_item,msg){$('#parH_REF,#bisH_REF,#varH_REF').val(ref);$('#parCOD_ITEM,#bisCOD_ITEM,#varCOD_ITEM').val(cod_item);$('#varPRODUCT_NUM').val(num)
doSubmit(msg);}
function preSearch(){$('#varMORE_RESULTS').val('');$('#parM_CITY,#parM_HCITY').val('');$('#parM_DSTR,#parM_HDSTR').val('');newSearch('PRESEARCH');}
function newSearch(message)
{setSearchCacheID();document.OH.parCTLPag.value='';document.OH.parCTLTPag.value='';document.OH.parCTLOrder.value='';document.OH.parCTLTOrder.value='';document.OH.varAL_TYPE.value=2;document.OH.parAL_TYPE.value=2;doSubmit(message);}