$(document).ready(function() {
	// Tratamiento del menú de navegación
	$page = jQuery.url.attr("file");
	if(!$page) {
		$page = 'index.php';
	}
	$("#menu ul li").each(function() {
		var $href = $(this).attr('title');
		$(this).hover(
			function() {
				if($(this).hasClass('active')) {}
				else { $(this).addClass('hover');
				}
			},
			function() {
				$(this).removeClass('hover');
			}
		);
		if (($href == $page) || ($href == '')) {
			$(this).addClass('active');
		} else {
			$(this).removeClass('active');
		}
	});
	
	$('ul.ddmenu li').hover(
		function() {
			$(this).addClass("hover");
      	$('ul:first',this).css({
      			'z-index': 9999,
      			'visibility': 'visible',
      			'margin-left': '-5px',
      	});
		}, 
		function() {  
			$(this).removeClass("hover");
			$('ul:first',this).css('visibility', 'hidden');
		}
	);

	
	// Sección NOTICIAS
	$("#noticias").hover(
		function() {
			$(this).animate({left: "0"}, "fast");
		},
		function() {
			$(this).animate({left: "-15px"}, "fast");
		}
	);
	
	// Tratamiento de la galería del sidebar
	var galleries = $('.ad-gallery').adGallery();
	
	// Sección EMPRESA
	//Cuando el sitio carga...
	$(".tab_content").hide(); //Esconde todo el contenido
	$("ul.tabs li:first").addClass("active").show(); //Activa la primera tab
	$(".tab_content:first").show(); //Muestra el contenido de la primera tab

	//On Click Event
	$("ul.tabs li").click(function() {
		$("ul.tabs li").removeClass("active");
		$(this).addClass("active"); //Agrega la clase activa a la tab seleccionada
		$(".tab_content").hide(); //Esconde todo el contenido de la tab

		var activeTab = $(this).find("a").attr("href"); //Encuentra el valor del atributo href para identificar la tab activa + el contenido
		$(activeTab).fadeIn(); //Agrega efecto de transición (fade) en el contenido activo

		return false;
	});
	
	// Sección OPCIONES Y ACCESORIOS
	$(".opciones h2:first").addClass('show');
	$(".opciones div:not(:first)").hide();
	
	$(".opciones h2").click(function() {
		$(this).next('.descripcion').slideToggle('fast').siblings('div:visible').slideUp('fast');
		$(this).toggleClass('show');
		$(this).siblings('h2').removeClass('show');
	});
	
	
	// Sección MODELOS
	/****** Estilo de los thumbs *******/
	//Estado por defecto de todos los thumbs
	$('#pisthumbs img:not(".thumb_active")').animate({opacity: 0.7}, 'fast');
	//Efectos :hover y :active
	$('#pisthumbs img').each(function() {
		$(this).hover(
			function() {
				$(this).addClass('thumb_hover').animate({opacity: 1}, 'fast');
			}, 
			function() {
				if($(this).hasClass('thumb_active')) { 
					$(this).removeClass('thumb_hover').animate({opacity: 1}, 'fast');
				}
				else {
					$(this).removeClass('thumb_hover').animate({opacity: 0.7}, 'fast');
				}
			}
		);
		
		// onClick event
		$(this).click(function() { 
			$("#pisthumbs img").removeClass('thumb_active').animate({opacity: 0.7}, 'fast');
			$(this).addClass('thumb_active');
			
			//Recopilamos las variables
			var $nombre = $(this).attr('title');
			
			var url = window.location.href; 			
			var lang_en = url.search('en');
			var lang_fr = url.search('fr')
				
			//Trigger de los métodos
			changeModelo($nombre);
			changeDisponibles($nombre);
			
			$("#listamodelos a").click(function() {
				var $modelo = $(this).attr('title');
				if(lang_en > 0) {
					$.fn.fancyzoom.defaultsOptions.imgDir='../../imgs/zoom/'; //very important must finish with a /
					changeCaracteristicasEn($nombre, $modelo);
				}
				else if(lang_fr > 0) {
					$.fn.fancyzoom.defaultsOptions.imgDir='../../imgs/zoom/'; //very important must finish with a /
					changeCaracteristicasFr($nombre, $modelo);		
				}
				else {
					$.fn.fancyzoom.defaultsOptions.imgDir='imgs/zoom/'; //very important must finish with a /
					changeCaracteristicas($nombre, $modelo);
				}
			});	
		});
	});
});

//Función que actualiza la foto y el nombre de cada modelo a nivel general
function changeModelo(nombre) {
	//$(document).ready(function() {
		var src = '<img src="imgs/modelos/'+nombre+'/fotoplantaperfil.png" />';
		$("#fotoplantaperfil").html(src);
		$("#modelo").html(nombre);
	//});
}

function changeModeloEn(nombre) {	
	var src = '<img src="../../imgs/modelos/'+nombre+'/fotoplantaperfil.png" />';
	$("#fotoplantaperfil").html(src);
	$("#modelo").html(nombre);
}

//Función que actualiza los modelos de una piscina principal
function changeDisponibles(nombre) {
	//$(document).ready(function() {
		var $table;
		switch(nombre) {
			case "Compacta":
				$table = '<tr><td><a title="Compacta4" href="#">Compacta 4</a></td><td><a title="Compacta5" href="#">Compacta 5</a></td><td><a title="Compacta5L" href="#">Compacta 5L</a></td></tr><tr><td><a title="Compacta5P" href="#">Compacta 5P</a></td><td><a title="Compacta6" href="#">Compacta 6</a></td><td><a title="Compacta8" href="#">Compacta 8</a></td></tr><tr><td><a title="Compacta9" href="#">Compacta 9</a></td><td><a title="Compacta10" href="#">Compacta 10</a></td></tr>';
				break;
			case "Delta":
				$table = '<tr><td><a title="Delta5" href="#">Delta 5</a></td><td><a title="Delta6" href="#">Delta 6</a></td><td><a title="Delta75" href="#">Delta 75</a></td></tr><tr><td><a title="Delta8" href="#">Delta 8</a></td><td><a title="Delta100" href="#">Delta 100</a></td><td><a title="DeltaNinyos" href="#">Delta ni&ntilde;os</a></td></tr>';
				break;
			case "Imperio":
				$table = '<tr><td><a title="Imperio9" href="#">Imperio 9</a></td><td><a title="Imperio11" href="#">Imperio 11</a></td></tr>';
				break;
			case "Nilo":
				$table = '<tr><td><a title="Nilo50" href="#">Nilo 50</a></td><td><a title="Nilo65" href="#">Nilo 65</a></td><td><a title="Nilo75" href="#">Nilo 75</a></td></tr><tr><td><a title="Nilo90" href="#">Nilo 90</a></td><td><a title="Nilo90FP" href="#">Nilo 90 Fondo Plano</a></td><td><a title="Nilo100" href="#">Nilo 100</a></td></tr>';
				break;
			case "Spa":
				$table = '<tr><td><a title="Spa20R" href="#">Spa 20R</a></td><td><a title="Spa20SR" href="#">Spa 20 Sin Rebosadero</a></td></tr><tr><td><a title="Compacta4Spa" href="#">Compacta 4 Spa</a></td></tr><tr><td><a title="Compacta5Spa" href="#">Compacta 5 Spa</a></td></tr>';
				break;
		}
		$('#listamodelos').html($table);
	//});
}

//Función que genera las características propias de cada modelo específico de piscina
function changeCaracteristicas(nombre, modelo) {
	//$(document).ready(function() {
	
		$(".caracteristicas").html('<div class="titulocarac" id="submodelo"></div><div id="interesar"><a href="multiforma-contacto.php?mod='+modelo+'">¿Te interesa?</a></div><ul><li>Largo exterior: <span id="largo"></span></li><li>Ancho exterior: <span id="ancho"></span></li><li>Profundidad: <span id="profundidad"></span></li><li>Interior: <span id="interior"></span></li><li>Pendiente: <span id="pendiente"></span></li></ul><div id="fotomodelo"><span>Pincha en la imagen para agrandar</span></div>');
		
		//Deberemos revisar cada uno de los modelos en busca de sus características
		switch(modelo) {
			//Compacta
			case "Compacta4":
				$("#submodelo").html('Compacta 4');
				$("#largo").html('4.00');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('3.80 x 2.15');
				$("#pendiente").html('0%');
				break;
			case "Compacta5":
				$("#submodelo").html('Compacta 5');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('5.00 x 2.15');
				$("#pendiente").html('0%');
				break;
			case "Compacta5L":
				$("#submodelo").html('Compacta 5L');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.30 / 1.60');
				$("#interior").html('5.00 x 3.50');
				$("#pendiente").html('7%');
				break;
			case "Compacta5P":
				$("#submodelo").html('Compacta 5P');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.30 / 1.60');
				$("#interior").html('5.00 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Compacta6":
				$("#submodelo").html('Compacta 6');
				$("#largo").html('6.60');
				$("#ancho").html('3.47');
				$("#profundidad").html('1.53');
				$("#interior").html('6.40 x 3.27');
				$("#pendiente").html('1%');
				break;
			case "Compacta8":
				$("#submodelo").html('Compacta 8');
				$("#largo").html('7.90');
				$("#ancho").html('3.60');
				$("#profundidad").html('1.50');
				$("#interior").html('7.70 x 3.40');
				$("#pendiente").html('1%');
				break;
			case "Compacta9":
				$("#submodelo").html('Compacta 9');
				$("#largo").html('9.20');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.20 / 1.80');
				$("#interior").html('9.00 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Compacta10":
				$("#submodelo").html('Compacta 10');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.58');
				$("#interior").html('10.20 x 4.10');
				$("#pendiente").html('1%');
				break;
			//Delta
			case "Delta5":
				$("#submodelo").html('Delta 5');
				$("#largo").html('5.20');
				$("#ancho").html('2.92');
				$("#profundidad").html('1.35');
				$("#interior").html('5.00 x 2.72');
				$("#pendiente").html('0%');
				break;
			case "Delta6":
				$("#submodelo").html('Delta 6');
				$("#largo").html('6.20');
				$("#ancho").html('3.48');
				$("#profundidad").html('1.40');
				$("#interior").html('6.00 x 3.28');
				$("#pendiente").html('1%');
				break;
			case "Delta75":
				$("#submodelo").html('Delta 75');
				$("#largo").html('7.60');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.30 / 1.75');
				$("#interior").html('7.40 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Delta8":
				$("#submodelo").html('Delta 8');
				$("#largo").html('8.00');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.50');
				$("#interior").html('7.80 x 3.90');
				$("#pendiente").html('1%');
				break;
			case "Delta100":
				$("#submodelo").html('Delta 100');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.2 / 1.85');
				$("#interior").html('10.00 x 3.90');
				$("#pendiente").html('8%');
				break;
			case "DeltaNinyos":
				$("#submodelo").html('Delta Ni&ntilde;os');
				$("#largo").html('3.20');
				$("#ancho").html('2.50');
				$("#profundidad").html('0.50');
				$("#interior").html('3.00 x 3.20');
				$("#pendiente").html('1%');
				break;
			//Imperio
			case "Imperio9":
				$("#submodelo").html('Imperio 9');
				$("#largo").html('8.80');
				$("#ancho").html('4.50');
				$("#profundidad").html('1.50 / 1.60');
				$("#interior").html('8.60 x 4.30');
				$("#pendiente").html('2.66%');
				break;
			case "Imperio11":
				$("#submodelo").html('Imperio 11');
				$("#largo").html('10.90');
				$("#ancho").html('5.55');
				$("#profundidad").html('1.50 / 1.60');
				$("#interior").html('10.70 x 5.35');
				$("#pendiente").html('2%');
				break;
			//Nilo
			case "Nilo50":
				$("#submodelo").html('Nilo 50');
				$("#largo").html('5.20');
				$("#ancho").html('3.20');
				$("#profundidad").html('1.17 / 1.40');
				$("#interior").html('5.00 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Nilo65":
				$("#submodelo").html('Nilo 65');
				$("#largo").html('6.40');
				$("#ancho").html('3.20');
				$("#profundidad").html('1.26 / 1.60');
				$("#interior").html('6.20 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Nilo75":
				$("#submodelo").html('Nilo 75');
				$("#largo").html('7.70');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.20 / 1.70');
				$("#interior").html('7.50 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Nilo90":
				$("#submodelo").html('Nilo 90');
				$("#largo").html('9.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.20 / 1.80');
				$("#interior").html('9.00 x 3.90');
				$("#pendiente").html('8%');
				break;
			case "Nilo90FP":
				$("#submodelo").html('Nilo 90 Fondo Plano');
				$("#largo").html('9.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.50');
				$("#interior").html('9.00 x 3.90');
				$("#pendiente").html('0%');
				break;
			case "Nilo100":
				$("#submodelo").html('Nilo 100');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.00 / 2.00');
				$("#interior").html('10.00 x 3.90');
				$("#pendiente").html('12%');
				break;
			//Spa
			case "Spa20R":
				$("#submodelo").html('Spa 20R');
				$("#largo").html('2.90');
				$("#ancho").html('2.20');
				$("#profundidad").html('0.90');
				$("#interior").html('2.00');
				$("#pendiente").html('1%');
				break;
			case "Spa20SR":
				$("#submodelo").html('Spa 20 Sin Rebosadero');
				$("#largo").html('2.45');
				$("#ancho").html('2.20');
				$("#profundidad").html('0.90');
				$("#interior").html('2.00');
				$("#pendiente").html('0%');
				break;
			case "Compacta4Spa":
				$("#submodelo").html('Compacta 4 Spa');
				$("#largo").html('4.00');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('3.80 x 2.15');
				$("#pendiente").html('1%');
				break;
			case "Compacta5Spa":
				$("#submodelo").html('Compacta 5 Spa');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.40');
				$("#interior").html('5.00 x 2.35');
				$("#pendiente").html('0%');
				break;
		}

		$("#fotomodelo").html('<a id="linkModelo'+modelo+'" href="imgs/modelos/'+nombre+'/'+modelo+'.jpg"><img class="modelospiscinas" src="imgs/modelos/'+nombre+'/thumb'+modelo+'.jpg" /></a><span>Pincha en la imagen para agrandar</span>');
		$("#linkModelo"+modelo).fancyzoom({overlay: 0.4});
	//});
}

function changeCaracteristicasEn(nombre, modelo) {
			
		$(".caracteristicas").html('<div class="titulocarac" id="submodelo"></div><div id="interesar"><a href="multiforma-contact.php?mod='+modelo+'">¿Interested?</a></div><ul><li>Length: <span id="largo"></span></li><li>Width: <span id="ancho"></span></li><li>Depth: <span id="profundidad"></span></li><li>Internal: <span id="interior"></span></li><li>Slope: <span id="pendiente"></span></li></ul><div id="fotomodelo"><span>Click to enlarge</span></div>');
		
		//Deberemos revisar cada uno de los modelos en busca de sus características
		switch(modelo) {
			//Compacta
			case "Compacta4":
				$("#submodelo").html('Compacta 4');
				$("#largo").html('4.00');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('3.80 x 2.15');
				$("#pendiente").html('0%');
				break;
			case "Compacta5":
				$("#submodelo").html('Compacta 5');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('5.00 x 2.15');
				$("#pendiente").html('0%');
				break;
			case "Compacta5L":
				$("#submodelo").html('Compacta 5L');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.30 / 1.60');
				$("#interior").html('5.00 x 3.50');
				$("#pendiente").html('7%');
				break;
			case "Compacta5P":
				$("#submodelo").html('Compacta 5P');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.30 / 1.60');
				$("#interior").html('5.00 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Compacta6":
				$("#submodelo").html('Compacta 6');
				$("#largo").html('6.60');
				$("#ancho").html('3.47');
				$("#profundidad").html('1.53');
				$("#interior").html('6.40 x 3.27');
				$("#pendiente").html('1%');
				break;
			case "Compacta8":
				$("#submodelo").html('Compacta 8');
				$("#largo").html('7.90');
				$("#ancho").html('3.60');
				$("#profundidad").html('1.50');
				$("#interior").html('7.70 x 3.40');
				$("#pendiente").html('1%');
				break;
			case "Compacta9":
				$("#submodelo").html('Compacta 9');
				$("#largo").html('9.20');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.20 / 1.80');
				$("#interior").html('9.00 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Compacta10":
				$("#submodelo").html('Compacta 10');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.58');
				$("#interior").html('10.20 x 4.10');
				$("#pendiente").html('1%');
				break;
			//Delta
			case "Delta5":
				$("#submodelo").html('Delta 5');
				$("#largo").html('5.20');
				$("#ancho").html('2.92');
				$("#profundidad").html('1.35');
				$("#interior").html('5.00 x 2.72');
				$("#pendiente").html('0%');
				break;
			case "Delta6":
				$("#submodelo").html('Delta 6');
				$("#largo").html('6.20');
				$("#ancho").html('3.48');
				$("#profundidad").html('1.40');
				$("#interior").html('6.00 x 3.28');
				$("#pendiente").html('1%');
				break;
			case "Delta75":
				$("#submodelo").html('Delta 75');
				$("#largo").html('7.60');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.30 / 1.75');
				$("#interior").html('7.40 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Delta8":
				$("#submodelo").html('Delta 8');
				$("#largo").html('8.00');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.50');
				$("#interior").html('7.80 x 3.90');
				$("#pendiente").html('1%');
				break;
			case "Delta100":
				$("#submodelo").html('Delta 100');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.2 / 1.85');
				$("#interior").html('10.00 x 3.90');
				$("#pendiente").html('8%');
				break;
			case "DeltaNinyos":
				$("#submodelo").html('Delta Ni&ntilde;os');
				$("#largo").html('3.20');
				$("#ancho").html('2.50');
				$("#profundidad").html('0.50');
				$("#interior").html('3.00 x 3.20');
				$("#pendiente").html('1%');
				break;
			//Imperio
			case "Imperio9":
				$("#submodelo").html('Imperio 9');
				$("#largo").html('8.80');
				$("#ancho").html('4.50');
				$("#profundidad").html('1.50 / 1.60');
				$("#interior").html('8.60 x 4.30');
				$("#pendiente").html('2.66%');
				break;
			case "Imperio11":
				$("#submodelo").html('Imperio 11');
				$("#largo").html('10.90');
				$("#ancho").html('5.55');
				$("#profundidad").html('1.50 / 1.60');
				$("#interior").html('10.70 x 5.35');
				$("#pendiente").html('2%');
				break;
			//Nilo
			case "Nilo50":
				$("#submodelo").html('Nilo 50');
				$("#largo").html('5.20');
				$("#ancho").html('3.20');
				$("#profundidad").html('1.17 / 1.40');
				$("#interior").html('5.00 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Nilo65":
				$("#submodelo").html('Nilo 65');
				$("#largo").html('6.40');
				$("#ancho").html('3.20');
				$("#profundidad").html('1.26 / 1.60');
				$("#interior").html('6.20 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Nilo75":
				$("#submodelo").html('Nilo 75');
				$("#largo").html('7.70');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.20 / 1.70');
				$("#interior").html('7.50 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Nilo90":
				$("#submodelo").html('Nilo 90');
				$("#largo").html('9.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.20 / 1.80');
				$("#interior").html('9.00 x 3.90');
				$("#pendiente").html('8%');
				break;
			case "Nilo90FP":
				$("#submodelo").html('Nilo 90 Fondo Plano');
				$("#largo").html('9.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.50');
				$("#interior").html('9.00 x 3.90');
				$("#pendiente").html('0%');
				break;
			case "Nilo100":
				$("#submodelo").html('Nilo 100');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.00 / 2.00');
				$("#interior").html('10.00 x 3.90');
				$("#pendiente").html('12%');
				break;
			//Spa
			case "Spa20R":
				$("#submodelo").html('Spa 20R');
				$("#largo").html('2.90');
				$("#ancho").html('2.20');
				$("#profundidad").html('0.90');
				$("#interior").html('2.00');
				$("#pendiente").html('1%');
				break;
			case "Spa20SR":
				$("#submodelo").html('Spa 20 Sin Rebosadero');
				$("#largo").html('2.45');
				$("#ancho").html('2.20');
				$("#profundidad").html('0.90');
				$("#interior").html('2.00');
				$("#pendiente").html('0%');
				break;
			case "Compacta4Spa":
				$("#submodelo").html('Compacta 4 Spa');
				$("#largo").html('4.00');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('3.80 x 2.15');
				$("#pendiente").html('1%');
				break;
			case "Compacta5Spa":
				$("#submodelo").html('Compacta 5 Spa');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.40');
				$("#interior").html('5.00 x 2.35');
				$("#pendiente").html('0%');
				break;
		}

		$("#fotomodelo").html('<a id="linkModelo'+modelo+'" href="../../imgs/modelos/'+nombre+'/'+modelo+'.jpg"><img class="modelospiscinas" src="../../imgs/modelos/'+nombre+'/thumb'+modelo+'.jpg" /></a><span>Click to enlarge</span>');
		$("#linkModelo"+modelo).fancyzoom({overlay: 0.4});

}

function changeCaracteristicasFr(nombre, modelo) {
			
		$(".caracteristicas").html('<div class="titulocarac" id="submodelo"></div><div id="interesar"><a href="multiforma-contacter.php?mod='+modelo+'">¿Int&eacute;resse?</a></div><ul><li>Longeur: <span id="largo"></span></li><li>Largeur: <span id="ancho"></span></li><li>Profondeur: <span id="profundidad"></span></li><li>Int&eacute;rieur: <span id="interior"></span></li><li>Pente: <span id="pendiente"></span></li></ul><div id="fotomodelo"><span>Cliquer pour agrandir</span></div>');
		
		//Deberemos revisar cada uno de los modelos en busca de sus características
		switch(modelo) {
			//Compacta
			case "Compacta4":
				$("#submodelo").html('Compacta 4');
				$("#largo").html('4.00');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('3.80 x 2.15');
				$("#pendiente").html('0%');
				break;
			case "Compacta5":
				$("#submodelo").html('Compacta 5');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('5.00 x 2.15');
				$("#pendiente").html('0%');
				break;
			case "Compacta5L":
				$("#submodelo").html('Compacta 5L');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.30 / 1.60');
				$("#interior").html('5.00 x 3.50');
				$("#pendiente").html('7%');
				break;
			case "Compacta5P":
				$("#submodelo").html('Compacta 5P');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.30 / 1.60');
				$("#interior").html('5.00 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Compacta6":
				$("#submodelo").html('Compacta 6');
				$("#largo").html('6.60');
				$("#ancho").html('3.47');
				$("#profundidad").html('1.53');
				$("#interior").html('6.40 x 3.27');
				$("#pendiente").html('1%');
				break;
			case "Compacta8":
				$("#submodelo").html('Compacta 8');
				$("#largo").html('7.90');
				$("#ancho").html('3.60');
				$("#profundidad").html('1.50');
				$("#interior").html('7.70 x 3.40');
				$("#pendiente").html('1%');
				break;
			case "Compacta9":
				$("#submodelo").html('Compacta 9');
				$("#largo").html('9.20');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.20 / 1.80');
				$("#interior").html('9.00 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Compacta10":
				$("#submodelo").html('Compacta 10');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.58');
				$("#interior").html('10.20 x 4.10');
				$("#pendiente").html('1%');
				break;
			//Delta
			case "Delta5":
				$("#submodelo").html('Delta 5');
				$("#largo").html('5.20');
				$("#ancho").html('2.92');
				$("#profundidad").html('1.35');
				$("#interior").html('5.00 x 2.72');
				$("#pendiente").html('0%');
				break;
			case "Delta6":
				$("#submodelo").html('Delta 6');
				$("#largo").html('6.20');
				$("#ancho").html('3.48');
				$("#profundidad").html('1.40');
				$("#interior").html('6.00 x 3.28');
				$("#pendiente").html('1%');
				break;
			case "Delta75":
				$("#submodelo").html('Delta 75');
				$("#largo").html('7.60');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.30 / 1.75');
				$("#interior").html('7.40 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Delta8":
				$("#submodelo").html('Delta 8');
				$("#largo").html('8.00');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.50');
				$("#interior").html('7.80 x 3.90');
				$("#pendiente").html('1%');
				break;
			case "Delta100":
				$("#submodelo").html('Delta 100');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.2 / 1.85');
				$("#interior").html('10.00 x 3.90');
				$("#pendiente").html('8%');
				break;
			case "DeltaNinyos":
				$("#submodelo").html('Delta Ni&ntilde;os');
				$("#largo").html('3.20');
				$("#ancho").html('2.50');
				$("#profundidad").html('0.50');
				$("#interior").html('3.00 x 3.20');
				$("#pendiente").html('1%');
				break;
			//Imperio
			case "Imperio9":
				$("#submodelo").html('Imperio 9');
				$("#largo").html('8.80');
				$("#ancho").html('4.50');
				$("#profundidad").html('1.50 / 1.60');
				$("#interior").html('8.60 x 4.30');
				$("#pendiente").html('2.66%');
				break;
			case "Imperio11":
				$("#submodelo").html('Imperio 11');
				$("#largo").html('10.90');
				$("#ancho").html('5.55');
				$("#profundidad").html('1.50 / 1.60');
				$("#interior").html('10.70 x 5.35');
				$("#pendiente").html('2%');
				break;
			//Nilo
			case "Nilo50":
				$("#submodelo").html('Nilo 50');
				$("#largo").html('5.20');
				$("#ancho").html('3.20');
				$("#profundidad").html('1.17 / 1.40');
				$("#interior").html('5.00 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Nilo65":
				$("#submodelo").html('Nilo 65');
				$("#largo").html('6.40');
				$("#ancho").html('3.20');
				$("#profundidad").html('1.26 / 1.60');
				$("#interior").html('6.20 x 3.00');
				$("#pendiente").html('7%');
				break;
			case "Nilo75":
				$("#submodelo").html('Nilo 75');
				$("#largo").html('7.70');
				$("#ancho").html('3.90');
				$("#profundidad").html('1.20 / 1.70');
				$("#interior").html('7.50 x 3.70');
				$("#pendiente").html('8%');
				break;
			case "Nilo90":
				$("#submodelo").html('Nilo 90');
				$("#largo").html('9.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.20 / 1.80');
				$("#interior").html('9.00 x 3.90');
				$("#pendiente").html('8%');
				break;
			case "Nilo90FP":
				$("#submodelo").html('Nilo 90 Fondo Plano');
				$("#largo").html('9.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.50');
				$("#interior").html('9.00 x 3.90');
				$("#pendiente").html('0%');
				break;
			case "Nilo100":
				$("#submodelo").html('Nilo 100');
				$("#largo").html('10.20');
				$("#ancho").html('4.10');
				$("#profundidad").html('1.00 / 2.00');
				$("#interior").html('10.00 x 3.90');
				$("#pendiente").html('12%');
				break;
			//Spa
			case "Spa20R":
				$("#submodelo").html('Spa 20R');
				$("#largo").html('2.90');
				$("#ancho").html('2.20');
				$("#profundidad").html('0.90');
				$("#interior").html('2.00');
				$("#pendiente").html('1%');
				break;
			case "Spa20SR":
				$("#submodelo").html('Spa 20 Sin Rebosadero');
				$("#largo").html('2.45');
				$("#ancho").html('2.20');
				$("#profundidad").html('0.90');
				$("#interior").html('2.00');
				$("#pendiente").html('0%');
				break;
			case "Compacta4Spa":
				$("#submodelo").html('Compacta 4 Spa');
				$("#largo").html('4.00');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.00');
				$("#interior").html('3.80 x 2.15');
				$("#pendiente").html('1%');
				break;
			case "Compacta5Spa":
				$("#submodelo").html('Compacta 5 Spa');
				$("#largo").html('5.20');
				$("#ancho").html('2.35');
				$("#profundidad").html('1.40');
				$("#interior").html('5.00 x 2.35');
				$("#pendiente").html('0%');
				break;
		}

		$("#fotomodelo").html('<a id="linkModelo'+modelo+'" href="../../imgs/modelos/'+nombre+'/'+modelo+'.jpg"><img class="modelospiscinas" src="../../imgs/modelos/'+nombre+'/thumb'+modelo+'.jpg" /></a><span>Cliquer pour agrandir</span>');
		$("#linkModelo"+modelo).fancyzoom({overlay: 0.4});

}

//Función que devuelve la lista de tamaños según su largo y ancho
function getTamanyos(largo, ancho) {
		var $table;
		if((largo == 'menos7') && (ancho == 'menos4')) {
			$table ='<tr><td><a rel="Compacta" title="Compacta4" href="#">Compacta 4</a></td><td><a rel="Compacta" title="Compacta5" href="#">Compacta 5</a></td><td><a rel="Delta" title="Delta5" href="#">Delta 5</a></td></tr><tr><td><a rel="Delta" title="Delta6" href="#">Delta 6</a></td><td><a rel="Delta" title="DeltaNinyos" href="#">Delta ni&ntilde;os</a></td><td><a rel="Nilo" title="Nilo50" href="#">Nilo 50</a></td></tr><tr><td><a rel="Nilo" title="Nilo65" href="#">Nilo 65</a></td><td><a rel="Compacta" title="Compacta6" href="#">Compacta 6</a></td><td><a rel="Spa" title="Spa20R" href="#">Spa 20R</a></td></tr><tr><td><a rel="Compacta" title="Compacta5L" href="#">Compacta 5L</a></td><td><a rel="Compacta" title="Compacta5P" href="#">Compacta 5P</a></td></tr><tr><td colspan="3"><a rel="Spa" title="Compacta4Spa" href="#">Compacta 4 Spa</a></td></tr><tr><td colspan="3"><a rel="Spa" title="Compacta5Spa" href="#">Compacta 5 Spa</a></td></tr>';
		}
		else if((largo == '710') && (ancho == 'menos4')) {
			$table = '<tr><td><a rel="Compacta" title="Compacta8" href="#">Compacta 8</a></td><td><a rel="Compacta" title="Compacta9" href="#">Compacta 9</a></td></tr><tr><td><a rel="Delta" title="Delta75" href="#">Delta 75</a></td><td><a rel="Nilo" title="Nilo75" href="#">Nilo 75</a></td></tr>';
		}
		else if((largo == '1014') && (ancho == 'menos4')) {
			$table = '<tr><td colspan="3">No existen resultados para la b&uacute;squeda seleccionada</td></tr>';
		}
		else if((largo == 'menos7') && (ancho == '47')) {
			$table = '<tr><td colspan="3">No existen resultados para la b&uacute;squeda seleccionada</td></tr>';
		}
		else if((largo == '710') && (ancho == '47')) {
			$table = '<tr><td><a rel="Delta" title="Delta8" href="#">Delta 8</a></td></tr><tr><td><a rel="Imperio" title="Imperio9" href="#">Imperio 9</a></td><td><a rel="Nilo" title="Nilo90" href="#">Nilo 90</a></td></tr>';
		}
		else if((largo == '1014') && (ancho == '47')) {
			$table = '<tr><td><a rel="Delta" title="Delta100" href="#">Delta 100</a></td><td><a rel="Imperio" title="Imperio11" href="#">Imperio 11</a></td><td><a rel="Nilo" title="Nilo100" href="#">Nilo 100</a></td></tr><tr><td><a rel="Compacta" title="Compacta10" href="#">Compacta 10</a></td></tr>';
		}
		$('#listatamanyos').html($table);
}


