$(document).ready(function(){
	
	$(".accordion .acor:first").addClass("active");
	$(".accordion .acor:first").hide();
	$(".accordion .body:not(:first)").hide();


	$(".accordion .acor").click(function(){
		$(this).next(".body").slideToggle("fast")
		.siblings(".body:visible").slideUp("fast");
		$(this).toggleClass("active");
		$(this).siblings(".acor").removeClass("active");
		$(".acor").show();
		$(this).hide();
	});
	//$('#containertab').tabs({ fxAutoHeight: true });
	
//para mi tab distanciado
		$(".secciones").hide();
		$("#section-1").show();
	
	$(".tb").click(function(){
	//alert(this.href)
		var expl= this.href;
		var posta='';
		x=1;
		y=0;
		edi="";
		flag=false;
		while(x!==expl.length){
		if(flag===true){
			posta=posta+expl.charAt(x);
			}
		if(expl.charAt(x)==='#'){
			flag=true;
		}
		y++;
		x++;
		}
		//aqui obtenemos el id sin mas nada
		$(".tb").removeClass("active");
		$(this).addClass("active");
		$(".secciones").hide();
		$("#"+posta).show();
		$("#"+posta+" .accordion .acor:first").addClass("active");
		$("#"+posta+" .accordion .acor:first").hide();
		$("#"+posta+" .accordion .body:first").show();
		$("#"+posta+" .accordion .body:not(:first)").hide();		
		
		return false;
		
	});

});
