$(document).ready( function() {	var msie = $.browser.msie;	var msie6 = $.browser.msie && $.browser.version <= 6;	var msie7 = $.browser.msie && $.browser.version <= 7;	var msie8 = $.browser.msie && $.browser.version <= 8;	if (msie) $(".colset .col:last").addClass('last').size();	// Menu 	var subs = $("#nav li:has(ul)");	subs.find("> a").click( function(e) { 		e.preventDefault();		if ( $(this).parent().find("ul a").size() == 1 ) {			// Solo hay un subelemento			document.location.href = $(this).parent().find("ul a").attr('href');		} else if ( $(this).parent().find("ul a.default:first").size() ) {			// Existe un enlace con la clase default			document.location.href = $(this).parent().find("ul a").attr('href');		} else {			subs.filter(".focus").removeClass("focus selected").blur();			$(this).parent().focus()				   .addClass('focus selected'); 		}	});		var curr = document.location.href.split(/[#]/).shift();	$("#nav li").each( function() {		var link = $(">a", this).get(0).href;		var url = link.split(/[#]/).shift();		var hash = link.split(/[#]/).pop();		if (link == curr && (!hash || hash==url)) $(this).addClass("selected");				$(this).hover(			function() { $(this).addClass("hover").find('>ul').css({'z-index':'1000'}); },			function() { $(this).removeClass("hover").find('>ul').css({'z-index':'999'}); }		)	});	subs.filter(":has(.selected)").addClass("focus selected");		// Lightbox	$("a[rel=lightbox]").lightBox({		imageLoading: '/img/lightbox-ico-loading.gif',		imageBtnClose: '/img/lightbox-btn-close.gif',		imageBtnPrev: '/img/lightbox-btn-prev.gif',		imageBtnNext: '/img/lightbox-btn-next.gif',		imageBlakn: '/img/lightbox-blank.gif',		txtImage : 'Imagen',		txtOf : 'de',		fixedNavigation:true	});		// Carrusel imagenes	if ( !msie7 ) {		$("#header .image-single").hide();		$("#header .image-list").html( $("#header .image-list").html().replace( /^\s*\<\!\-\-|\-\-\>\s*$/g, '' ) )								.nivoSlider({									directionNav:false,									controlNav:false,									pauseTime:5000,									pauseOnHover:false								});	}		// tabs	$(".js-tabs").each( function(i) {			$l = $(this).find(".js-tab-content");		$h = $("<table class='tabla-tabs'><tr></tr></table>");		var idbase = "jstags-"+i+"-";		$l.each( function(j) {			var id = $(this).attr('id') || (idbase+j);			$(this).attr('id', id);			var title = $(this).find("caption").html();			$(this).find("caption").remove();			var $b = $('<th><a href="#'+id+'">'+title+'</a></th>');			$h.find('tr:first').append($b);			$b.click( function(e){				e.preventDefault();				$h.find("th").removeClass("selected");				$(this).addClass("selected");				$l.hide();				$l.filter("#"+id).show();			});		} );		$(this).prepend($h);		$h.find("th:first").click();		} );});
