// JavaScript Document
jQuery.noConflict()(function(){



		//gallery y tabs
		 jQuery(function() {
		jQuery('.gallery-icon a').lightBox();
		jQuery("#usual1 ul").idTabs();
	});
	//current state
	jQuery("#guate.nav a").each(function() {
		if(this.href == window.location.href.split("#")[0]) {
			jQuery(this).addClass("current");
		}
     });
	//acordeon
	jQuery(".acordeonh:first").addClass("activo");
	jQuery(".acontenedor:not(:first)").hide();

	jQuery(".acordeonh").click(function(){
		jQuery(this).next(".acontenedor").slideToggle(600)
		.siblings(".acontenedor:visible").slideUp(600);
		jQuery(this).toggleClass("activo");
		jQuery(this).siblings(".acordeonh").removeClass("activo");
	});

	//Calendario UI	
	jQuery('#date_in').click(
      function () {
        jQuery(this).datepicker( "show" )
      }, 
      function () {
        
      }
    );
	jQuery('#date_in').datepicker({
	    minDate: 0,
		prevText: '&#x3c;',
		nextText: '&#x3e;',
		currentText: 'Hoy',
		yearRange: '2008:2016',
		dayNames: ['Domingo', 'Lunes', 'Martes', 'Miercoles', 'Jueves', 'Viernes', 'Sabado'],
		dayNamesShort: ['Dom', 'Lun', 'Mar', 'Mir', 'Jue', 'Vie', 'Sab'],
		dayNamesMin: ['Do','Lu','Ma','Mi','Ju','Vi','Sa'],
		monthNames: ['Enero','Febrero','Marzo','Abril','Mayo','Junio','Julio','Agosto','Septiembre', 'Octubre','Noviembre','Diciembre'],
		monthNamesShort: ['Ene','Feb','Mar','Abr','May', 'Jun','Jul','Ago','Sep','Oct','Nov','Dic']
 	});
	jQuery(" .nav li ul ").css({display: "none"}); // Opera Fix
jQuery(" .nav li").hover(function(){
		jQuery(this).find('ul:first').css({visibility: "visible",display: "none"}).fadeIn(300);
		},function(){
		jQuery(this).find('ul:first').fadeOut('slow').css({visibility: "hidden"});
});

//slider
	jQuery(function() {
	jQuery('#rotate').before('<div id="navslide">').cycle({ 
      fx:     'fade', 
      speed:  '800', 
      timeout: 8000,
      pager:  '#navslide' 
	});}); 
});
	


function formcheck(){
	var night = document.getElementById('night').value;
	var adults = document.getElementById('adults').value;
	var children = document.getElementById('children').value;
	var pais = document.getElementById('pais').value;
	if (night>0 && adults>0 && pais!='null' && pais!= 'https://reservations.ihotelier.com/onescreen.cfm'){
		window.location = pais;
	} else if(pais == 'https://reservations.ihotelier.com/onescreen.cfm'){
		document.getElementById('Form_Envio_Pais').submit();
	}else{
		alert('Parece que dejo campos en blanco, Porfavor llene los campos');	
	}
}
