//MENUS//
//CON JQUERY
jQuery.noConflict();

jQuery(document).ready(function(){
	jQuery('#menu li.animate_back a').mouseover(function(){
		jQuery(this).animate({opacity:0},'fast');
	});
	jQuery('#menu li.animate_back a').mouseout(function(){
		jQuery(this).animate({opacity:1},'normal');
	});
});


jQuery(document).ready(function(){
	jQuery('a.boton_volver').click(function(){
		history.back();
		return false;
	});
});
function hoverOn(eventObject){
	var objectChild = jQuery(eventObject).children('span.cajon_foto_contenedor').children('img.cajon_fotocolor');
	jQuery(objectChild).fadeOut("fast");
}
function hoverOff(eventObject){
	var objectChild = jQuery(eventObject).children('span.cajon_foto_contenedor').children('img.cajon_fotocolor');
	jQuery(objectChild).fadeIn("fast"); 
}
jQuery(document).ready(function(){													
	jQuery('a.cajon .cajon_fotocolor').each(function(){
		var rel = jQuery(this).attr("rel");
		var src = jQuery(this).attr("src");
		var width = jQuery(this).width();
		var height = jQuery(this).height();
		jQuery(this).attr("rel",src).attr("src",rel);
		jQuery(this).wrap('<span class="cajon_foto_contenedor"></span>').parent().css("background-image","url("+src+")");												 
	});	
	jQuery('a.cajon .cajon_foto_contenedor:has(.cajon_fotocolor_grande)').addClass("cajon_foto_contenedor_grande");
	jQuery('a.cajon .cajon_foto_contenedor:has(.cajon_fotocolor_mini)').addClass("cajon_foto_contenedor_mini");
	jQuery('a.cajon .cajon_foto_contenedor:has(.cajon_fotocolor_lateral)').addClass("cajon_foto_contenedor_lateral");
	jQuery('a.cajon .cajon_foto_contenedor:has(.cajon_fotocolor_largo)').addClass("cajon_foto_contenedor_largo");
	//jQuery('ul#menu_lateral li a').addClass('script');
});
jQuery(document).ready(function(){
	jQuery('a.cajon').hover(function(){hoverOn(this)},function(){hoverOff(this)});		
});
//Sistema de reservas
jQuery(document).ready(function(){
	if(!jQuery('#formulario_header').length){
		start();
		jQuery("#HotelList").change(function () {hhotelFormUpdateHotelnames(jQuery("#idForm"));});
		jQuery("#Hotelfromyear").change(function () {update_departure();});
		jQuery("#HotelReservar").click(function () {hhotelDispoprice(this.form);return false;});
		//jQuery("#idForm").submit(function () {hhotelDispoprice(this);return false;});
		jQuery("#HotelOpciones").click(function () {hhotelSearchGroup('crsesibersolhtls', '', '', '', '');return false;});
	}
	else{
		jQuery.ajax({
			url: "/includes/form_header_"+ll+".php",
			success: function(data){
				jQuery('#formulario_header').html(data);
				start();
				jQuery("#HotelList").change(function () {hhotelFormUpdateHotelnames(jQuery("#idForm"));});
				jQuery("#Hotelfromyear").change(function () {update_departure();});
				jQuery("#HotelReservar").click(function () {hhotelDispoprice(this.form);return false;});
				//jQuery("#idForm").submit(function () {hhotelDispoprice(this);return false;});
				jQuery("#HotelOpciones").click(function () {hhotelSearchGroup('crsesibersolhtls', '', '', '', '');return false;});
			}
		});
	}

	/*//jQuery('#formulario_header').load('includes/form_header_es.php').append('<script src="/Scripts/fbtrack.js"></script><script type="text/javascript" src="/Scripts/fblibcouk.js"></script>');*/
});
jQuery(document).ready(function(){
	jQuery("a[rel^='prettyPhoto']").prettyPhoto({
		animationSpeed: 'normal', /* fast/slow/normal */
		showTitle: false, /* true/false */
		allowresize: true, /* true/false */
		counter_separator_label: ' / ', /* The separator for the gallery counter 1 "of" 2 */
		theme: 'light_rounded' /* light_rounded / dark_rounded / light_square / dark_square */
	});
});
jQuery(document).ready(function(){
	jQuery("span.imprimir").css('cursor','pointer').click(function(){print();});
	jQuery("a.volver").click(function(){history.back();return false;});
});							