$(function(){
	
	var nexo="";

	$("div[class^=WEB_CONTE_fondoZonaTitulo]").filter(function(e){
		
		var elegido=this.className.substring(26,25);
		
		$(this).bind("mouseover",function(){
			this.className="WEB_CONTE_fondoZonaTitulo"+elegido+"_on";
		})
		
		$(this).bind("mouseout",function(){
			this.className="WEB_CONTE_fondoZonaTitulo"+elegido;
		})
		
		$(this).bind("click",function(){
			
			if(nexo==elegido){
				$(this).next("div").slideUp("1000");
				
				$(this).bind("mouseover",function(){
					this.className="WEB_CONTE_fondoZonaTitulo"+elegido+"_on";
				})
				
				$(this).bind("mouseout",function(){
					this.className="WEB_CONTE_fondoZonaTitulo"+elegido;
				})
				
				nexo="";
				
			}else{
			
				cerrarContenido(e,elegido)

				$(this).unbind("mouseover")
				$(this).unbind("mouseout")
		
				
				this.className="WEB_CONTE_fondoZonaTitulo"+elegido+"_on";
			
				$(this).next("div").slideDown("1000");
			
			}
	
		})
		
	})
		
	function cerrarContenido(num,elegido){

		nexo=elegido;
		
		$(".WEB_CONTE_zonaContenido").filter(function(e){
			if(num!=e){
				$(this).slideUp("1000");
			}
		})
	
		$(".WEB_CONTE_fondoZonaTitulo"+elegido+"_on").filter(function(){
			this.className="WEB_CONTE_fondoZonaTitulo"+elegido;
		})
		
		$("div[class^=WEB_CONTE_fondoZonaTitulo]").filter(function(e){
				
			if(num!=e){

				var elegido=this.className.substring(26,25);
				
				this.className="WEB_CONTE_fondoZonaTitulo"+elegido;
				
				$(this).bind("mouseover",function(){
					this.className="WEB_CONTE_fondoZonaTitulo"+elegido+"_on";
					
				})
				
				$(this).bind("mouseout",function(){
					this.className="WEB_CONTE_fondoZonaTitulo"+elegido;
					
				})
				
				
			}
		})
		
	}

})
