// JavaScript Document


function isEmpty(s)
{ return ((s == null) || (s.length == 0)); }
function isSpace(c)
{ return ((c == "\n") || (c == " ") || (c == "\b") || (c == "\t")); }
function isWhiteSpace(s)
{ for(i=0; i<s.length; i++)
  if(!isSpace(s.charAt(i))) return false;
  return true;
}
function warning(f,s)
{ f.focus();
  f.select();
  alert(s);
  return false;
}
function isEmail(email)
{
  if(isEmpty(email)) return false;
  if(isWhiteSpace(email)) return false;
  invalidChars = " /:,;";
  for(i=0; i<invalidChars.length; i++)
  {
    badChar = invalidChars.charAt(i);
    if(email.indexOf(badChar,0) > -1) return false; 
  }
  atPos = email.indexOf("@",1);
  if(atPos == -1) return false; 
  if(email.indexOf("@",atPos+1) > -1) return false; 
  periodPos = email.indexOf(".",atPos);
  if(periodPos == -1) return false; 
  if(periodPos+3 > email.length) return false; 
 return true;
}



function MM_jumpMenu(targ,selObj,restore)
{ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
function booknow()
{ //v3.0
 var targ = "parent"; var selObj= document.getElementById("parthot"); var restore = 0;
 if(selObj.options[selObj.selectedIndex].value!=0)
 {
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
 }
 else
 {
	 alert("Olvidaste elegir hotel !");
 }
}
function borrar()
{
	document.getElementById("name").value="";
}

function load()
{ 
     var e = document.getElementById("name"); 
	 listen("click", e, borrar);
} 

function listen(evnt, elem, func) {
    if (elem.addEventListener)  // W3C DOM
        elem.addEventListener(evnt,func,false);
    else if (elem.attachEvent) { // IE DOM
         var r = elem.attachEvent("on"+evnt, func);
	return r;
    }
    else window.alert('I\'m sorry Dave, I\'m afraid I can\'t do that.');
}

<!--window.onload = function(){load();}-->
     soundManager.url = 'swf/soundmanager2.swf'; // path to movie
	 soundManager.debugMode = false;
	 soundManager.useConsole = false;

  soundManager.onload = function()
  {
    // soundManager.createSound() etc. may now be called
     soundManager.createSound('vegas','mp3/04-AudioTrack 04.mp3');
     soundManager.createSound('vegas1','mp3/jarre.mp3');
     soundManager.createSound('vegas2','mp3/destination.mp3');
     soundManager.createSound('vegas3','mp3/conversation.mp3');
     soundManager.createSound('vegas4','mp3/dj-tiesto-contact.mp3');
     soundManager.createSound('vegas5','mp3/dj.mp3');	 
    //soundManager._writeDebug('soundManager.onload() - your code executes here');
	soundManager.play('vegas');
  }
  
  function pausar()
  {
    soundManager.setVolume('vegas',0);
  }
  
  function reproducir()
  {
     soundManager.play('vegas');
  }

  function switchplay()
  {
      document.getElementById("play").src = "images/playover.gif";
  }
  
  function returnplay()
  {
      document.getElementById("play").src = "images/play.gif";
  }
  
  function switchpause()
  {
      document.getElementById("pause").src = "images/pauseover.gif";
  }
  
  function returnpause()
  {
      document.getElementById("pause").src = "images/pause.gif";
  }
    function isNonSelected(div)
  {
		var object = document.getElementsByName(div);
		var uno = object[0].checked;
		var otro = object[1].checked;
		if(uno==false && otro==false)
		{
			return true;
		}
		else
		{
				if(uno)
		        {
					return false;
			    }
				else
			    {
					return false;
			    }  
		}
}
  function warning3(div)
  { 
  document.getElementById(div).focus();
  document.getElementById(div).style.borderColor="#FF0000";
   return false;
   }
  function isSelected(a)
  {
	if(a==0)
	{
	return true;
	}
	else
	{
	return false;
	}
  }
  function listar_antros()
  {
	  var antros = "";
	  for (i=0; i<document.sender.antro.length; i++)
	  {
		if(document.sender.antro[i].checked==true)
		{
		   antros += document.sender.antro[i].value+",";
		}
	  }
	  return antros;
  }
  function listar_otroshoteles()
  {
	  var hoteles = "";
	  for (i=0; i<document.form_caesars.otroshoteles.length; i++)
	  {
		if(document.form_caesars.otroshoteles[i].checked==true)
		{
		   hoteles += document.form_caesars.otroshoteles[i].value+",";
		}
	  }
	  return hoteles;
  }
  function listar_otrascosas()
  {
	  var cosas = "";
	  for (i=0; i<document.form_caesars.otrascosas.length; i++)
	  {
		if(document.form_caesars.otrascosas[i].checked==true)
		{
		   cosas += document.form_caesars.otrascosas[i].value+",";
		}
	  }
	  return cosas;
  }
          function enviar_lg()
          { 
		    var nombre = document.getElementById("nombre");
			var apellido = document.getElementById("apellido");
			var sexo = document.getElementById("sexo_0");
		    var correo = document.getElementById("correo");
		    var comentarios = document.getElementById("comentarios");
			var telefono = document.getElementById("telefono");
			var direccion1 = document.getElementById("direccion1");
			var pais = document.getElementById("pais");
			var estado = document.getElementById("estado");
			var ciudad = document.getElementById("ciudad");
			var nopersonas = document.getElementById("nopersonas");
			var fecha = document.getElementById("fecha");
			var hora = document.getElementById("hora");			
			document.getElementById("antrosS").value = listar_antros();
			var cuartos = document.getElementById("cuartos_0");

	
	 		if(isEmpty(nombre.value)) return (warning(nombre,"TU NOMBRE"));
			if(isEmpty(apellido.value)) return (warning(apellido,"TU APELLIDO"));
			if(isNonSelected('sexo')) return (warning(sexo,"Tu sexo"));
			if(!isEmail(correo.value))return (warning(correo,"Correo invalido o vacio"));
			if(isEmpty(telefono.value)) return (warning(telefono,"TU TELEFONO"));
			if(isEmpty(direccion1.value)) return (warning(direccion1,"TU DIRECCION"));
		    if(isSelected(pais.selectedIndex))return (warning3('pais'));
			if(isSelected(estado.selectedIndex))return (warning3('estado'));
			if(isEmpty(ciudad.value)) return (warning(ciudad,"TU CIUDAD"));
			if(isEmpty(nopersonas.value)) return (warning(nopersonas,"# DE PERSONAS PARA EL PARTY?"));
			if(isEmpty(fecha.value)) return (warning(fecha,"Fecha del evento"));
			if(isEmpty(hora.value)) return (warning(hora,"Hora del evento"));
			if(isEmpty(comentarios.value))return (warning(comentarios,"Olvidaste escribir tu comentario"));
			
			return doIt_lg()
        
        }

          function enviar()
          { 
		    var nombre = document.getElementById("nombre");
			var apellido = document.getElementById("apellido");
			var sexo = document.getElementById("sexo_0");
		    var correo = document.getElementById("correo");
		    var comentarios = document.getElementById("comentarios");
			var telefono = document.getElementById("telefono");
			var direccion1 = document.getElementById("direccion1");
			var direccion2 = document.getElementById("direccion2");
			var pais = document.getElementById("pais");
			var estado = document.getElementById("estado");
			var ciudad = document.getElementById("ciudad");
			var cpostal = document.getElementById("cpostal");
			var comoconociste = document.getElementById("comoconociste");
			var nopersonas = document.getElementById("nopersonas");
			var edad = document.getElementById("edadavg");
			var fecha = document.getElementById("fecha");
			var hora = document.getElementById("hora");			
			document.getElementById("antrosS").value = listar_antros();
			var cuartos = document.getElementById("cuartos_0");
			var restaurantes = document.getElementById("restaurantes_0");
			var via = document.getElementById("modocontacto");
			var horario = document.getElementById("horariocontacto");
	
	 		if(isEmpty(nombre.value)) return (warning(nombre,"TU NOMBRE"));
			if(isEmpty(apellido.value)) return (warning(apellido,"TU APELLIDO"));
			if(isNonSelected('sexo')) return (warning(sexo,"Tu sexo"));
			if(!isEmail(correo.value))return (warning(correo,"Correo inv�lido o vac�o"));
			if(isEmpty(telefono.value)) return (warning(telefono,"TU TELEFONO"));
			if(isEmpty(direccion1.value)) return (warning(direccion1,"TU DIRECCION"));
		    if(isSelected(pais.selectedIndex))return (warning3('pais'));
			if(isSelected(estado.selectedIndex))return (warning3('estado'));
			if(isEmpty(ciudad.value)) return (warning(ciudad,"TU CIUDAD"));
			if(isEmpty(cpostal.value)) return (warning(cpostal,"TU CODIGO POSTAL"));
			if(isEmpty(comoconociste.value)) return (warning(comoconociste,"COMO NOS CONOCISTE?"));
			if(isEmpty(nopersonas.value)) return (warning(nopersonas,"# DE PERSONAS PARA EL PARTY?"));
			if(isEmpty(edad.value)) return (warning(edad,"TU EDAD"));
			if(isEmpty(fecha.value)) return (warning(fecha,"Fecha del evento"));
			if(isEmpty(hora.value)) return (warning(hora,"Hora del evento"));
			if(isNonSelected('cuartos')) return (warning(cuartos,"Deseas saber de Cuartos?"));
			if(isNonSelected('restaurantes')) return (warning(restaurantes,"Deseas saber de Restaurantes?"));
			if(isSelected(via.selectedIndex))return (warning3('modocontacto'));
			if(isSelected(horario.selectedIndex))return (warning3('horariocontacto'));
			if(isEmpty(comentarios.value))return (warning(comentarios,"Olvidaste escribir tu comentario"));
			
			return doIt()
        
        }

          function enviar_caesars()
          { 
		    var nombre = document.getElementById("nombre");
			var apellido = document.getElementById("apellido");
			var fecha = document.getElementById("fecha");
			var correo = document.getElementById("correo");
			var fecha2 = document.getElementById("fecha2");
			document.getElementById("otros").value = listar_otroshoteles();			
			document.getElementById("otras").value = listar_otrascosas();						
			var comentarios = document.getElementById("comentarios");
	

			if(isEmpty(nombre.value)) return (warning(nombre,"TU NOMBRE"));
			if(isEmpty(apellido.value)) return (warning(apellido,"TU APELLIDO"));
			if(isEmpty(fecha.value)) return (warning(fecha,"Fecha de Nacimiento"));
			if(!isEmail(correo.value))return (warning(correo,"Correo invalido o vacio"));
			if(isEmpty(fecha2.value)) return (warning(fecha2,"Fecha de llegada a Las Vegas"));
			if(isEmpty(comentarios.value))return (warning(comentarios,"Olvidaste escribir tu comentario"));
			
			return doIt_caesars()
        
        }
function enviar_mix()
          { 
		    var nombre = document.getElementById("nombre");
			var apellido = document.getElementById("apellido");
		    var correo = document.getElementById("correo");
		    var comentarios = document.getElementById("comentarios");
			var telefono = document.getElementById("telefono");
			var direccion = document.getElementById("direccion");
			var pais = document.getElementById("pais");
			var estado = document.getElementById("estado");
			var ciudad = document.getElementById("ciudad");
			var cpostal = document.getElementById("cpostal");
			var nopersonas = document.getElementById("nopersonas");
			var fecha = document.getElementById("fecha");
			var hora = document.getElementById("hora");			

			if(isEmpty(nombre.value)) return (warning(nombre,"TU NOMBRE"));
			if(isEmpty(apellido.value)) return (warning(apellido,"TU APELLIDO"));
			if(!isEmail(correo.value))return (warning(correo,"Correo inv�lido o vac�o"));
			if(isEmpty(telefono.value)) return (warning(telefono,"TU TELEFONO"));
			if(isEmpty(direccion.value)) return (warning(direccion,"TU DIRECCION"));
		    if(isSelected(pais.selectedIndex))return (warning3('pais'));
			if(isSelected(estado.selectedIndex))return (warning3('estado'));
			if(isEmpty(ciudad.value)) return (warning(ciudad,"TU CIUDAD"));
			if(isEmpty(cpostal.value)) return (warning(cpostal,"TU CODIGO POSTAL"));
			if(isEmpty(nopersonas.value)) return (warning(nopersonas,"# DE PERSONAS PARA EL PARTY?"));
			if(isEmpty(fecha.value)) return (warning(fecha,"Fecha del evento"));
			if(isEmpty(hora.value)) return (warning(hora,"Hora del evento"));
			if(isEmpty(comentarios.value))return (warning(comentarios,"Olvidaste escribir tu comentario"));
			
			return doIt_mix()
        
        }

       function enviar2()
          { 
		    var nombre = document.getElementById("nombre");
			var apellido = document.getElementById("apellido");
		    var correo = document.getElementById("correo");
			var telefono = document.getElementById("telefono");
			var direccion1 = document.getElementById("direccion1");
			var pais = document.getElementById("pais");
			var estado = document.getElementById("estado");
			var ciudad = document.getElementById("ciudad");
			var cpostal = document.getElementById("cpostal");
			var nopersonas = document.getElementById("nopersonas");			
			document.getElementById("antrosS").value = listar_antros();			
	
	 		if(isEmpty(nombre.value)) return (warning(nombre,"TU NOMBRE"));
	 		if(isEmpty(apellido.value)) return (warning(nombre,"TU APELLIDO"));			
			if(!isEmail(correo.value))return (warning(correo,"Correo inv�lido o vac�o"));
			if(isEmpty(telefono.value)) return (warning(telefono,"TU TELEFONO"));
			if(isEmpty(direccion1.value)) return (warning(direccion1,"TU DIRECCION"));
		    if(isSelected(pais.selectedIndex))return (warning3('pais'));
			if(isSelected(estado.selectedIndex))return (warning3('estado'));
			if(isEmpty(ciudad.value)) return (warning(ciudad,"TU CIUDAD"));
			if(isEmpty(cpostal.value)) return (warning(cpostal,"TU CODIGO POSTAL"));
			if(isEmpty(nopersonas.value)) return (warning(nopersonas,"No. Personas"));			
			
			return doIt2()
        
        }		

		function doIt2()
		{
            $('sender').send()
			$('sender').reset();
			alert("Gracias, hemos recibido tus datos,\n pronto estaremos en contacto contigo!");
		}
		function doIt_mix()
		{
            $('form-mix').submit()
			$('form-mix').reset();
		}	
		function sign_up()
		{
            $('form-sign-up').submit()
			$('form-sign-up').reset();
		}			

		function doIt_caesars()
		{
            $('form_caesars').submit()
			$('form_caesars').reset();
		}		
				
		function doIt()
		{
            $('sender').send()
			$('sender').reset();
			alert("Gracias, hemos recibido tus datos,\n pronto estaremos en contacto contigo!");
	
		}
		function doIt_lg()
		{
            $('sender').send()
			$('sender').reset();
			alert("Gracias, hemos recibido tus datos,\n pronto estaremos en contacto contigo!");
	
		}		
		
		
        function switchalo()
        {
            document.getElementById("disco").src = "images/sendover.jpg";
        }
        function turnback()
        {
            document.getElementById("disco").src = "images/send.jpg";
        }

		
		window.onload=function()
		{
			var Tips1 = new Tips($$('.Tips1'));
			//cathouse();
			startGallery();
			if(document.getElementById('hora')){var tp = new TimePicker('time1_picker', 'hora', 'hora',{imagesPath:"images/timepicker"});}		
		}

function startGallery()
{
var myGallery = new gallery($('myGallery'), {
timed: true,
showArrows: false,
showCarousel: false
});
}

          function enviar_lam()
          { 
		    var nombre = document.getElementById("nombre");
		    var correo = document.getElementById("correo");
			var telefono = document.getElementById("telefono");
			var direccion = document.getElementById("direccion");
			var pais = document.getElementById("pais");
			var estado = document.getElementById("estado");
			var ciudad = document.getElementById("ciudad");
			var cpostal = document.getElementById("cpostal");
			var comoconociste = document.getElementById("comoconociste");
			var nopersonas = document.getElementById("nopersonas");
			var edad = document.getElementById("edadavg");
			var fecha = document.getElementById("fecha");
			var hora = document.getElementById("hora");			
			document.getElementById("antrosS").value = listar_antros();
			var cuartos = document.getElementById("cuartos_0");
			var restaurantes = document.getElementById("restaurantes_0");
			var via = document.getElementById("modocontacto");
			var horario = document.getElementById("horariocontacto");
	
	 		if(isEmpty(nombre.value)) return (warning(nombre,"TU NOMBRE"));
			if(isEmpty(apellido.value)) return (warning(apellido,"TU APELLIDO"));
			if(isNonSelected('sexo')) return (warning(sexo,"Tu sexo"));
			if(!isEmail(correo.value))return (warning(correo,"Correo inv�lido o vac�o"));
			if(isEmpty(telefono.value)) return (warning(telefono,"TU TELEFONO"));
			if(isEmpty(direccion1.value)) return (warning(direccion1,"TU DIRECCION"));
		    if(isSelected(pais.selectedIndex))return (warning3('pais'));
			if(isSelected(estado.selectedIndex))return (warning3('estado'));
			if(isEmpty(ciudad.value)) return (warning(ciudad,"TU CIUDAD"));
			if(isEmpty(cpostal.value)) return (warning(cpostal,"TU CODIGO POSTAL"));
			if(isEmpty(comoconociste.value)) return (warning(comoconociste,"COMO NOS CONOCISTE?"));
			if(isEmpty(nopersonas.value)) return (warning(nopersonas,"# DE PERSONAS PARA EL PARTY?"));
			if(isEmpty(edad.value)) return (warning(edad,"TU EDAD"));
			if(isEmpty(fecha.value)) return (warning(fecha,"Fecha del evento"));
			if(isEmpty(hora.value)) return (warning(hora,"Hora del evento"));
			if(isNonSelected('cuartos')) return (warning(cuartos,"Deseas saber de Cuartos?"));
			if(isNonSelected('restaurantes')) return (warning(restaurantes,"Deseas saber de Restaurantes?"));
			if(isSelected(via.selectedIndex))return (warning3('modocontacto'));
			if(isSelected(horario.selectedIndex))return (warning3('horariocontacto'));
			if(isEmpty(comentarios.value))return (warning(comentarios,"Olvidaste escribir tu comentario"));
			
			return doIt()
        
        }
		function show_cena(a)
		{	
			if(a==1)
			{
				document.getElementById("cena2").style.display="none";								
				document.getElementById("cena1").style.display="block";
			}
			if(a==2)
			{
				document.getElementById("cena1").style.display="none";								
				document.getElementById("cena2").style.display="block";
			}
			
		}

		function validar_forma_booking()
		{ 
			var checkin = document.getElementById("checkin");
			var checkout = document.getElementById("checkout");
		
			if(isEmpty(checkin.value)) return (warning(nombre,"Ingresa Fecha de Llegada"));
			if(isEmpty(checkout.value)) return (warning(apellido,"Ingresa Fecha de Salida"));
			return true;
		}
		
		function cathouse()
		{
			window.open ("cathouse.html","Cathouse","menubar=0,resizable=0,width=300,height=416"); 			
		}