var addthis_config={ui_click:true,ui_language:"ca"}
var addthis_options='facebook, twitter, linkedin, email';window.addEvent('domready',function(){if($("pprivacidad")){$("pprivacidad").set('html',$("privacidad").value);}
if($("pobligatorios")){$("pobligatorios").set('html',$("obligatorios").value);}});window.addEvent('load',function(){$$("div.banner_fila img").each(function(el){var coords=$(el).getSize();new Element("div",{}).setStyles({'z-index':1,'left':0,'top':0,'width':coords.x,'height':coords.y}).addClass('capa_negre').inject($(el).getParent(),'bottom');el.setStyles({'z-index':9,'position':'relative'});el.addEvent('mouseenter',function(){if(this.efecto==undefined){this.efecto=new Fx.Morph($(this),{transition:'quart:out'});}
$(this).efecto.cancel();$(this).efecto.start({'opacity':.7});});el.addEvent('mouseleave',function(){if(this.efecto==undefined){this.efecto=new Fx.Morph($(this),{transition:'quart:out'});}
$(this).efecto.cancel();$(this).efecto.start({'opacity':1});});});if($("index-campanyas")){$$("ul#menu_central_contenido img").each(function(el){var coords=$(el).getSize();el.addEvent('mouseenter',function(){if(this.efecto==undefined){this.efecto=new Fx.Morph($(this),{transition:'quart:out'});}
$(this).efecto.cancel();$(this).efecto.start({'opacity':.7});});el.addEvent('mouseleave',function(){if(this.efecto==undefined){this.efecto=new Fx.Morph($(this),{transition:'quart:out'});}
$(this).efecto.cancel();$(this).efecto.start({'opacity':1});});});}
checkFoot();if($('galeria-video')){resizeRows($$('#listado_videos ul')[0],3);}});function checkFoot(){if($("pie")){if(window.getScrollSize().y==window.getSize().y){$("pie").setStyles({'position':'absolute','bottom':'0px','width':'100%'});}
window.addEvent('resize',function(){if(window.getScrollSize().y==window.getSize().y){$("pie").setStyles({'position':'absolute','bottom':'0px','width':'100%'});}else{$("pie").setStyles({'position':'relative','bottom':'0px','width':'100%'});}
if($("pagina").getCoordinates().bottom>$("pie").getCoordinates().top) {$("pie").setStyles({'position':'relative','bottom':'0px','width':'100%'});}});}}
window.addEvent('domready',function(){if(!hasPlaceholderSupport()){addPlaceHolders();}
$each($$('a'),function(item){if(item.get('rel')=='external')
item.set('target','_blank');});if($('index-festa')){$each($$('#contenido img'),function(item){if(item.getStyle('float')=='left'){item.setStyle('margin-right','15px');}else if(item.getStyle('float')=='right'){item.setStyle('margin-left','15px');}});}
$$('.con_submenu').addEvent('mouseenter',function(e){this.addClass('on');this.getChildren('ul').setStyles({'display':'block'});})
$$('.con_submenu').addEvent('mouseleave',function(e){this.removeClass('on');this.getChildren('ul').setStyle('display','none');})
$$('.con_submenu').addEvent('click',function(e){if(this.hasClass('on'))this.fireEvent('mouseleave');else this.fireEvent('mouseenter');})
if($('index-participa')){$each($$('.bloque_central_contenido'),function(item,i){if(i==0){new Element('img',{src:'http://www.festadelrenaixement.cat/img/participa_01_add.png','class':'imagen_soporte_01'}).inject(item);new Element('img',{src:'http://www.festadelrenaixement.cat/img/participa_02_add.png','class':'imagen_soporte_02'}).inject(item);new Element('img',{src:'http://www.festadelrenaixement.cat/img/participa_03_add.png','class':'imagen_soporte_03'}).inject(item);new Element('img',{src:'http://www.festadelrenaixement.cat/img/participa_04_add.png','class':'imagen_soporte_04'}).inject(item);new Element('img',{src:'http://www.festadelrenaixement.cat/img/participa_05_add.png','class':'imagen_soporte_05'}).inject(item);}else{new Element('img',{src:'http://www.festadelrenaixement.cat/img/participa_0'+i+'_soporte_add.png','class':'imagen_soporte'}).inject(item);}});}
$each($$('#listado_videos ul li a'),function(item){item.addEvent('click',function(e){e.stop();$('fecha_video').set('html','');$$('#video_destacado h3').set('html','');$('categoria_video').set('html','');$('texto_video').set('html','');$('video').set('html','<img src="http://www.festadelrenaixement.cat/img/loading.gif" alt="Carregant..." title="Carregant..." />');_rel=this.get('rel');var jsonRequest=new Request.JSON({url:"/galeria/video/ajax",onSuccess:function(result){if(result.ok){$('fecha_video').set('html',result.data.fecha);$$('#video_destacado h3').set('html',result.data.titulo);$('categoria_video').set('html',result.data.categoria);$('texto_video').set('html',result.data.texto);$('video').set('html',result.data.video);}}}).post({'id':_rel});});});if($$('a.highslide').length>0&&typeof(window['hs'])!='undefined'){hs.graphicsDir='http://www.festadelrenaixement.cat/js/common/highslide/graphics/';hs.align='center';hs.transitions=['expand','crossfade'];hs.outlineType='rounded-white';hs.fadeInOut=true;hs.dimmingOpacity=0.75;hs.showCredits=false;hs.cacheAjax=false;hs.dimmingGeckoFix=true;hs.allowSizeReduction=true;hs.addSlideshow({slideshowGroup:'group1',interval:5000,repeat:false,useControls:true,fixedControls:'fit',overlayOptions:{opacity:.75,position:'bottom center',hideOnMouseOut:true}});}
hs.registerOverlay({html:'<div class="closebutton" onclick="return hs.close(this)" title="Cerrar"></div>',position:'top right',useOnHtml:true,fade:2});});var config1={slideshowGroup:'group1',transitions:['expand','crossfade']};var config2={objectType:'iframe',width:320,height:237,outlineType:'custom',dimmingOpacity:0.5};function addPlaceHolders(){$each($$('.hasPlaceHolder'),function(item){if(item.value==''){item.value=item.get('placeholder');item.addClass('placeholding');}
item.addEvents({focus:function(){if(item.value==item.get('placeholder')){item.value='';item.removeClass('placeholding');}},blur:function(){if(item.value==''){item.value=item.get('placeholder');item.addClass('placeholding');}}});});}
function removePlaceHolders(){$each($$('.hasPlaceHolder'),function(item){if(item.value==item.get('placeholder'))item.value='';});}
function hasPlaceholderSupport(){var input=new Element('input');return('placeholder'in input);}
function resizeRows(ul,rowSize){if(ul){var count=1;var maxHeight=0;var arrElements=new Array();ul.getElements('li').each(function(element){if($(element).getStyle("height").toInt()>maxHeight)maxHeight=$(element).getStyle("height").toInt();arrElements.push(element);if(count++==rowSize){for(var ii=0;ii<arrElements.length;ii++){$(arrElements[ii]).setStyle("height",maxHeight);}
arrElements=new Array();maxHeight=0;count=1;}});for(var ii=0;ii<arrElements.length;ii++){$(arrElements[ii]).setStyle("height",maxHeight);}}}
