$(document).ready(function (){
	$("div.WEB_CONTE_comboInferior1").hover(ComboEncima1,ComboFuera1);	
	$("div.WEB_CONTE_comboInferior1").bind("click",MenuCombo);

	$("div.WEB_CONTE_escapateRutina").pngFix();

	$("div.WEB_CONTE_pieDestino").pngFix();
	$("div.WEB_CONTE_medioPerfil").pngFix();
    $("div.WEB_CONTE_escapateRutinaIntro").pngFix();
	$("div.WEB_CONTE_barraActividades").pngFix();
	$("div.WEB_CONTE_estadosDestino").pngFix();
	$("div.WEB_CONTE_iconoInterna").pngFix();

    $("div.WEB_CONTE_bannerSecundario").pngFix();
	$("div.WEB_CONTE_agregar").children("span").map(pieDestino)
	$("div.WEB_CONTE_agregar2").children("span").map(medioPerfil)



	$("div.WEB_CONTE_fotosViajero").cycle({ 
		fx:     'scrollHorz', 
		prev:   'div.WEB_CONTE_botonViajero1', 
		next:   'div.WEB_CONTE_botonViajero2', 
		startingSlide: 0, 
		prevNextClick: actualizarDatosViajero,
		timeout: 0 
	});
	
	var fotos_total= $("div.WEB_CONTE_foto").length;

	$("span#id_foto_total").text(fotos_total);
	
    $("span[class^='ttip']").APS_ToolTip();	
	
});


function pieDestino(index){
	var anchoTexto = $(this).next("div.WEB_texto6").width();
	var anchoIcono = $(this).width();	
		
	$(this).next("div.WEB_texto6").css({"position": "relative","left": 6+anchoIcono})
	$(this).parent("div.WEB_CONTE_agregar").css({"width": anchoIcono+anchoTexto+10})
}

function medioPerfil(index){
	var anchoTexto = $(this).next("div.WEB_texto6").width();
	var anchoIcono = $(this).width();	
		
	$(this).next("div.WEB_texto6").css({"position": "relative","left": 6+anchoIcono})
	$(this).parent("div.WEB_CONTE_agregar2").css({"width": anchoIcono+anchoTexto+10})
}


var A_menuCombo=["",0,0];

function actualizarDatosViajero($cont, $slides, opts){
	$("span#id_foto_actual").text($slides+1);
}

function MenuCombo(){
	$("div.WEB_CONTE_menuCombo1").hide();
	var combo_id=$(this).children(".WEB_CONTE_menuCombo1").attr("id");
	var combo_elegido=combo_id.substring(7,6);
	$(this).children("div.WEB_CONTE_menuCombo1").slideDown();
	$(this).children("div.WEB_CONTE_menuCombo1").css("left",A_menuCombo[combo_elegido]);
	$(this).children("div.WEB_CONTE_menuCombo1").hover(MenuComboEncima,MenuComboFuera)
}

function MenuComboEncima(){
	$(this).show();	
}

function MenuComboFuera(){
	$(this).hide();
}

function ComboEncima1(){
	$(this).addClass("WEB_CONTE_comboInferior1_on"); 
}

function ComboFuera1(){
	$(this).removeClass("WEB_CONTE_comboInferior1_on");
	$(this).children("div.WEB_CONTE_menuCombo1").hide();
}



