// JavaScript Document
var estado;
function mostrar(e,o){	
	if (estado!=1){
	document.getElementById(e).className='mostrar';
	document.getElementById(o).src='img/ico-menos.gif';
	document.getElementById(o).alt='Hide Info';
	estado=1;
	}
	else if(estado==1)
	{
	document.getElementById(e).className='ocultar';
	document.getElementById(o).src='img/ico-mas.gif';
	document.getElementById(o).alt='Show more Info';
	estado=0;
		}
	}
	
	
function invertirFecha(fecha) {

	dia=fecha.split("/")[0];
	mes=fecha.split("/")[1];
	ano=fecha.split("/")[2];
	if (mes==null) return 0;
	else  return mes+"/"+dia+"/"+ano;
	
	
}		
function reservas(fentrada,fsalida) {
	url="https://booking.ihotelier.com/istay/istay.jsp?hotelid=14448&locale=EN&languageid=1&adults=2";
	//url="https://reservations.ihotelier.com/iStay.cfm?hotelid=14448&adults=2&languageid=1";
	if (invertirFecha(fentrada)!=0) url+="&DateIn="+invertirFecha(fentrada);
	if (invertirFecha(fsalida)!=0) url+="&DateOut="+invertirFecha(fsalida);
	window.open(url, '','width=1024, height=720, top=0, left=0, resizable=yes,scrollbars=yes');
  //window.open(url, '','width=1024, height=610, top=0, left=0, resizable=yes,scrollbars=yes');
	
 
}
// cebrado de las tablas
 // this function is needed to work around 
  // a bug in IE related to element attributes
  function hasClass(obj) {
     var result = false;
     if (obj.getAttributeNode("class") != null) {
         result = obj.getAttributeNode("class").value;
     }
     return result;
  }   

 function stripe(id) {

    // the flag we'll use to keep track of 
    // whether the current row is odd or even
    var even = false;
  
    // if arguments are provided to specify the colours
    // of the even & odd rows, then use the them;
    // otherwise use the following defaults:
    var evenColor = arguments[1] ? arguments[1] : "#d9d9d9";
    var oddColor = arguments[2] ? arguments[2] : "#fff";
  
    // obtain a reference to the desired table
    // if no such table exists, abort
    var table = document.getElementById(id);
    if (! table) { return; }
    
    // by definition, tables can have more than one tbody
    // element, so we'll have to get the list of child
    // &lt;tbody&gt;s 
    var tbodies = table.getElementsByTagName("tbody");

    // and iterate through them...
    for (var h = 0; h < tbodies.length; h++) {
    
     // find all the &lt;tr&gt; elements... 
      var trs = tbodies[h].getElementsByTagName("tr");
      
      // ... and iterate through them
      for (var i = 0; i < trs.length; i++) {

        // avoid rows that have a class attribute
        // or backgroundColor style
        if (! hasClass(trs[i]) &&
            ! trs[i].style.backgroundColor) {
 		  
          // get all the cells in this row...
          var tds = trs[i].getElementsByTagName("td");
        
          // and iterate through them...
          for (var j = 0; j < tds.length; j++) {
        
            var mytd = tds[j];

            // avoid cells that have a class attribute
            // or backgroundColor style
            if (! hasClass(mytd) &&
                ! mytd.style.backgroundColor) {
        
              mytd.style.backgroundColor =
                even ? evenColor : oddColor;
            
            }
          }
        }
        // flip from odd to even, or vice-versa
        even =  ! even;
      }
    }
  }
  
  
  // jquery per mostrar informacio fotos
  
 function pastilla(){

	$(document).ready(function(){
	$("#go").click(function(){
	   $("#go").fadeOut("fast"),
	    $("#blockInfo").animate({ 
        	height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);
	});

	
	$("#blockInfo").click(function(){
	   $("#blockInfo").animate({ 
        height: "0px",
		marginTop: "350px",
		opacity: 0}, 500, function(){$("#blockInfo").hide(); $("#go").fadeIn("medium");} );
	 });

	  $("#go").hide();
	  
	  setTimeout('$("#blockInfo").animate({height: "0px",marginTop: "350px",opacity: 0}, 500, function(){$("#blockInfo").hide();$("#go").fadeIn("medium");} );', 1000);
	  
  	});
	
 }
 
 function pastilla_mara(){

		$(document).ready(function(){
		$("#go").click(function(){
		   $("#go").fadeOut("fast"),
			$("#blockInfo").animate({ 
				height: "370px",
				opacity: 100,
				marginTop: "0"}, 500);
		});
	
		
		$("#blockInfo").click(function(){	   
		   $("#blockInfo").animate({ 
			height: "0px",
			marginTop: "350px",
			opacity: 0}, 500, function(){$("#blockInfo").hide(); $("#go").fadeIn("medium");} );
		 });
			
		//  $("#go").hide();
		  
		  
		//  setTimeout('$("#blockInfo").animate({height: "0px",marginTop: "350px",opacity: 0}, 500, function(){$("#blockInfo").hide();$("#go").fadeIn("medium");} );', 1000);
	  
  	});
	
 }
 
 function inicioUrbana(){

	
		$(document).ready(function(){
		
		   
			$("#blockInfo").animate({ 
				height: "370px",
				opacity: 100,
				marginTop: "0"}, 500);
		
	
		
		$("#blockInfo").click(function(){
		   $("#blockInfo").animate({ 
			height: "0px",
			marginTop: "350px",
			opacity: 0}, 500, function(){$("#blockInfo").hide();} );
		 });
		 document.getElementById("titolCapa").innerHTML="RUTA URBANA";
		 document.getElementById("textCapa").innerHTML="<strong>Dalt Vila</strong> was declared a World Heritage site by UNESCO in 1999. Walk around the cobbled streets and go back into the past.<br />Contemporary Art Museum. Cathedral. Fantastic views.<br /><br /> <strong><i>Feria Medieval</i></strong><br />During the second week of May there is a celebration to commemorate the declaration of the city as World Heritage site.<br />Dalt Vila is transformed into a medieval city with markets and stalls filled with hand-made crafts, concerts, and street theatre.<br /><br /><strong><i>Shopping in Ibiza</i></strong><br />The best brands in every style Shops: Atelier, Mayurka, etc.<br /><br /><strong><i>To drink a tentempi&eacute;</i></strong><br />Classics, Montesol and Marisol.<br />Plaza del Parque, Madagascar, Caf&eacute; del Parque, etc.";
		  
		  
		  
		  setTimeout('$("#blockInfo").animate({height: "0px",marginTop: "350px",opacity: 0}, 500, function(){$("#blockInfo").hide();$("#go").fadeIn("medium");} );', 1000);
	  
  	});
	
 }
 

function urbana(){
	 	 
	 $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="RUTA URBANA";
	 document.getElementById("textCapa").innerHTML="<strong>Dalt Vila</strong> was declared a World Heritage site by UNESCO in 1999. Walk around the cobbled streets and go back into the past.<br />Contemporary Art Museum. Cathedral. Fantastic views.<br /><br /> <strong><i>Feria Medieval</i></strong><br />During the second week of May there is a celebration to commemorate the declaration of the city as World Heritage site.<br />Dalt Vila is transformed into a medieval city with markets and stalls filled with hand-made crafts, concerts, and street theatre.<br /><br /><strong><i>Shopping in Ibiza</i></strong><br />The best brands in every style Shops: Atelier, Mayurka, etc.<br /><br /><strong><i>To drink a tentempi&eacute;</i></strong><br />Classics, Montesol and Marisol.<br />Plaza del Parque, Madagascar, Caf&eacute; del Parque, etc.";
	 
 }
 
 function nautica(){

	 
	  $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);
	 
	 document.getElementById("titolCapa").innerHTML="RUTA N&Aacute;UTICA";
	 document.getElementById("textCapa").innerHTML="Ibiza offers wonderful beaches and coves, where you can enjoy the sun and magnificent restaurants.<br /><br /> <strong>Excursions</strong><br /><i>&Prime;Las Puertas del Cielo&rdquo; in Santa In&eacute;s: Atl&aacute;ntis</i> (Cala d&acute;Hort).<br /><i>La Torre del Pirata between Salinas and Es Cavallet.</i><br /><br /><strong>Amazing beaches</strong><br /><i>Salinas: (nudist):</i> Malibu, Jockey and Sa Trinxa zone.<br /><i>Es Cavallet (nudist):</i> To eat, <i>La Escollera</i>.<br /><i>Cala D&acute;hort:</i> Incredible views to &Prime;Es Vedra&rdquo;. Amazing sunset and recommended to eat in <i>&Prime;El Carmen&rdquo;</i>. <br /><i>Cala Xarraca (San Juan) Benirr&aacute;s:</i> Drummers every Friday from the afternoon until the morning.<br /> <i>Punta Galera (San Antonio) Sol d&acute;en Serra:</i> A different sunset.<br /><i>Cala Jondal:</i> Spend all day in <i>Blue Marlin</i>.";
 }
 
 function rural(){
	
	  $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);
	 
	 document.getElementById("titolCapa").innerHTML="RUTA RURAL";
	 document.getElementById("textCapa").innerHTML="<strong>Ibiza</strong>, it is know as the white island because the white walls of the villages contrast with the green pine trees and the mediterranean blue sky.<br /><br /><strong>Towns that you must visit</strong><br /><i> Santa Gertrudis San Miguel San Mateo Santa Ines y Valle de Corona:</i> beautiful landscapes that are a must during winter.<br /> There are walking routes and mountain bike trails with different degrees of difficulty.<br /><br /> <strong> Recommended regional food and restaurants</strong><br /><i>Bar Costa in Santa Gertrudis:</i> Ham sandwiches.<br /> <i>Can Cosmi in Santa Ines: Potato Tortilla.</i>";
 }
 
 function costa(){
	
	 $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);
	 
	 document.getElementById("titolCapa").innerHTML="RUTA COSTA";
	 document.getElementById("textCapa").innerHTML="Sailing enthusiasts have two ports in Ibiza:<i>Marina Botafoch</i> and <i>Ibiza Nueva</i>.<br /><br /> <strong> Marina Botafoch</strong><br /> Just five minutes from the hotel.<br /><br /> <strong>For drinks or dinner</strong><br /><i>Sydney, Magnus, and Il Giardinetto</i><br /><br /><strong>Shopping</strong><i>Miranda, Arias, and Dora Herbst.</i><br /><br /><strong>Travel by boat to</strong><br><i>Formentera.<br /> Santa In&eacute;s.</i><br /> See the sun set from the west coast of the island.";
 }

function inicioUno(){
	 $(document).ready(function(){
		
		   
			$("#blockInfo").animate({ 
				height: "370px",
				opacity: 100,
				marginTop: "0"}, 500);
		
	
		
		$("#blockInfo").click(function(){
		   $("#blockInfo").animate({ 
			height: "0px",
			marginTop: "350px",
			opacity: 0}, 500, function(){$("#blockInfo").hide();} );
		 });
		 document.getElementById("titolCapa").innerHTML="1";
		 document.getElementById("textCapa").innerHTML="'Vida', 2007. Acr&iacute;lico sobre papel.<br /><br /><strong>Isabel Ferrer</strong> (Palma)<br />Pintora en esencia, desde siempre el paisaje ha sido el tema que ha motivado a la artista a pintar.<br /><br />Si a primera vista podemos describir las pinturas de Isabel como geom&eacute;tricas y abstractas, las tramas de diferentes colores nos descubren el entorno y el paisaje vivido e interiorizado por la artista.";
		  
		  
		  
		  setTimeout('$("#blockInfo").animate({height: "0px",marginTop: "350px",opacity: 0}, 500, function(){$("#blockInfo").hide();$("#go").fadeIn("medium");} );', 1000);
	  
  	});
 }
 
 function uno(){
	 $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="1";
	 document.getElementById("textCapa").innerHTML="'Vida', 2007. Acr&iacute;lico sobre papel.<br /><br /><strong>Isabel Ferrer</strong> (Palma)<br />Pintora en esencia, desde siempre el paisaje ha sido el tema que ha motivado a la artista a pintar.<br /><br />Si a primera vista podemos describir las pinturas de Isabel como geom&eacute;tricas y abstractas, las tramas de diferentes colores nos descubren el entorno y el paisaje vivido e interiorizado por la artista.";
	 
 }

 
 function dos(){
	$("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="2";
	 document.getElementById("textCapa").innerHTML="'Agua', 2007. T&eacute;cnica Mixta sobre papel.<br /><br /><strong>Agn&eacute;s D&auml;llenbach</strong> (Francia)<br />Sus pinturas a trav&eacute;s de colores planos y relieves aportan calma incitando al espectador a la reflexi&oacute;n.";
	 
 }

 
 function tres(){
	$("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="3";
	 document.getElementById("textCapa").innerHTML="'Vida', 2007. Acr&iacute;lico sobre lino.<br /><br /><strong>Ignasi Gelabertp</strong> (Palma)<br />Este joven artista mallorqu&iacute;n nos deleita con pinturas monocolores sobre linos naturales.";
	 
 }

 
 function cuatro(){
	 $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="4";
	 document.getElementById("textCapa").innerHTML="'Aire', 2007. Fotograf&iacute;a laminada sobre dibond.<br /><br /><strong>Juan Antonio Garc&iacute;a</strong> (Mallorca)<br />Mediante la fotograf&iacute;a el artista refleja momentos de sorpresa y fascinaci&oacute;n por un escenario que se le antoja po&eacute;tico y le apresura a disparar su c&aacute;mara, retener el instante, prepararse para volver en otra ocasi&oacute;n, conseguir la luz adecuada...";
	 
 }

 
 function cinco(){
	$("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="5";
	 document.getElementById("textCapa").innerHTML="'Agua', 2007. T&eacute;cnica mixta sobre tela.<br /><br /><strong>Concha Romeu</strong> (Madrid)<br />Utiliza sedas, sedas, linos, algodones de colores, tierra natural... Sus obras son una experiencia entre los recuerdos y la feminidad expresada a trav&eacute;s de la delicadeza y la imagen.";
	 
 }

 
 function seis(){
	 $("#blockInfo").animate( { 
			height: "370px",
			opacity: 100,
			marginTop: "0"}, 500);

document.getElementById("titolCapa").innerHTML="6";
	 document.getElementById("textCapa").innerHTML="'Agua', 2007. Cer&aacute;mica y fotograf&iacute;a sobre papel.<br /><br /><strong>B&aacute;rbara Juan</strong> (Mallorca)<br />Suaves y delicadas cer&aacute;micas esmaltadas, lienzos a modo de cojines y flores p&aacute;lidas esparcidas en el espacio...";
	 
 }

