Drupal.preventSelect=function(elt){if(document.onselectstart){elt.onselectstart=function(){return false}}else $(elt).mousedown(function(){return false})};Drupal.url=function(path,query,fragment){query=query?query:'';fragment=fragment?'#'+fragment:'';var base=Drupal.settings.basePath;if(!Drupal.settings.jstools.cleanurls){if(query){return base+'?q='+path+'&'+query+fragment}else return base+'?q='+path+fragment}else if(query){return base+path+'?'+query+fragment}else return base+path+fragment};Drupal.getPath=function(href){href=Drupal.pathPortion(href);href=href.substring(Drupal.settings.basePath.length+(Drupal.settings.jstools.cleanurls?0:3),href.length);var chars=['#','?','&'];for(i in chars)if(href.indexOf(chars[i])>-1)href=href.substr(0,href.indexOf(chars[i]));return href};Drupal.prependPath=function(href,segment){href=Drupal.pathPortion(href);var baseLength=Drupal.settings.jstools.basePath.length+(Drupal.settings.jstools.cleanurls?0:3),base=href.substring(0,baseLength);return base+segment+'/'+href.substring(baseLength,href.length)};Drupal.pathPortion=function(href){var protocol=window.location.protocol;if(href.substring(0,protocol.length)==protocol)href=href.substring(href.indexOf('/',protocol.length+2));return href};Drupal.scrollTo=function(el){var pos=Drupal.absolutePosition(el);window.scrollTo(0,pos.y)};Drupal.elementChildren=function(element){var children=[];for(i in element)if(i.substr(0,1)!='#')children[children.length]=i;return children};Drupal.elementProperties=function(element){var properties=[];for(i in element)if(i.substr(0,1)=='#')properties[properties.length]=i;return properties};Drupal.parseQueryString=function(href){query=Drupal.getQueryString(href);var args={},pairs=query.split("&");for(var i=0;i<pairs.length;i++){var pos=pairs[i].indexOf('=');if(pos==-1)continue;var argname=pairs[i].substring(0,pos),value=pairs[i].substring(pos+1);args[argname]=unescape(value.replace(/\+/g," "))};return args};Drupal.getQueryString=function(href){if(href){var index=href.indexOf('?');href=(index==-1)?'':href.substring(index+1)};query=href?href:location.search.substring(1);if(!Drupal.settings.jstools.cleanurls){var index=query.indexOf('&');query=(index==-1)?'':query.substring(index+1)};return query};Drupal.pathMatch=function(path,paths,type){paths='^'+paths+'$';paths=paths.replace(/\n/g,'$|^');paths=paths.replace(/\*/g,'.*');var search=path.search(new RegExp(paths))>-1?true:false;return(type==0)?search:!search};Drupal.absolutePosition=function(el){var sLeft=0,sTop=0,isDiv=/^div$/i.test(el.tagName);if(isDiv&&el.scrollLeft)sLeft=el.scrollLeft;if(isDiv&&el.scrollTop)sTop=el.scrollTop;var r={x:el.offsetLeft-sLeft,y:el.offsetTop-sTop};if(el.offsetParent){var tmp=Drupal.absolutePosition(el.offsetParent);r.x+=tmp.x;r.y+=tmp.y};return r};Drupal.mousePosition=function(e){return{x:e.clientX+document.documentElement.scrollLeft,y:e.clientY+document.documentElement.scrollTop}};
Drupal.Collapsiblock=Drupal.Collapsiblock||{};Drupal.behaviors.collapsiblock=function(context){var cookieData=Drupal.Collapsiblock.getCookieData(),slidetype=Drupal.settings.collapsiblock.slide_type,defaultState=Drupal.settings.collapsiblock.default_state,slidespeed=parseInt(Drupal.settings.collapsiblock.slide_speed),title=Drupal.settings.collapsiblock.block_title,block=Drupal.settings.collapsiblock.block,block_content=Drupal.settings.collapsiblock.block_content;$(block+':not(.collapsiblock-processed)',context).addClass('collapsiblock-processed').each(function(){var id=this.id,titleElt=$(title,this).not($('.content :header',this));if(titleElt.size()){titleElt=titleElt[0];var stat=Drupal.settings.collapsiblock.blocks[this.id]?Drupal.settings.collapsiblock.blocks[this.id]:defaultState;if(stat==1)return;titleElt.target=$(this).find(block_content);$(titleElt).wrapInner('<a href="#" role="link" />').addClass('collapsiblock').click(function(e){var st=Drupal.Collapsiblock.getCookieData();if($(this).is('.collapsiblockCollapsed')){$(this).removeClass('collapsiblockCollapsed');if(slidetype==1){$(this.target).slideDown(slidespeed).attr('aria-hidden',false)}else $(this.target).animate({height:'show',opacity:'show'},slidespeed);if(stat!=4)st[id]=1}else{$(this).addClass('collapsiblockCollapsed');if(slidetype==1){$(this.target).slideUp(slidespeed).attr('aria-hidden',true)}else $(this.target).animate({height:'hide',opacity:'hide'},slidespeed);if(stat!=4)st[id]=0};var cookieString='{ ',cookieParts=[];$.each(st,function(id,setting){cookieParts[cookieParts.length]=' "'+id+'": '+setting});cookieString+=cookieParts.join(', ')+' }';$.cookie('collapsiblock',cookieString,{path:Drupal.settings.basePath});e.preventDefault()});if(stat==4||(cookieData[id]==0||(stat==3&&cookieData[id]==undefined))&&!$(this).find('a.active').size()){$(titleElt).addClass('collapsiblockCollapsed');$(titleElt.target).hide()}}})};Drupal.Collapsiblock.getCookieData=function(){var cookieString=$.cookie('collapsiblock');return cookieString?Drupal.parseJson(cookieString):{}};
jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1};var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1e3))}else date=options.expires;expires='; expires='+date.toUTCString()};var path=options.path?'; path='+(options.path):'',domain=options.domain?'; domain='+(options.domain):'',secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('')}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break}}};return cookieValue}};
$(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])})})});
Drupal.behaviors.jquerymenu=function(context){jqm_showit=function(){$(this).children('.jqm_link_edit').fadeIn()};jqm_hideit=function(){$(this).children('.jqm_link_edit').fadeOut()};$('ul.jquerymenu li').hover(jqm_showit,jqm_hideit);$('ul.jquerymenu:not(.jquerymenu-processed)',context).addClass('jquerymenu-processed').each(function(){$(this).find("li.parent span.parent").click(function(){momma=$(this).parent();if($(momma).hasClass('closed')){$($(this).siblings('ul').children()).hide().fadeIn('3000');$(momma).children('ul').slideDown('700');$(momma).removeClass('closed').addClass('open');$(this).removeClass('closed').addClass('open')}else{$(momma).children('ul').slideUp('700');$($(this).siblings('ul').children()).fadeOut('3000');$(momma).removeClass('open').addClass('closed');$(this).removeClass('open').addClass('closed')}})})};

