function setIntro(nombre, destino, time)
{
	new PeriodicalExecuter(function(fin){
				setPortada(nombre, destino);
			fin.stop();
		},time);
}

function setPortada(nombre, destino)
{
	divId = nombre; // ID of Div which will recover the result.
	url = destino; // 'HTML file to be called' ext *.php, *.inc, ...
	loader = 'cargando...'; // 'html for loading' or false
	effect = 'appear'; // 'appear' , 'blind' , 'highlight' or false
	ecache = true; //cache for html file true or false

	$ajaxload(divId, url, loader, effect, ecache);
}

function marcar_todos(campo, formulario)
{
	if($(campo).checked)
	{
		for(i=0; i < $(formulario).elements.length; i++)
		{
			if($(formulario).elements[i].type == "checkbox")
         		$(formulario).elements[i].checked=1;
		}
	}else{
		for(i=0; i < $(formulario).elements.length; i++)
		{
			if($(formulario).elements[i].type == "checkbox")
         		$(formulario).elements[i].checked=0;
		}	
	}
}

function switch_persiana(nombre)
{
	if($(nombre).style.height != '0px')
	{
		$blindup(nombre, 900);
	}else{
		$blinddown(nombre, 900);
	}
}

//Función que en el caso de existir la marquesina, la pone en funcionamiento.
function cargaMarquesina(){
	if($('iens6div'))
		start();
}

//Google maps
function pintaMapa(mapa_name, ruta_icono)
{
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById(mapa_name));
	       map.setCenter(new GLatLng(40.617422,-3.587873), 9);
	       map.addControl(new GLargeMapControl());
	       map.addControl(new GMapTypeControl());
	       
	       var point = new GPoint (-3.585373, 40.616622);
	       var miIcono = new GIcon(G_DEFAULT_ICON);
		miIcono.image = ruta_icono;
		miIcono.iconSize = new GSize(34,22);
		miIcono.shadowSize = new GSize(1, 2);
		
		var texto = '<br /><span style="color: rgb(51, 51, 51); font-family: times new roman, serif; font-size: 18px; font-weight: normal;"><img src="'+ruta_icono+'" alt="CLASSIC MOTO" />&nbsp;CLASSIC MOTO</span><br /><br /><span style="font-family: arial,sans-serif; color: #444B51;">Circuito Jarama</span><br /><span style="font-family: arial,sans-serif; color: #444B51;">30 de Abril y 1 de Mayo de 2011<br /><br />';
	       var marker = new GMarker(point, miIcono);
	       GEvent.addListener(marker, 'click', function(){marker.openInfoWindowHtml(texto);});
	       map.addOverlay(marker);
	       marker.openInfoWindowHtml(texto);
	   }
}


//Google maps
function pintaMapaHotel(mapa_name, ruta_icono)
{
	if (GBrowserIsCompatible()) {
		var map = new GMap2(document.getElementById(mapa_name));
	       map.setCenter(new GLatLng(40.396764,-3.713379),14);
	       map.addControl(new GLargeMapControl());
	       map.addControl(new GMapTypeControl());
	       
	       var point = new GPoint (-3.615119, 40.539837);
	       var miIcono = new GIcon(G_DEFAULT_ICON);
		/*miIcono.image = ruta_icono;
		miIcono.iconSize = new GSize(34,22);
		miIcono.shadowSize = new GSize(1, 2);*/
		
		var texto = '<br /><span style="color: rgb(51, 51, 51); font-family: times new roman, serif; font-size: 18px; font-weight: normal;"><img src="'+ruta_icono+'" alt="CLASSIC MOTO" />&nbsp;CLASSIC MOTO</span><br /><br /><span style="font-family: arial,sans-serif; color: #444B51;">Hotel Arturo Norte</span><br /><span style="font-family: arial,sans-serif; color: #444B51;">70 &euro; (+ IVA/TVA/VAT)<br /><br />';
	       var marker = new GMarker(point, miIcono);
	       GEvent.addListener(marker, 'click', function(){marker.openInfoWindowHtml(texto);});
	       map.addOverlay(marker);
	       marker.openInfoWindowHtml(texto);
	   }
}

