try{jQuery(function($){function handleErrors(msg){if('string'!==typeof(msg))
msg='Desconocido.';if('function'!==typeof(jQuery)){alert('jQuery no está definido.');return;}
var errorContainer=jQuery('#jsErrors');if(errorContainer.length>0){errorContainer.addClass('error notice');errorContainer.html(msg.toString()).fadeIn(3000,function(){jQuery(this).removeClass('notice');});}else
jQuery('body').prepend('<div class="error">'+msg+'</div>');}
try{if('undefined'===typeof(PUB_URL))
throw new TypeError('PUB_URL no está definida');if('undefined'===typeof(STATIC_RT))
throw new TypeError('STATIC_RT no está definida');var loadingHtmlImg='<p class="loading"><img src="'+STATIC_RT+'/images/Comunes/loaders/loading.gif" alt="Cargando..." /> Cargando...</p>';$.fn.tagName=function(){return this.get(0).tagName.toLowerCase();}
function cmsFade(elm){jQuery(elm).animate({backgroundColor:'#ffffe0'},300).animate({backgroundColor:'#fffbcc'},300).animate({backgroundColor:'#ffffe0'},300).animate({backgroundColor:'#f7f7f7'},300);}
function cebraAndTablesorter(){if(jQuery('table').length>0){jQuery('table tr:nth-child(odd)').addClass('odd');if(jQuery('table').hasClass('tablesorter')){jQuery.getScript(STATIC_RT+'/js/jquery/jquery.tablesorter.min.js',function(){jQuery('table.tablesorter').tablesorter();});}}}
function initFancyBox(){jQuery('a.fancybox').fancybox();jQuery('a[rel=group_gallery]').fancybox();jQuery('a.fancybox_group').fancybox();jQuery('a.fancybox_inline').fancybox();jQuery('a.fancybox_iframe').fancybox({'frameWidth':750,'frameHeight':400,});jQuery("a[rel='imagebox']").fancybox();jQuery("a[class='imagebox']").fancybox();jQuery(".gallery-item .gallery-icon a").addClass('group').attr('rel','group').fancybox();}
function initTabs(){jQuery('.tabs').tabs();}
function initDialog(){jQuery('.launchDialog').each(function(){var ElmTarget=jQuery(this).attr('href');if(ElmTarget.length>0){jQuery(this).click(function(){var Element=jQuery(ElmTarget);if(Element.length==1){Element.dialog();}
return false;});}});}
function newsTickerInit(elmClass){jQuery('ul.'+elmClass).newsTicker(10000);}
function twitterTicker(){jQuery('a.rsswidget').parent('li').parent('ul').addClass('newsticker');}
function recentCommentsTicker(){jQuery('ul#recentcomments').addClass('squareList');}
function renderTocBox(){if(jQuery('#noToC').length==0){$.toc=function(tocList){jQuery(tocList).addClass('jquery-toc');var tocListArray=tocList.split(',');jQuery.each(tocListArray,function(i,v){tocListArray[i]=$.trim(v);});var $elements=jQuery('.jquery-toc');jQuery('body').append('<div></div>');var $toc=jQuery('body div:last');var lastLevel=1;var anchorList=new Array();$toc.append('<ol class="jquery-toc-1"></ol>');$elements.each(function(){var $e=jQuery(this);var text=$e.text();var anchor=text;var z=0;$e.attr('name',anchor).attr('id',anchor).addClass('anchor');$e.not($('h5')).not($('h6')).not($('h4:first')).before('<a href="#mainContent" title="Subir" class="anchorTop">Subir</a>');var level;jQuery.each(tocListArray,function(i,v){if(v.match(' ')){var vArray=v.split(' ');var e=vArray[vArray.length-1];}else
e=v;if($e.is(e))
level=i+1;});var className='jquery-toc-'+level;var li='<li><a href="#'+anchor+'" title="Saltar a: '+text+'">'+text+'</a></li>';if(level==lastLevel){jQuery('ol.'+className+':last',$toc).append(li);}else{if(level>lastLevel){var parentLevel=level-1;var parentClassName='jquery-toc-'+parentLevel;jQuery('ol.'+parentClassName+':last',$toc).append('<ol class="'+className+'"></ol>');jQuery('ol.'+className+':last',$toc).append(li);}else{if(level<lastLevel)
jQuery('ol.'+className+':last',$toc).append(li);}}
lastLevel=level;});var $toc_ul=$('ol.jquery-toc-1',$toc);$toc.remove();return($toc_ul);}
if(jQuery('.post').children('h4').length>0){var controlTOC='<strong>Tabla de Contenidos</strong> '
+'['
+'<a id="mostrar_cont" title="Mostrar" class="pointer">Mostrar</a>'
+'<a id="ocultar_cont" title="Ocultar" class="pointer">Ocultar</a>'
+']';$.toc('.post h4,.post h5,.post h6').insertBefore('.post h4:first');$('ol.jquery-toc-1').wrap('<div id="toc_menu" class="toc_box"></div>');$('#toc_menu').prepend(controlTOC);$('#mostrar_cont').hide();$('#mostrar_cont').click(function(){$('ol.jquery-toc-1').show();$(this).hide();$('#ocultar_cont').show();});$('#ocultar_cont').click(function(){$('ol.jquery-toc-1').hide();$(this).hide();$('#mostrar_cont').show();});}}}
function imageHeaderPosts(elm){if(jQuery(elm).length>0){jQuery(elm).each(function(i){var errorMsg='No se puede crear un visor de imagen para '+elm+'.';var parentElm=jQuery(this);var objectElm=parentElm.children('object');if(true!==objectElm.length>0)
throw new Error(errorMsg+' No contiene un objeto a procesar.');var imgHeight,imgWidth,bckgImg,bckgColor,bckgPos,bckgBorder,borderRadius;var defImgWidth='100%';var defImgHeight='200px';var defBckgImg='';var defBckgColor='#333';var defBckgPos='0% 20%';var defBckgBorder='none';var defBorderRadius='0';imgWidth=objectElm.attr('width');imgHeight=objectElm.attr('height');bckgImg=objectElm.attr('data');bckgColor=objectElm.children('param[name=background-color]').attr('value');bckgPos=objectElm.children('param[name=background-position]').attr('value');bckgBorder=objectElm.children('param[name=background-border]').attr('value');borderRadius=objectElm.children('param[name=border-radius]').attr('value');if('undefined'===typeof(imgWidth))
imgWidth=defImgWidth;if('undefined'===typeof(imgHeight))
imgHeight=defImgHeight;if('undefined'===typeof(bckgImg))
bckgImg=defBckgImg;if('undefined'===typeof(bckgColor))
bckgColor=defBckgColor;if('undefined'===typeof(bckgPos))
bckgPos=defBckgPos;if('undefined'===typeof(bckgBorder))
bckgBorder=defBckgBorder;if('undefined'===typeof(borderRadius))
borderRadius=defBorderRadius;parentElm.css({'width':imgWidth,'height':imgHeight,'background-color':bckgColor,'background-image':'url('+bckgImg+')','background-position':bckgPos,'background-repeat':'no-repeat','border':bckgBorder,'border-radius':borderRadius,'-moz-border-radius':borderRadius,});objectElm.remove();});}}
function hlAnchors(){jQuery(".post a[href^='#']").each(function(){var currentHref=jQuery(this).attr("href");jQuery(this).click(function(){var targetElm=jQuery(currentHref);var targetTagName=targetElm.tagName();if('img'!==targetTagName)
cmsFade(targetElm);else{var currentOpacity=targetElm.css('opacity');var resetOpacity=('undefined'!==currentOpacity)?currentOpacity:'1';var currentBorder=targetElm.css('border');var resetBorder=('undefined'!==currentBorder)?currentBorder:'none';targetElm.css({'opacity':'1','border':'2px solid yellow'}).fadeOut('slow').fadeIn(2000,function(){jQuery(this).css({'opacity':resetOpacity,'border':resetBorder});});}});});}
function parseContent(){jQuery(".post *").each(function(){var $this=jQuery(this);var title='';if($this.tagName()=='ins'){var insDatetime=$this.attr('datetime');if(insDatetime){var myDate=new Date(insDatetime.replace('T',' ').split('+')[0]);if(!jQuery.browser.mozilla)
$this.attr('title',myDate.toLocaleString()+' @ '+myDate.toLocaleTimeString());}}
var thisXmlLang=$this.attr("xml:lang");var thisLang=$this.attr("lang");var thisHref=$this.attr("href");if(!thisHref){if(!thisXmlLang&&''!=thisLang){$this.attr('xml:lang',thisLang);}
else if(!thisLang&&''!=thisXmlLang){$this.attr('lang',thisXmlLang);}}else{if($this.attr("hreflang")=='en')
$this.attr("title",this.title+' (recurso enlazado, en inglés)');}
if(thisXmlLang=='en'||thisLang=='en'){$this.attr("title",this.title+' (en inglés)');$this.append('<sup class="xx-small monospace">{en}</sup>');if(!thisHref)
$this.addClass('cursor_help');}});}
function main(){parseContent();hlAnchors();renderTocBox();cebraAndTablesorter();initFancyBox();initTabs();initDialog();newsTickerInit('newsticker');recentCommentsTicker();imageHeaderPosts('div.headerImg');jQuery('cite.fn').addClass('author');}
main();}catch(e){var errorMsg='Error desconocido';errorMsg=('object'===typeof(e))?e.message+' - Excepción Javascript tipo «'+e.name+'» capturada en '+e.fileName+' - línea '+e.lineNumber+'.':'JavaScript Error: '+errorMsg;if('function'===typeof(handleErrors))
handleErrors(errorMsg);else
alert(errorMsg);}});}catch(e){if('object'===typeof(e))
alert(e.message+' - Excepción Javascript tipo «'+e.name+'» capturada en '+e.fileName+' - línea '+e.lineNumber+'.');else
alert('Error javascript no especificado.');}