$(document).ready(function (){
	$("div.WEB_CONTE_comboInferior1").hover(ComboEncima1,ComboFuera1);	
	$("div.WEB_CONTE_comboInferior1").bind("click",MenuCombo);
	
	$("div.WEB_CONTE_comboInferior2").hover(ComboEncima2,ComboFuera2);	
	$("div.WEB_CONTE_comboInferior2").bind("click",MenuCombo2);

	$("div.WEB_CONTE_escapateRutina").pngFix();

	$("div.WEB_CONTE_pieDestino").pngFix();
	$("div.WEB_CONTE_medioPerfil").pngFix();
	$("div.WEB_CONTE_escapateRutina").pngFix();
	$("div.WEB_CONTE_bloqueInterno3Info2").pngFix();
	$("div.WEB_CONTE_bloqueInterno4Info2").pngFix();
	//Ultimos Cambios
	$("div.WEB_CONTE_bloqueInterno4Info1_f2_c2").pngFix();
	$("div.WEB_CONTE_perfilIconos").pngFix();
	///   
	$("div.WEB_CONTE_blogEstrellas").pngFix();

	$("div.WEB_CONTE_enlacesSecundarios").pngFix();
    $("div[class^=WEB_CONTE_enlaceT]").bind('mouseover',EncimaBoton).bind('mouseout',FueraBoton);
	
	$("div.WEB_CONTE_barraActividades").pngFix();
	$("div.WEB_CONTE_estadosDestino").pngFix();
	$("div.WEB_CONTE_iconoInterna").pngFix();
	$("div.WEB_CONTE_bloqueInterno2Info2_f1_c2").pngFix();
	$("div.WEB_CONTE_agregarBlog_f1_c1").pngFix();
    $("div.WEB_CONTE_agregarFoto").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);
	

	$("div[class^='REG_ICONO']").APS_ToolTip();
	$("span[class^='ttip']").APS_ToolTip();
	$("div[class^='WEB_CONTE_actividad']").APS_ToolTip();
	$("div[class^='WEB_ICONO']").APS_ToolTip();
});


function FueraBoton(){
	if(this.className.substr(19,29)!= "WEB_CONTE_enlaceTSeleccionado"){
		$(this).css({"background": ""})
	}
}

function EncimaBoton(){
	
	if(this.className.substr(19,29)!= "WEB_CONTE_enlaceTSeleccionado"){
		$(this).css({"background": "#5ab610"})
	}
}


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();
}



