// JavaScript Document

var url_prestige; 


$(document).ready(function() {

	/*funciones*/	
	
	/*slideshow2*/
	if ($("#slideshow2").length > 0) {
		$(function() {        
			$('#slideshow2').cycle({
				prev:   '#prev',
				next:   '#next',       
				before: onBefore
			});    
			function onBefore() {
				$('#title').html(this.alt);
			}
		});
	}
	
	/*prestige*/
	/*var j = jQuery.noConflict();
	j(document).ready(function(){*/
		if ($("#disponibilidad").length > 0) {
				$.fn.createDialog.defaults = {
				progress: true,
				center: true,
				opacity: 0.7,
				bg: '#000'
			}

			$("#disponibilidad").createDialog({

				addr: 'web/prestige_iframe_monti.html',
				bg: '#000000'
			});
		}

		if ($("#disponibilidad1").length > 0) {
				$.fn.createDialog.defaults = {
				progress: true,
				center: true,
				opacity: 0.7,
				bg: '#000'
			}

			$("#disponibilidad1").createDialog({

				addr: '../web/prestige_iframe_monti.html',
				bg: '#000000'
			});
		}
		
		if ($("#consultacancelacion").length > 0) {
				$.fn.createDialog2.defaults = {
				progress: true,
				center: true,
				opacity: 0.7,
				bg: '#000'
			}			

			$("#consultacancelacion").createDialog2({

				addr: '../web/prestige_iframe_monti.html',
				bg: '#000000'
			});
		}
	//});
	
	/*//////////Lista de anclas/////////*/
	if ($(".divPreguntas")) {
		$(".divRespuestas p.subir").remove();
		$(".divRespuestas .puntabajo").removeClass("puntabajo");
		$(".divPreguntas li a").each(function(i){
			i++;
			var enlace = $(this).attr("href");
			$(this).attr("rel",enlace).attr("href","#c");
		});
		$('.divRespuestas .respuesta:not(:first)').hide();
		$('.divRespuestas .respuesta:not(:first)').addClass('nosalto');
		$(".divPreguntas li a").click(function(){
			$('.divRespuestas .respuesta').fadeOut("slow");
			$($(this).attr("rel")).fadeIn("slow");
			/*var altoDiv = $($(this).attr("rel")).height();
			$('.divRespuestas').css("height",altoDiv);*/
		});
	}
	
});