var Drupal=Drupal||{settings:{},behaviors:{},themes:{},locale:{}};Drupal.jsEnabled=document.getElementsByTagName&&document.createElement&&document.createTextNode&&document.documentElement&&document.getElementById;Drupal.attachBehaviors=function(context){context=context||document;if(Drupal.jsEnabled)jQuery.each(Drupal.behaviors,function(){this(context)})};Drupal.checkPlain=function(str){str=String(str);var replace={'&':'&amp;','"':'&quot;','<':'&lt;','>':'&gt;'};for(var character in replace){var regex=new RegExp(character,'g');str=str.replace(regex,replace[character])};return str};Drupal.t=function(str,args){if(Drupal.locale.strings&&Drupal.locale.strings[str])str=Drupal.locale.strings[str];if(args)for(var key in args){switch(key.charAt(0)){case'@':args[key]=Drupal.checkPlain(args[key]);break;case'!':break;case'%':default:args[key]=Drupal.theme('placeholder',args[key]);break};str=str.replace(key,args[key])};return str};Drupal.formatPlural=function(count,singular,plural,args){var args=args||{};args['@count']=count;var index=Drupal.locale.pluralFormula?Drupal.locale.pluralFormula(args['@count']):((args['@count']==1)?0:1);if(index==0){return Drupal.t(singular,args)}else if(index==1){return Drupal.t(plural,args)}else{args['@count['+index+']']=args['@count'];delete args['@count'];return Drupal.t(plural.replace('@count','@count['+index+']'))}};Drupal.theme=function(func){for(var i=1,args=[];i<arguments.length;i++)args.push(arguments[i]);return(Drupal.theme[func]||Drupal.theme.prototype[func]).apply(this,args)};Drupal.parseJson=function(data){if((data.substring(0,1)!='{')&&(data.substring(0,1)!='['))return{status:0,data:data.length?data:Drupal.t('Unspecified error')};return eval('('+data+');')};Drupal.freezeHeight=function(){Drupal.unfreezeHeight();var div=document.createElement('div');$(div).css({position:'absolute',top:'0px',left:'0px',width:'1px',height:$('body').css('height')}).attr('id','freeze-height');$('body').append(div)};Drupal.unfreezeHeight=function(){$('#freeze-height').remove()};Drupal.encodeURIComponent=function(item,uri){uri=uri||location.href;item=encodeURIComponent(item).replace(/%2F/g,'/');return(uri.indexOf('?q=')!=-1)?item:item.replace(/%26/g,'%2526').replace(/%23/g,'%2523').replace(/\/\//g,'/%252F')};Drupal.getSelection=function(element){if(typeof (element.selectionStart)!='number'&&document.selection){var range1=document.selection.createRange(),range2=range1.duplicate();range2.moveToElementText(element);range2.setEndPoint('EndToEnd',range1);var start=range2.text.length-range1.text.length,end=start+range1.text.length;return{start:start,end:end}};return{start:element.selectionStart,end:element.selectionEnd}};Drupal.ahahError=function(xmlhttp,uri){if(xmlhttp.status==200){if(jQuery.trim($(xmlhttp.responseText).text())){var message=Drupal.t("An error occurred. \n@uri\n@text",{'@uri':uri,'@text':xmlhttp.responseText})}else var message=Drupal.t("An error occurred. \n@uri\n(no information available).",{'@uri':uri,'@text':xmlhttp.responseText})}else var message=Drupal.t("An HTTP error @status occurred. \n@uri",{'@uri':uri,'@status':xmlhttp.status});return message};if(Drupal.jsEnabled){$(document.documentElement).addClass('js');document.cookie='has_js=1; path=/';$(document).ready(function(){Drupal.attachBehaviors(this)})};Drupal.theme.prototype={placeholder:function(str){return'<em>'+Drupal.checkPlain(str)+'</em>'}};
Drupal.locale={pluralFormula:function($n){return Number(($n!=1))},strings:{Published:"Publicado","Not published":"No publicado","Promoted to front page":"Promocionado a la página principal","1 attachment":"1 adjunto",None:"Ninguno",Edit:"Editar",Anonymous:"Sin identificar","Automatic alias":"Alias automático de ruta"}};
Drupal.behaviors.block_edit=function(context){if(Drupal.settings.block_edit.hover_links){$('.node-edit-link, .block-edit-link').hide();$('div.block, div.node').mouseover(function(){$(this).find('.node-edit-link, .block-edit-link').css('display','block')});$('div.block, div.node').mouseout(function(){$(this).find('.node-edit-link, .block-edit-link').css('display','none')})}};
$(document).ready(function(){$(document.body).click(function(event){$(event.target).parents("a:first,area:first").andSelf().filter("a,area").each(function(){var ga=Drupal.settings.googleanalytics,isInternal=new RegExp("^(https?):\/\/"+window.location.host,"i"),isInternalSpecial=new RegExp("(\/go\/.*)$","i"),isDownload=new RegExp("\\.("+ga.trackDownloadExtensions+")$","i");if(isInternal.test(this.href)){if(ga.trackDownload&&isDownload.test(this.href)){var extension=isDownload.exec(this.href);_gaq.push(["_trackEvent","Downloads",extension[1].toUpperCase(),this.href.replace(isInternal,'')])}else if(isInternalSpecial.test(this.href))_gaq.push(["_trackPageview",this.href.replace(isInternal,'')])}else if(ga.trackMailto&&$(this).is("a[href^=mailto:],area[href^=mailto:]")){_gaq.push(["_trackEvent","Mails","Click",this.href.substring(7)])}else if(ga.trackOutgoing&&this.href)if(ga.trackOutboundAsPageview){_gaq.push(["_trackPageview",'/outbound/'+this.href.replace(/^(https?|ftp|news|nntp|telnet|irc|ssh|sftp|webcal):\/\//i,'').split('/').join('--')])}else _gaq.push(["_trackEvent","Outbound links","Click",this.href])})})});
var currentMode
function onChangeBrowseBy(el){frames.img_assist_main.window.location.href=BASE_URL+'index.php?q=img_assist/thumbs/'+el.value}
function onClickUpload(){frames.img_assist_main.window.location.href=BASE_URL+'index.php?q=img_assist/upload'}
function onClickStartOver(){frames.img_assist_main.window.location.href=BASE_URL+'index.php?q=img_assist/thumbs/myimages'}
function updateCaption(){var caption=frames.img_assist_main.document.getElementById('caption'),title=frames.img_assist_main.document.img_assist['edit-title'].value,desc=frames.img_assist_main.document.img_assist['edit-desc'].value;if(desc!='')title=title+': ';caption.innerHTML='<strong>'+title+'</strong>'+desc}
function onChangeHeight(){var formObj=frames.img_assist_main.document.forms[0],aspect=formObj['edit-aspect'].value,height=formObj['edit-height'].value;formObj['edit-width'].value=Math.round(height*aspect)}
function onChangeWidth(){var formObj=frames.img_assist_main.document.forms[0],aspect=formObj['edit-aspect'].value,width=formObj['edit-width'].value;formObj['edit-height'].value=Math.round(width/aspect)}
function onChangeLink(){var formObj=frames.img_assist_main.document.forms[0];if(formObj['edit-link-options-visible'].value==1)if(formObj['edit-link'].value=='url'){showElement('edit-url','inline')}else hideElement('edit-url')}
function onChangeSizeLabel(){var formObj=frames.img_assist_main.document.forms[0];if(formObj['edit-size-label'].value=='other'){showElement('size-other','inline')}else{hideElement('size-other');var size=formObj['edit-size-label'].value.split('x'),aspect=formObj['edit-aspect'].value,width=size[0],height=size[1];if(Math.round(width/aspect)<=height){height=Math.round(width/aspect)}else width=Math.round(height*aspect);formObj['edit-width'].value=width;formObj['edit-height'].value=height}}
function setHeader(mode){if(currentMode!=mode)frames.img_assist_header.window.location.href=BASE_URL+'index.php?q=img_assist/header/'+mode;currentMode=mode}
function showElement(id,format){var docObj=frames.img_assist_main.document;format=(format)?format:'block';if(docObj.layers){docObj.layers[id].display=format}else if(docObj.all){docObj.all[id].style.display=format}else if(docObj.getElementById)docObj.getElementById(id).style.display=format}
function hideElement(id){var docObj=frames.img_assist_main.document;if(docObj.layers){docObj.layers[id].display='none'}else if(docObj.all){docObj.all[id].style.display='none'}else if(docObj.getElementById)docObj.getElementById(id).style.display='none'}
function launch_popup(nid,mw,mh){var ox=mw,oy=mh;if((ox>=screen.width)||(oy>=screen.height)){var ox=screen.width-150,oy=screen.height-150,winx=(screen.width/2)-(ox/2),winy=(screen.height/2)-(oy/2),use_scrollbars=1}else{var winx=(screen.width/2)-(ox/2),winy=(screen.height/2)-(oy/2),use_scrollbars=0};var win=window.open(BASE_URL+'index.php?q=img_assist/popup/'+nid,'imagev','height='+oy+'-10,width='+ox+',top='+winy+',left='+winx+',scrollbars='+use_scrollbars+',resizable')}
function insertImage(){if(window.opener){var formObj=frames.img_assist_main.document.forms[0];if(formObj['edit-insertmode'].value=='html'){return true}else if(formObj['edit-insertmode'].value=='html2'){var content=getHTML(formObj)}else var content=getFilterTag(formObj);insertToEditor(content);return false}else{alert('The image cannot be inserted because the parent window cannot be found.');return false}}
function getHTML(formObj){var html=frames.img_assist_main.document.getElementById('finalhtmlcode').value;return html};
(function($){$.fn.superfish=function(op){var sf=$.fn.superfish,c=sf.c,$arrow=$(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),over=function(){var $$=$(this),menu=getMenu($$);clearTimeout(menu.sfTimer);$$.showSuperfishUl().siblings().hideSuperfishUl()},out=function(){var $$=$(this),menu=getMenu($$),o=sf.op;clearTimeout(menu.sfTimer);menu.sfTimer=setTimeout(function(){o.retainPath=($.inArray($$[0],o.$path)>-1);$$.hideSuperfishUl();if(o.$path.length&&$$.parents(['li.',o.hoverClass].join('')).length<1)over.call(o.$path)},o.delay)},getMenu=function($menu){var menu=$menu.parents(['ul.',c.menuClass,':first'].join(''))[0];sf.op=sf.o[menu.serial];return menu},addArrow=function($a){$a.addClass(c.anchorClass).append($arrow.clone())};return this.each(function(){var s=this.serial=sf.o.length,o=$.extend({},sf.defaults,op);o.$path=$('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){$(this).addClass([o.hoverClass,c.bcClass].join(' ')).filter('li:has(ul)').removeClass(o.pathClass)});sf.o[s]=sf.op=o;$('li:has(ul)',this)[($.fn.hoverIntent&&!o.disableHI)?'hoverIntent':'hover'](over,out).each(function(){if(o.autoArrows)addArrow($('>a:first-child',this))}).not('.'+c.bcClass).hideSuperfishUl();var $a=$('a',this);$a.each(function(i){var $li=$a.eq(i).parents('li');$a.eq(i).focus(function(){over.call($li)}).blur(function(){out.call($li)})});o.onInit.call(this)}).each(function(){var menuClasses=[c.menuClass];if(sf.op.dropShadows&&!($.browser.msie&&$.browser.version<7))menuClasses.push(c.shadowClass);$(this).addClass(menuClasses.join(' '))})};var sf=$.fn.superfish;sf.o=[];sf.op={};sf.IE7fix=function(){var o=sf.op;if($.browser.msie&&$.browser.version>6&&o.dropShadows&&o.animation.opacity!=undefined)this.toggleClass(sf.c.shadowClass+'-off')};sf.c={bcClass:'sf-breadcrumb',menuClass:'sf-js-enabled',anchorClass:'sf-with-ul',arrowClass:'sf-sub-indicator',shadowClass:'sf-shadow'};sf.defaults={hoverClass:'sfHover',pathClass:'overideThisToUse',pathLevels:1,delay:800,animation:{opacity:'show'},speed:'normal',autoArrows:true,dropShadows:true,disableHI:false,onInit:function(){},onBeforeShow:function(){},onShow:function(){},onHide:function(){}};$.fn.extend({hideSuperfishUl:function(){var o=sf.op,not=(o.retainPath===true)?o.$path:'';o.retainPath=false;var $ul=$(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass).find('>ul').hide().css('visibility','hidden');o.onHide.call($ul);return this},showSuperfishUl:function(){var o=sf.op,sh=sf.c.shadowClass+'-off',$ul=this.addClass(o.hoverClass).find('>ul:hidden').css('visibility','visible');sf.IE7fix.call($ul);o.onBeforeShow.call($ul);$ul.animate(o.animation,o.speed,function(){sf.IE7fix.call($ul);o.onShow.call($ul)});return this}})})(jQuery);
(function($){$.fn.bgIframe=$.fn.bgiframe=function(s){if($.browser.msie&&parseInt($.browser.version)<=6){s=$.extend({top:'auto',left:'auto',width:'auto',height:'auto',opacity:true,src:'javascript:false;'},s||{});var prop=function(n){return n&&n.constructor==Number?n+'px':n},html='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+s.src+'"style="display:block;position:absolute;z-index:-1;'+(s.opacity!==false?'filter:Alpha(Opacity=\'0\');':'')+'top:'+(s.top=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+\'px\')':prop(s.top))+';left:'+(s.left=='auto'?'expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+\'px\')':prop(s.left))+';width:'+(s.width=='auto'?'expression(this.parentNode.offsetWidth+\'px\')':prop(s.width))+';height:'+(s.height=='auto'?'expression(this.parentNode.offsetHeight+\'px\')':prop(s.height))+';"/>';return this.each(function(){if($('> iframe.bgiframe',this).length==0)this.insertBefore(document.createElement(html),this.firstChild)})};return this};if(!$.browser.version)$.browser.version=navigator.userAgent.toLowerCase().match(/.+(?:rv|it|ra|ie)[\/: ]([\d.]+)/)[1]})(jQuery);
(function($){$.fn.hoverIntent=function(f,g){var cfg={sensitivity:7,interval:100,timeout:0};cfg=$.extend(cfg,g?{over:f,out:g}:f);var cX,cY,pX,pY,track=function(ev){cX=ev.pageX;cY=ev.pageY},compare=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if((Math.abs(pX-cX)+Math.abs(pY-cY))<cfg.sensitivity){$(ob).unbind("mousemove",track);ob.hoverIntent_s=1;return cfg.over.apply(ob,[ev])}else{pX=cX;pY=cY;ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}},delay=function(ev,ob){ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);ob.hoverIntent_s=0;return cfg.out.apply(ob,[ev])},handleHover=function(e){var p=(e.type=="mouseover"?e.fromElement:e.toElement)||e.relatedTarget;while(p&&p!=this)try{p=p.parentNode}catch(e){p=this};if(p==this)return false;var ev=jQuery.extend({},e),ob=this;if(ob.hoverIntent_t)ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(e.type=="mouseover"){pX=ev.pageX;pY=ev.pageY;$(ob).bind("mousemove",track);if(ob.hoverIntent_s!=1)ob.hoverIntent_t=setTimeout(function(){compare(ev,ob)},cfg.interval)}else{$(ob).unbind("mousemove",track);if(ob.hoverIntent_s==1)ob.hoverIntent_t=setTimeout(function(){delay(ev,ob)},cfg.timeout)}};return this.mouseover(handleHover).mouseout(handleHover)}})(jQuery);
(function($){$(document).ready(function(){$('ul.nice-menu').superfish({hoverClass:'over',autoArrows:false,dropShadows:false,delay:Drupal.settings.nice_menus_options.delay,speed:Drupal.settings.nice_menus_options.speed}).find('ul').bgIframe({opacity:false});$('ul.nice-menu ul').css('display','none')})})(jQuery);
Drupal.behaviors.og_content_type=function(){$('input[name="og_content_type_usage"]').click(function(){if(!$('#edit-og-content-type-usage-group-post-standard').attr('checked')){$('#edit-og-max-groups').attr('disabled','disabled')}else $('#edit-og-max-groups').removeAttr('disabled')});if(!$('#edit-og-content-type-usage-group-post-standard').attr('checked'))$('#edit-og-max-groups').attr('disabled','disabled')};Drupal.verticalTabs=Drupal.verticalTabs||{};Drupal.verticalTabs.og_nodeapi=function(){var values=[];$('.vertical-tabs-og_nodeapi #edit-og-groups :selected').each(function(i,selected){values[i]=$(selected).text()});return values.join(', ')};Drupal.verticalTabs.og=function(){var type=$('.vertical-tabs-og input[type=radio]:checked').val();switch(type){case'group':return Drupal.t('Group node');break;case'omitted':return Drupal.t('May not be posted into a group.');break;case'group_post_standard':return Drupal.t('Standard group post');break;case'group_post_wiki':return Drupal.t('Wiki group post');break}};
Drupal.behaviors.hide_submit=function(context){function hide_submit_button(obj,message,context){$(obj,context).hide().siblings('input:submit').hide().end().after(message)}
function disable_submit_button(obj,context){var $obj=$(obj,context);$("#edit-hide-submit-fake-op",context).attr("name","op").attr("value",$obj.attr("value"));$obj.attr("disabled","disabled").siblings('input:submit').attr("disabled","disabled").parents("form").submit()};var settings=Drupal.settings.hide_submit;if(settings.dbg){$('input:submit',context).css({border:'6px red solid'});$(settings.selector,context).css({border:'6px green solid'})};if(settings.mode=='hide'){if(settings.image)$("<img>").attr("src",settings.image);$(settings.selector,context).click(function(){hide_submit_button(this,settings.message,context)});if(settings.keypress)$(settings.selector,context).keypress(function(){$(this).parents("form").submit();hide_submit_button(this,settings.message,context)})}else{$(settings.selector,context).click(function(){disable_submit_button(this,context)});if(settings.keypress)$(settings.selector,context).keypress(function(){disable_submit_button(this,context)})}};
(function($){Drupal.Panels={};Drupal.Panels.autoAttach=function(){if($.browser.msie){$("div.panel-pane").hover(function(){$('div.panel-hide',this).addClass("panel-hide-hover");return true},function(){$('div.panel-hide',this).removeClass("panel-hide-hover");return true});$("div.admin-links").hover(function(){$(this).addClass("admin-links-hover");return true},function(){$(this).removeClass("admin-links-hover");return true})}};$(Drupal.Panels.autoAttach)})(jQuery);
function populateElement(selector,defvalue){if($.trim($(selector).val())=="")$(selector).val(defvalue);$(selector).focus(function(){if($(selector).val()==defvalue)$(selector).val("")});$(selector).blur(function(){if($.trim($(selector).val())=="")$(selector).val(defvalue)})};$(document).ready(function(){populateElement('#search-box input.form-text, #search-block-form input.form-text','escribir...')});

