<!--Menu-->
startList = function() {
if (document.all&&document.getElementById) 
{
  navRoot = document.getElementById("nav");
  for (i=0; i<navRoot.childNodes.length; i++) 
  {
 node = navRoot.childNodes[i];
 if (node.nodeName=="LI") 
 {
   node.onmouseover=function() 
   {
  this.className+=" over";
   }
   node.onmouseout=function() {
  this.className=this.className.replace(" over", "");
   }
 }
  }
}
}

<!--ejecuto el menu-->
window.onload=startList;
//lanzo el tema navideño
function cargatema()
{
navidad = document.getElementById('eltema');
navidad.innerHTML = "<a href='#' onFocus='Javascript:cerrartema();'><img src='img/navidad2.jpg' alt='feliz navidad'  style='border:0;'/></a>";
}
function cerrartema()
{
navidad = document.getElementById('eltema');
navidad.innerHTML = "";
}
<!--AJAX-->
function nuevoAjax(){
var xmlhttp=false;
try {
xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}
}

if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
xmlhttp = new XMLHttpRequest();
}
return xmlhttp;
}

<!--Carga la pagina en el div-->
function cargarpagina(donde,pagina){
	var contenedor;
contenedor = document.getElementById(donde);
	ajax=nuevoAjax();
	ajax.open("GET", pagina,true);
	ajax.onreadystatechange=function() 
	{
if(ajax.readyState==1)
{
		contenedor.innerHTML = "Cargando datos...</b><div id='salto'></div>";
}
else if (ajax.readyState==4) 
	{
	contenedor.innerHTML = ajax.responseText
	}
	
	
	}
	ajax.send(null)


}
function buscar(donde,lista,pagina,devuelve)
{
	var t1, contenedor;
	preloader = document.getElementById('loader');
	contenedor = document.getElementById(donde);
	t1 = document.getElementById(lista).value;
	ajax=nuevoAjax();
	ajax.open("POST", pagina,true);
	ajax.onreadystatechange=function() {
		if(ajax.readyState==1)
{
		preloader.innerHTML = "Cargando datos...";
}
else if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send(""+devuelve+"="+t1)
}

function crear()
{
	//expresion regular para emails
    var er_email = /^(.+\@.+\..+)$/
	
	if(document.uno.lugar.value=='' || document.uno.lugar.value=='Escribe el lugar')
	{
		alert('El campo lugar está vacío');
		document.uno.lugar.focus();
	}	
		else if(document.uno.hsalida.value==''|| document.uno.hsalida.value=='hh:mm')
	{
		alert('Introduce la hora de salida con formato hh:mm')
		document.uno.hsalida.focus();
	}
		else if(document.uno.hllegada.value=='' || document.uno.hllegada.value=='hh:mm')
	{
		alert('Introduce la hora de llegada con formato hh:mm')
		document.uno.hllegada.focus();
	}
		else if(document.uno.L.checked==false && document.uno.M.checked==false && document.uno.X.checked==false && document.uno.J.checked ==false && document.uno.V.checked==false && document.uno.S.checked==false && document.uno.D.checked==false)
	{
		alert('Debes marcar al menos un dia de la semana');
		document.uno.L.focus();
	}
		else if(document.uno.compania.value=='' || document.uno.compania.value=='Nombre de la empresa')
	{
		alert('Introduce el nombre de la empresa que hace esa ruta')
		document.uno.compania.focus();
	}
		else if(document.uno.email.value=='' || document.uno.email.value=='Escribe tu email')
	{
		alert('Debes introducir tu email')
		document.uno.email.focus();
	}	
	   else if(!er_email.test(uno.email.value)) { 
       alert('Debes introducir un email válido.')
	   uno.email.focus();
       return (false);    //no submit
    }
	else
	{ //aqui meto o lio
	var t1,t2,t3,t4,t5,t6,t7,t8,t9,contenedor,preloader;
	preloader = document.getElementById('loader');
	contenedor = document.getElementById('contenidoa');
	t1 = document.uno.tipo.value;
	t2 = document.uno.region.value;
	t3 = document.uno.lugar.value;
	t4 = document.uno.hsalida.value;
	t5 = document.uno.hllegada.value;
	t6='';
	if(document.uno.L.checked==true)
	{
		t6='L';
	}
		if(document.uno.M.checked==true)
	{
		t6=t6+'M';
	}
	if(document.uno.X.checked==true)
	{
		t6=t6+'X';
	}
	if(document.uno.J.checked==true)
	{
		t6=t6+'J';
	}
	if(document.uno.V.checked==true)
	{
		t6=t6+'V';
	}
		if(document.uno.S.checked==true)
	{
		t6=t6+'S';
	}
		if(document.uno.D.checked==true)
	{
		t6=t6+'D';
	}
	t7 = document.uno.compania.value;
	t8 = document.uno.masinfo.value;
	if(t8=='Informacion adicional')
	{
		t8='';
	}
	t9 = document.uno.email.value;
	
	ajax=nuevoAjax();
	ajax.open("POST",'pcrearhorario.php',true);
	ajax.onreadystatechange=function() {
		if(ajax.readyState==1)
{
		preloader.innerHTML = "Cargando datos...";
}
else if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("t1="+t1+"&t2="+t2+"&t3="+t3+"&t4="+t4+"&t5="+t5+"&t6="+t6+"&t7="+t7+"&t8="+t8+"&t9="+t9)

	
	}

}


function expresatenviar()
{
	//expresion regular para emails
    var er_email = /^(.+\@.+\..+)$/
	
	if((document.uno.nombre.value=='') || (document.uno.nombre.value=='Escribe tu nombre'))
	{
		alert("El campo nombre está vacío.");
	}
	else if((document.uno.mensaje.value=='') || (document.uno.mensaje.value=='Escribe tu mensaje'))
	{
		alert("Debes escribir un mensaje.");
	}
	else 	if((document.uno.email.value=='') || (document.uno.email.value=='Escribe tu email'))
	{
		alert("El campo email está vacío.");
	}
	else if(!er_email.test(uno.email.value)) { 
       alert('Debes introducir un email válido.')
	   uno.email.focus();
       return (false);    //no submit
    }	
	else
	{
		//mando el mensaje
	var t1,t2,t3,contenedor,preloader;
	preloader = document.getElementById('loader');
	contenedor = document.getElementById('contenidoa');
	t1 = document.uno.nombre.value;
	t2 = document.uno.mensaje.value;
	t3 = document.uno.email.value;
	ajax=nuevoAjax();
	ajax.open("POST",'pexpresate.php',true);
	ajax.onreadystatechange=function() {
		if(ajax.readyState==1)
{
		preloader.innerHTML = "Cargando datos...";
}
else if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("t1="+t1+"&t2="+t2+"&t3="+t3)
	}
	
}

function expresatelistar(donde,pagina){
var id,total,voy,cual,contenedor,preloader,contenedor2;
	preloader = document.getElementById('loader');
    contenedor = document.getElementById(donde);
	ajax=nuevoAjax();
	ajax.open("GET",pagina,true);
	ajax.onreadystatechange=function() {
		if(ajax.readyState==1)
{
		preloader.innerHTML = "Cargando datos...";
}
else if (ajax.readyState==4) {
		contenedor.innerHTML = ajax.responseText;

	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("total="+total+"&voy="+voy+"&id="+id+"&cual="+cual)
}

function encuestaenviar(cual)
{
	var respuestas,contenedor,preloader;
	preloader = document.getElementById('loader');
    contenedor = document.getElementById('contenidoa');
	ajax=nuevoAjax();
	ajax.open("POST",'pencuesta.php',true);
	ajax.onreadystatechange=function() {
		if(ajax.readyState==1)
{
		preloader.innerHTML = "Cargando datos...";
}
else if (ajax.readyState==4) {
		contenedor.innerHTML = ajax.responseText;

	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send("respuesta="+cual)
}

function companiasenviar(paginac)
{
	//expresion regular para emails
    var er_email = /^(.+\@.+\..+)$/
	
	if((document.uno.nombre.value=='') || (document.uno.nombre.value=='Escribe el asunto'))
	{
		alert("El campo asunto está vacío.");
	}
	else if((document.uno.mensaje.value=='') || (document.uno.mensaje.value=='Escribe el mensaje'))
	{
		alert("Debes escribir un mensaje.");
	}
	else 	if((document.uno.email.value=='') || (document.uno.email.value=='Escribe tu email'))
	{
		alert("El campo email está vacío.");
	}
	else if(!er_email.test(uno.email.value)) { 
       alert('Debes introducir un email válido.')
	   uno.email.focus();
       return (false);    //no submit
    }	
	else
	{
		//mando el mensaje
	var t1,t2,t3,voy,total,id,contenedor,preloader;
	preloader = document.getElementById('loader');
	contenedor = document.getElementById('contenidoa');
	t1 = document.uno.nombre.value;
	t2 = document.uno.mensaje.value;
	while (t2.indexOf("\n") != -1){ 
	t2=t2.replace('\n','_')
	}
	t3 = document.uno.email.value;
	voy= document.uno.voy.value;
	total=document.uno.total.value;
	id=document.uno.id.value;
	ajax=nuevoAjax();
	ajax.open('GET',paginac+'?total='+total+'&voy='+voy+'&id='+id+'&t1='+t1+'&t2='+t2+'&t3='+t3,true);
	ajax.onreadystatechange=function() {
		if(ajax.readyState==1)
{
		preloader.innerHTML = "Enviando email...";
}
else if (ajax.readyState==4) {
			contenedor.innerHTML = ajax.responseText
	 	}
	}
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	ajax.send(null)
	}
	
}

function cargamapa(nombre,estrellas,d1,d2,x,y)
{
   if (GBrowserIsCompatible()) 
   {
	var map = new GMap2(document.getElementById("map"));

	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(42.23194923641754, -8.713874816894531), 14);

	GEvent.addListener(map, "click", function(marker, point) 
		{
		});
var icon2 = new GIcon();
icon2.image = "img/pesta.gif";
icon2.iconSize = new GSize(50, 33);
icon2.iconAnchor = new GPoint(6, 20);
icon2.infoWindowAnchor = new GPoint(1, 1);
// Creates a marker at the given point with the given number label
var point = new GLatLng(42.224195463857555, -8.709583282470703);
map.addOverlay(new GMarker(point, icon2));
if(nombre!='1')
{
// Create our "tiny" marker icon
var icon = new GIcon();
icon.image = "img/indicat.gif";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(15, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

// Creates a marker at the given point with the given number label
function createMarker(point, texto)
{
  var marker = new GMarker(point,icon);

  GEvent.addListener(marker, "click", function()
	{
    marker.openInfoWindowHtml(texto);
  	}); 
  return marker;
} 

//var point = new GLatLng(42.23194923600000,-8.713874816894531);
 // map.addOverlay(createMarker(point,'Ciudad de vigo'));
   var point = new GLatLng(x,y);
  map.addOverlay(createMarker(point,'<b>'+nombre+' '+estrellas+'</b><br>'+d1+'<br>'+d2+' VIGO')); 
}
}
}

function cargamapatodos()
{
   if (GBrowserIsCompatible()) 
   {
	var map = new GMap2(document.getElementById("map"));

	map.addControl(new GSmallMapControl());
	map.addControl(new GMapTypeControl());
	map.setCenter(new GLatLng(42.23194923641754, -8.713874816894531), 14);

	GEvent.addListener(map, "click", function(marker, point) 
		{
		});
	
// Create our "tiny" marker icon
var icon = new GIcon();
icon.image = "img/indicat.gif";
icon.shadow = "http://labs.google.com/ridefinder/images/mm_20_shadow.png";
icon.iconSize = new GSize(15, 20);
icon.shadowSize = new GSize(22, 20);
icon.iconAnchor = new GPoint(6, 20);
icon.infoWindowAnchor = new GPoint(5, 1);

var icon2 = new GIcon();
icon2.image = "img/pesta.gif";
icon2.iconSize = new GSize(50, 33);
icon2.iconAnchor = new GPoint(6, 20);
icon2.infoWindowAnchor = new GPoint(1, 1);
// Creates a marker at the given point with the given number label
var point = new GLatLng(42.224195463857555, -8.709583282470703);
map.addOverlay(new GMarker(point, icon2));

// Creates a marker at the given point with the given number label
function createMarker(point, nombre)
{
  var marker = new GMarker(point,icon);
  GEvent.addListener(marker,"click", function()
	{
    marker.openInfoWindowHtml(nombre);
  	});
  return marker;
} 

//var point = new GLatLng(42.23194923600000,-8.713874816894531);
 // map.addOverlay(createMarker(point,'Ciudad de vigo'));
   var point = new GLatLng(42.228008913641844, -8.717222213745117);
  map.addOverlay(createMarker(point,'<b>Hotel Tryp Los Galeones ****</b><br>Avenida de Madrid 21<br>36204 VIGO'));
    var point = new GLatLng(42.23662010687543, -8.715291023254395);
  map.addOverlay(createMarker(point,'<b>Hostal Canaima **</b><br>Calle García Barbón, 42 <br>36201  VIGO')); 
       var point = new GLatLng(42.237477984279785, -8.718531131744385);
  map.addOverlay(createMarker(point,'<b>Hotel NH Palacio de Vigo ****</b><br>Calle García Barbón, 17-19 <br>36201 VIGO'));
         var point = new GLatLng(42.2372396861706, -8.71741533279419);
  map.addOverlay(createMarker(point,'<b>Hostal Atlántico **</b><br>Calle García Barbón, 35 <br>36201 VIGO'));
  
  var point = new GLatLng(42.24025011949149, -8.720955848693848);
  map.addOverlay(createMarker(point,'<b>Hotel Ciudad de Vigo ****</b><br>Calle Concepción Arenal, 5 <br>36201 VIGO'));

     var point = new GLatLng(42.23117072439979, -8.717973232269287);
  map.addOverlay(createMarker(point,'<b>Hostal Gran vía **</b><br>Calle Gran Vía, 41<br> 36204 VIGO'));
    var point = new GLatLng(42.234276771199326, -8.716224431991577);
  map.addOverlay(createMarker(point,'<b>Hotel Zenit Lisboa ***</b><br>Gran Vía, 1 <br>36204 VIGO'));
  
  var point = new GLatLng(42.234476771199326, -8.716000431991577);
  map.addOverlay(createMarker(point,'<b>Hostal Noso Lar **</b><br>Urzáiz, 53 <br>36201 VIGO'));
 
}
}

function vaciacaja(laid,eltexto)
{
	var campo;
	campo = document.getElementById(laid);
	if(campo.value==eltexto)
	{
		campo.value="";
	}
}