﻿    
$(document).ready(function() {
     /*Includes*/
	 /*
	 $("#header").load("header.html"); 
     $(".header-nav").load("header-nav.html"); 
     $(".header-nav01").load("header-nav01.html");
     $("#content-left1").load("content-left.html");   	 
     $("#footer").load("footer.html");
	*/
	$(".accordions h5").click(function(){	
	  $(this).next("div").slideToggle("slow");
	  $(this).toggleClass("active");
    });

	
	$(".accordions h2").click(function(){	
	  $(this).next("div").slideToggle("slow");
	  $(this).toggleClass("active");
    });
	
	
	$("div.acc-f").click(function(){	
	  $(this).next("ul.c-files").slideToggle("slow");
	  $(this).toggleClass("active");
    });

	
	 /*Function Pestañas en Repositori Documental*/
    $('#ct-label a.tab').live('click', function() {
            
			   // Get the tab name
				var contentn= $(this).attr("id");
				var contentname0= contentn.substr(1)
                var contentname = contentname0 + "-content";

                // hide all other tabs
                $("#ct-label li").removeClass("current");
				$(".p-hide").hide();
				
                // show current tab
                $("#" + contentname).show();
                $(this).parent().addClass("current");
				
    });	
	


	

 		
    /*Menu*/
	$("ul.nav li").live('mouseover', function() {

	    $("ul.nav li").removeClass("hover");
	    $("ul.nav li a").attr("style", "color:#1a1919;");
            $("ul.nav li.nav-active a").attr("style", "color:#FFF;");
            $("div.nav_").hide();


		var idl= $(this).attr("id");
		var c= idl.substr(1);

		 $("#e"+c).show();
	     $("#"+idl).addClass("hover");
		 $("#"+idl+" a").attr("style", "color:#FFF;");


    });

	 $("#header").live('mouseover', function() {

		 $("ul.nav li").removeClass("hover");
         $("div.nav_").hide();
          $("ul.nav li a").attr("style", "color:#1a1919;");
            $("ul.nav li.nav-active a").attr("style", "color:#FFF;");

	});

    $("#content").live('mouseover', function() {

		 $("ul.nav li").removeClass("hover");
         $("div.nav_").hide();
          $("ul.nav li a").attr("style", "color:#1a1919;");
            $("ul.nav li.nav-active a").attr("style", "color:#FFF;");

	});

});


function limpia(m) { 
    
	var0=$("#"+m).val();
    if ( var0 == ('CERCAR') ) {  $("#"+m).attr("value",""); }

}

function dall() {
    
	$(".accordions h2").next("div").slideToggle("slow");
    $(".accordions h2").toggleClass("active");
	$("a#ct-a").toggleClass("activea");
	$("a#ct-a.activea").html("PLEGAR-HO TOT");
	$("a#ct-a:not(.activea)").html("DESPLEGAR-HO TOT");
}

function copy(i1,i2) {

   $("#"+i2).attr("value", $("#"+i1).val());

}
/*
function mu(c,l)  {
 
    $("#"+c).show();
	$("#"+l).addClass("hover");
	$("#"+l+" a").attr("style", "color:#FFF;"); 
	$("#"+l+" a:hover ").attr("style", "color:#FFF;");
             
}

function oc(c,l)  { 
    
	$("#"+c).hide();
	$("#"+l).removeClass("hover");
	$("#"+l+" a").attr("style", "color:#1A1919;");
    $("#"+l+".nav-active a").attr("style", "color:#FFF;");
	$("#"+l+".nav-active a:hover ").attr("style", "color:#FFF;");
}
  */









