$(document).ready(function(e){if(DEBUG){prepareDebugPanel()}});function prepareDebugPanel(){var style=document.createElement("link");style.setAttribute("type","text/css");style.setAttribute("media","screen");style.setAttribute("rel","stylesheet");style.setAttribute("href","css/?debug.css");document.getElementsByTagName("head")[0].appendChild(style);$("body").bind("dblclick",function(e){$("#DEBUG").pause(500).slideToggle(200);e.preventDefault()})}$(document).ready(function(){var style=document.createElement("link");style.setAttribute("type","text/css");style.setAttribute("media","screen");style.setAttribute("rel","stylesheet");style.setAttribute("href","css/?thickBox.css");document.getElementsByTagName("head")[0].appendChild(style)});$(document).ready(fixFloatedElementsAligning);function fixFloatedElementsAligning(){var els=$("div.right");for(var i=0;i<els.length;i++){var pW=els[i].getElementsByTagName("p")[0].offsetWidth;var imgW=els[i].getElementsByTagName("img")[0].getAttribute("width");var padding=($.browser.msie)?0:15;if(imgW!==null){els[i].getElementsByTagName("h4")[0].style.width=pW-imgW-padding+"px"}}}function initTips(){if($.browser.msie){return}var style=document.createElement("link");style.setAttribute("type","text/css");style.setAttribute("media","screen");style.setAttribute("rel","stylesheet");style.setAttribute("href","css/?tooltips.css");document.getElementsByTagName("head")[0].appendChild(style);$.extend($.fn.Tooltip.defaults,{track:false,delay:0});$('input, img, label, abbr, acronym').Tooltip({showURL:false,showBody:" - "});$('a').Tooltip({showURL:true,showBody:null})}$(document).ready(initGallery);function initGallery(){if(location.href.indexOf("/galeria_imagenes/")==-1){return}var divDetalle=document.createElement("div");divDetalle.setAttribute("id","detalle");$("ul#galeria").after(divDetalle);var divImgContainer=document.createElement("div");divImgContainer.setAttribute("id","imgContainer");$("div#detalle").append(divImgContainer);var imgAmpliar=document.createElement("img");imgAmpliar.setAttribute("id","ampliar");imgAmpliar.setAttribute("src","img/ampliar.gif");$("div#imgContainer").append(imgAmpliar);$("img#ampliar").hide();$("div#imgContainer").hover(function(){$("img#ampliar").fadeTo("slow",0.8)},function(){$("img#ampliar").fadeTo("slow",0)});showImage($("ul#galeria li:first-child a").href(),$("ul#galeria li:first-child a").title(),$("ul#galeria li:first-child p.extendedInfo").text());$("ul#galeria li a").bind("click",function(e){var node=this;$("div#detalle h4").fadeOut(800,function(){$("div#detalle h4").remove()});$("div#detalle p").fadeOut(800,function(){$("div#detalle p").remove()});$("div#imgContainer a").fadeOut(800,function(){$("div#imgContainer a").remove();showImage(node.getAttribute("href"),node.getAttribute("title"),node.parentNode.getElementsByTagName("p")[1].firstChild.nodeValue)});e.preventDefault()})}function showImage(path,titol,desc){$("div#imgContainer").append("<a href='"+path+"' class='thickbox' title='"+desc+"'><img src='"+path+"' alt='"+titol+"' /></a>");$("div#detalle").append("<h4>// "+titol+"</h4>");$("div#detalle").append("<p id='imgDescription'>"+desc+"</p>");$("div#detalle h4, div#detalle p, div#imgContainer a").hide().fadeIn(1000);TB_init()}$(document).ready(initMenuDespatx);function initMenuDespatx(){$("dl#menu_despacho dt").bind("mouseover",function(){$(this).addClass("hover");var nextNode=this.nextSibling;while(nextNode.nodeType!=1){nextNode=nextNode.nextSibling}if(nextNode!=null){$(nextNode).addClass("hover")}});$("dl#menu_despacho dt").bind("mouseout",function(){$(this).removeClass("hover");var nextNode=this.nextSibling;while(nextNode.nodeType!=1){nextNode=nextNode.nextSibling}if(nextNode!=null){$(nextNode).removeClass("hover")}});$("dl#menu_despacho dd").bind("mouseover",function(){$(this).addClass("hover");var prevNode=this.previousSibling;while(prevNode.nodeType!=1){prevNode=prevNode.previousSibling}if(prevNode!=null){$(prevNode).addClass("hover")}});$("dl#menu_despacho dd").bind("mouseout",function(){$(this).removeClass("hover");var prevNode=this.previousSibling;while(prevNode.nodeType!=1){prevNode=prevNode.previousSibling}if(prevNode!=null){$(prevNode).removeClass("hover")}})}$(document).ready(fixDespachoMenuHeight);function fixDespachoMenuHeight(){var els=$("dl#menu_despacho dt");if(els.length>0){var newH=(els.length*els[0].offsetHeight)+"px";$("dl#menu_despacho").height(newH)}}$(document).ready(function(){if($.browser.msie){$("dl#menu_despacho dt a").each(function(i){$(this).prepend("//"+(i+1)+"&nbsp;&nbsp;")})}else{return}});$(document).ready(initAjaxMenu);function initAjaxMenu(){$("#despacho_main").wrap("<div id ='contentWrapper'></div>");$("dl#menu_despacho a").bind("click",function(e){var newUrl=$(this).href();$("#despacho_main").fadeOut(800,function(){$.get(newUrl,{"ajax":true,"whatever":Math.random()*1000},function(data){showNewContents(data)})});e.preventDefault()})}function showNewContents(data){$("#despacho_main").html(data);$("#despacho_main").fadeIn(800,TB_init)}$(document).ready(initializeMp3Links);function initializeMp3Links(){$('a[@href$="mp3"]').bind("click",function(e){$(this).flash({src:'media/flash/mp3player.swf',height:20,width:355},{version:7},function(htmlOptions){$this=$(this);htmlOptions.flashvars.file=$this.attr('href');$("embed").remove();$this.parent().parent().append($.fn.flash.transform(htmlOptions))});e.preventDefault()})}$(document).ready(initFlashRutes);var flashRutes;function initFlashRutes(){if(document.getElementById("rutas")){var fo=new SWFObject("media/flash/las_rutas_de_gabriel_miro.swf","fRutes","375","530","8.0.15","#ffffff",true);fo.addParam("allowScriptAccess","always");fo.addParam("wmode","transparent");fo.write("rutas");flashRutes=document.getElementById("fRutes")}}function launchImage(imgPath,t){TB_show(t,imgPath,false)}function initMenuFlashRutes(){$("#fl1").bind("click",function(){goRuta(1);return false});$("#fl2").bind("click",function(){goRuta(2);return false})}function goRuta(nRuta){if(flashRutes){switch(nRuta){case 1:flashRutes.goRuta1();break;case 2:flashRutes.goRuta2();break}}}function buildMenuRutes(){$("#contents_title").after("<ul id='menuSeccion' class='noFloat'></ul>");$("#menuSeccion").append("<li><a href='#' id='fl1' title='La ruta de la Marina'>LA MARINA</a></li>");$("#menuSeccion").append("<li><a href='#' id='fl2' title='La ruta de la Vega Baja'>LA VEGA BAJA</a></li>");$("#menuSeccion li").hide().fadeIn(800);initMenuFlashRutes()}$(document).ready(function(){$("#backBtn").bind("click",function(e){history.back();e.preventDefault()})});$(document).ready(function(){$("#menu_secundario a").bind('click',function(){window.open($(this).attr('href'),'_blank');return false});$("#accesoRevista a").bind('click',function(){window.open($(this).attr('href'),'_blank');return false})});