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>'}};
(function($){Drupal.AjaxLoad=Drupal.AjaxLoad||{externalStyles:[],externalScripts:[],loadPending:[]};Drupal.AjaxLoad.loadFiles=function(target,response){if(!Drupal.AjaxLoad.externalStyles.length)if(Drupal.settings.AjaxLoad&&Drupal.settings.AjaxLoad['css']){$.each(Drupal.settings.AjaxLoad['css'],function(i,path){Drupal.AjaxLoad.externalStyles.push(path)})}else $('link[type="text/css"]').each(function(){Drupal.AjaxLoad.externalStyles.push($(this).attr('href'))});if(!Drupal.AjaxLoad.externalScripts.length)if(Drupal.settings.AjaxLoad&&Drupal.settings.AjaxLoad['scripts']){$.each(Drupal.settings.AjaxLoad['scripts'],function(i,path){Drupal.AjaxLoad.externalScripts.push(path)})}else $('script[src]').each(function(){Drupal.AjaxLoad.externalScripts.push($(this).attr('src'))});if(response.scripts){var index=Drupal.AjaxLoad.loadPending.length;Drupal.AjaxLoad.loadPending[index]=0;if(!response.__customSettings&&response.scripts.setting)$.extend(true,Drupal.settings,response.scripts.setting);var types=['core','module','theme'];$.each(types,function(i,type){if(response.scripts[type])$.each(response.scripts[type],function(src,data){src=Drupal.settings.basePath+src;var found=false;for(var j=0;j<Drupal.AjaxLoad.externalScripts.length;j++)if(Drupal.AjaxLoad.externalScripts[j].indexOf(src)==0){found=true;break};if(!found){Drupal.AjaxLoad.loadPending[index]++;$.getScript(src,function(){Drupal.AjaxLoad.externalScripts.push(src);Drupal.AjaxLoad.loadComplete(index,target,response)})}})});if(Drupal.AjaxLoad.loadPending[index]==0){Drupal.attachBehaviors(target);Drupal.AjaxLoad.loadInline(response)}};if(response.css){var types=['module','theme'];$.each(response.css,function(media,files){$.each(types,function(i,type){if(files[type])$.each(files[type],function(src,data){src=Drupal.settings.basePath+src;var found=false;for(var j=0;j<Drupal.AjaxLoad.externalStyles.length;j++)if(Drupal.AjaxLoad.externalStyles[j].indexOf(src)==0){found=true;break};if(!found){Drupal.AjaxLoad.externalStyles.push(src);$('<link type="text/css" rel="stylesheet" media="'+media+'" href="'+src+'" />').appendTo('head')}})})})}};Drupal.AjaxLoad.loadInline=function(response){if(response.scripts.inline)$.each(response.scripts.inline,function(i,script){if(script.code.indexOf('document.write')==-1)eval(script.code)})};Drupal.AjaxLoad.loadComplete=function(index,target,response){Drupal.AjaxLoad.loadPending[index]--;if(Drupal.AjaxLoad.loadPending[index]==0){Drupal.attachBehaviors(target);Drupal.AjaxLoad.loadInline(response)}}})(jQuery);
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}};
Drupal.dhtmlMenu={};Drupal.behaviors.dhtmlMenu=function(){if(Drupal.dhtmlMenu.init){return}else Drupal.dhtmlMenu.init=true;var effects=Drupal.settings.dhtmlMenu;$('.collapsed').removeClass('expanded');if(!effects.siblings){var cookie=Drupal.dhtmlMenu.cookieGet();for(var i in cookie){var li=$('#dhtml_menu-'+cookie[i]).parents('li:first');if($(li).hasClass('collapsed'))Drupal.dhtmlMenu.toggleMenu(li)}};$('ul.menu li.dhtml-menu:not(.leaf,.no-dhtml)').each(function(){var li=this;if(effects.clone){var ul=$(li).find('ul:first');if(ul.length)$(li).find('a:first').clone().prependTo(ul).wrap('<li class="leaf fake-leaf"></li>')};if(effects.doubleclick)$(li).find('a:first').dblclick(function(e){window.location=this.href});$(li).find('a:first').click(function(e){Drupal.dhtmlMenu.toggleMenu($(li));return false})})};Drupal.dhtmlMenu.toggleMenu=function(li){var effects=Drupal.settings.dhtmlMenu;if($(li).hasClass('expanded')){if(effects.slide){$(li).find('ul:first').animate({height:'hide',opacity:'hide'},'1000')}else $(li).find('ul:first').css('display','none');if(effects.children){if(effects.slide){$(li).find('li.expanded').find('ul:first').animate({height:'hide',opacity:'hide'},'1000')}else $(li).find('li.expanded').find('ul:first').css('display','none');$(li).find('li.expanded').removeClass('expanded').addClass('collapsed')};$(li).removeClass('expanded').addClass('collapsed')}else{if(effects.slide){$(li).find('ul:first').animate({height:'show',opacity:'show'},'1000')}else $(li).find('ul:first').css('display','block');$(li).removeClass('collapsed').addClass('expanded');if(effects.siblings){var id=$(li).find('a:first').attr('id');$(li).find('li').addClass('own-children-temp');if(effects.relativity){var siblings=$(li).parent().find('li.expanded').not('.own-children-temp').not(':has(#'+id+')')}else var siblings=$('ul.menu li.expanded').not('.own-children-temp').not(':has(#'+id+')');if(!effects.children){$('li.collapsed li.expanded').addClass('sibling-children-temp');$(siblings).find('li.expanded').addClass('sibling-children-temp');siblings=$(siblings).not('.sibling-children-temp')};$('.own-children-temp, .sibling-children-temp').removeClass('own-children-temp').removeClass('sibling-children-temp');if(effects.slide){$(siblings).find('ul:first').animate({height:'hide',opacity:'hide'},'1000')}else $(siblings).find('ul:first').css('display','none');$(siblings).removeClass('expanded').addClass('collapsed')}};Drupal.dhtmlMenu.cookieSet()};Drupal.dhtmlMenu.cookieGet=function(){var c=/dhtml_menu=(.*?)(;|$)/.exec(document.cookie);if(c){return c[1]}else return''};Drupal.dhtmlMenu.cookieSet=function(){var expanded=new Array();$('li.expanded').each(function(){expanded.push($(this).find('a:first').attr('id').substr(5))});document.cookie='dhtml_menu='+expanded.join(',')+';path=/'};

