function datosViaje($datos,$id_destino)
{
	var datos_viaje = document.getElementById($id_destino);
	datos_viaje.style.display='block';
	datos_viaje.innerHTML = $datos;
}
function borrarDatosViaje($id_destino)
{
	var datos_viaje = document.getElementById($id_destino);
	datos_viaje.style.display='none';
	document.getElementById($id_destino).innerHTML='';
}

/*
 * Tooltip script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 


this.tooltip = function(){	
	/* CONFIG */		
		xOffset = 10;
		yOffset = 20;		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result		
	/* END CONFIG */		
	$("a.tooltip").hover(function(e){											  
		this.t = this.title;
		this.title = "";									  
		$("body").append("<p id='tooltip'>"+ this.t +"</p>");
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");		
    },
	function(){
		this.title = this.t;		
		$("#tooltip").remove();
    });	
	$("a.tooltip").mousemove(function(e){
		$("#tooltip")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};



// starting the script on page load
$(document).ready(function(){
	tooltip();
});

/*
 * Url preview script 
 * powered by jQuery (http://www.jquery.com)
 * 
 * written by Alen Grakalic (http://cssglobe.com)
 * 
 * for more info visit http://cssglobe.com/post/1695/easiest-tooltip-and-image-preview-using-jquery
 *
 */
 
this.screenshotPreview = function(){	
	/* CONFIG */
		
		xOffset = 10;
		yOffset = 30;
		
		// these 2 variable determine popup's distance from the cursor
		// you might want to adjust to get the right result
		
	/* END CONFIG */
	$("a.screenshot").hover(function(e){
		this.t = this.title;
		this.title = "";	
		var c = (this.t != "") ? "<br/>" + this.t : "";
		$("body").append("<p id='screenshot'><img src='"+ this.rel +"' alt='url preview' />"+ c +"</p>");								 
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px")
			.fadeIn("fast");						
    },
	function(){
		this.title = this.t;	
		$("#screenshot").remove();
    });	
	$("a.screenshot").mousemove(function(e){
		$("#screenshot")
			.css("top",(e.pageY - xOffset) + "px")
			.css("left",(e.pageX + yOffset) + "px");
	});			
};


// starting the script on page load
$(document).ready(function(){
	screenshotPreview();
});

/* PARA COLOR PICKER */
/*$('input').ColorPicker({
	onSubmit: function(hsb, hex, rgb) {
		$('#colortexto').val(hex);
	},
	onBeforeShow: function () {
		$(this).ColorPickerSetColor(this.value);
	}
})
.bind('keyup', function(){
	$(this).ColorPickerSetColor(this.value);
});*/

/* Al final no usamos este método */
function generarDias(numeroMes,annio)
{
	var dias = 0;
	
	if( numeroMes == 1 || numeroMes == 3 || numeroMes == 5 || numeroMes == 7 || numeroMes == 10 || numeroMes == 12 )
	{
		dias= 31;		
	}else if( numeroMes == 2 ){
	
		if(annio%4==0) // Año bisiesto
			dias = 29;
		else
			dias = 28;
	
	}else{
	
		dias = 30;
	}
	
	// Procedemos a generar los option de los dias. el 'select' debe ser id="dias"
	objeto_select = document.getElementById('dia');
	

	objeto_select.appendChild(nuevo_option);	
	
	for(i=1;i<=dias;i++)
	{
		nuevo_option = document.createElement("option");
		
		nuevo_option.text  = i;
		nuevo_option.value = i;
		
		objeto_select.appendChild(nuevo_option);
		
	}


}

/* función para validar que hallan marcado el checkbox de política de privacidad */
function validarPolitica(id_check)
{
  var objeto_check = document.getElementById(id_check);
  if(objeto_check.checked)
  {
	 return true; 								 // Correcto, ha marcado check
  }
  else{
	 alert("Debe aceptar nuestras condiciones"); // Incorrecto, ha marcado check
	 return false;
  }
}
