(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 ev=jQuery.extend({},e),ob=this;if(ob.hoverIntent_t)ob.hoverIntent_t=clearTimeout(ob.hoverIntent_t);if(e.type=="mouseenter"){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.bind('mouseenter',handleHover).bind('mouseleave',handleHover)}})(jQuery);
(function(a){a.fn.bgiframe=(a.browser.msie&&/msie 6\.0/i.test(navigator.userAgent)?function(d){d=a.extend({top:"auto",left:"auto",width:"auto",height:"auto",opacity:true,src:"javascript:false;"},d);var c='<iframe class="bgiframe"frameborder="0"tabindex="-1"src="'+d.src+'"style="display:block;position:absolute;z-index:-1;'+(d.opacity!==false?"filter:Alpha(Opacity='0');":"")+"top:"+(d.top=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderTopWidth)||0)*-1)+'px')":b(d.top))+";left:"+(d.left=="auto"?"expression(((parseInt(this.parentNode.currentStyle.borderLeftWidth)||0)*-1)+'px')":b(d.left))+";width:"+(d.width=="auto"?"expression(this.parentNode.offsetWidth+'px')":b(d.width))+";height:"+(d.height=="auto"?"expression(this.parentNode.offsetHeight+'px')":b(d.height))+';"/>';return this.each(function(){if(a(this).children("iframe.bgiframe").length===0)this.insertBefore(document.createElement(c),this.firstChild)})}:function(){return this});a.fn.bgIframe=a.fn.bgiframe
function b(c){return c&&c.constructor===Number?c+"px":c}})(jQuery);
(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:'1',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.supersubs=function(options){var opts=$.extend({},$.fn.supersubs.defaults,options);return this.each(function(){var $$=$(this),o=$.meta?$.extend({},opts,$$.data()):opts,fontsize=$('<li id="menu-fontsize">&#8212;</li>').css({padding:0,position:'absolute',top:'-99999em',width:'auto'}).appendTo($$).width();$('#menu-fontsize').remove();if($$.hasClass('sf-navbar'))$$=$('li > ul',$$);$ULs=$$.find('ul:not(.sf-megamenu)');$ULs.each(function(i){var $ul=$ULs.eq(i),$LIs=$ul.children(),$As=$LIs.children('a'),liFloat=$LIs.css('white-space','nowrap').css('float'),emWidth=$ul.add($LIs).add($As).css({'float':'none',width:'auto'}).end().end()[0].clientWidth/fontsize;emWidth+=o.extraWidth;if(emWidth>o.maxWidth){emWidth=o.maxWidth}else if(emWidth<o.minWidth)emWidth=o.minWidth;emWidth+='em';$ul.css('width',emWidth);$LIs.css({'float':liFloat,width:'100%','white-space':'normal'}).each(function(){var $childUl=$('>ul',this),offsetDirection=$childUl.css('left')!==undefined?'left':'right';$childUl.css(offsetDirection,emWidth)})})})};$.fn.supersubs.defaults={minWidth:9,maxWidth:25,extraWidth:0}})(jQuery);
(function($){$.fn.supposition=function(){var $w=$(window),_offset=function(dir){return window[dir=='y'?'pageYOffset':'pageXOffset']||document.documentElement&&document.documentElement[dir=='y'?'scrollTop':'scrollLeft']||document.body[dir=='y'?'scrollTop':'scrollLeft']},onHide=function(){this.css({Top:'',Right:'',Bottom:'',Left:''})},onBeforeShow=function(){this.each(function(){var $u=$(this);$u.css('display','block');var menuWidth=$u.width(),menuParentWidth=$u.closest('li').outerWidth(true),menuParentLeft=$u.closest('li').offset().left,totalRight=$w.width()+_offset('x'),menuRight=$u.offset().left+menuWidth,exactMenuWidth=(menuRight>(menuParentWidth+menuParentLeft))?menuWidth-(menuRight-(menuParentWidth+menuParentLeft)):menuWidth;if($u.parents('.sf-js-enabled').hasClass('rtl')){if(menuParentLeft<exactMenuWidth){$u.css('left',menuParentWidth+'px');$u.css('right','auto')}}else if(menuRight>totalRight&&menuParentLeft>menuWidth){$u.css('right',menuParentWidth+'px');$u.css('left','auto')};var windowHeight=$w.height(),offsetTop=$u.offset().top,menuParentHeight=$u.parent().outerHeight(true),menuHeight=$u.height(),baseline=windowHeight+_offset('y'),expandUp=((offsetTop+menuHeight>baseline)&&(offsetTop>menuHeight));if(expandUp){$u.css('bottom',menuParentHeight+'px');$u.css('top','auto')};$u.css('display','none')})};return this.each(function(){var o=$.fn.superfish.o[this.serial],_onBeforeShow=o.onBeforeShow,_onHide=o.onHide;$.extend($.fn.superfish.o[this.serial],{onBeforeShow:function(){onBeforeShow.call(this);_onBeforeShow.call(this)},onHide:function(){onHide.call(this);_onHide.call(this)}})})}})(jQuery);
(function($){$.fn.sftouchscreen=function(){return this.each(function(){$(this).find('li > ul').closest('li').children('a').each(function(){var $item=$(this);$item.click(function(event){if($item.hasClass('sf-clicked')){var $uri=$item.attr('href');window.location=$uri}else{event.preventDefault();$item.addClass('sf-clicked')}}).closest('li').mouseleave(function(){$item.removeClass('sf-clicked')})})})}})(jQuery);
Drupal.behaviors.custom_search=function(context){if(!Drupal.settings.custom_search.solr)$('form.search-form',context).submit(function(){var box=$(this).find('input.custom-search-box');if(box.val()!=undefined&&(box.val()==''||box.val()==$(this).find('input.default-text').val())){$(this).find('input.custom-search-box').addClass('error');return false};if($(this).find('#edit-keys').parents('div.element-invisible').attr('class')=='element-invisible'){$(this).find('#edit-keys').val($(this).find('#edit-or').val());$(this).find('#edit-or').val('')};return true});$('form.search-form').attr('target',Drupal.settings.custom_search.form_target);$('input.custom-search-box',context).blur(function(e){$this=$(this);$parentForm=$this.parents('form');if($this.val()==''){$this.addClass('custom-search-default-value');$this.val($parentForm.find('input.default-text').val())}}).bind('click focus',function(e){$this=$(this);$parentForm=$this.parents('form');if($this.val()==$parentForm.find('input.default-text').val())$this.val('');$this.removeClass('custom-search-default-value');var popup=$parentForm.find('fieldset.custom_search-popup');if(popup.find('input,select').length&&!popup.hasClass('opened'))popup.fadeIn().addClass('opened');e.stopPropagation()});$(document).bind('click focus',function(){$('fieldset.custom_search-popup').hide().removeClass('opened')});$('.custom-search-selector input:checkbox',context).each(function(){var el=$(this);if(el.val()=='c-all'){el.change(function(){$(this).parents('.custom-search-selector').find('input:checkbox[value!=c-all]').attr('checked',false)})}else if(el.val().substr(0,2)=='c-'){el.change(function(){$('.custom-search-selector input:checkbox').each(function(){if($(this).val().substr(0,2)=='o-')$(this).attr('checked',false)});$(this).parents('.custom-search-selector').find('input:checkbox[value=c-all]').attr('checked',false)})}else el.change(function(){$(this).parents('.custom-search-selector').find('input:checkbox[value!='+el.val()+']').attr('checked',false)})});var edit_keys=$('#edit-keys').val();if(edit_keys){var pos=edit_keys.indexOf('type:');if(pos){var pos2=edit_keys.indexOf(' ',pos);if(pos2==-1)pos2=edit_keys.length;var types=edit_keys.substring(pos+5,pos2);types=types.split(',');for(var i in types)$('.search-form input:checkbox[value='+types[i]+']').attr('checked',true)};var pos=edit_keys.indexOf('category:');if(pos){var pos2=edit_keys.indexOf(' ',pos);if(pos2==-1)pos2=edit_keys.length;var terms=edit_keys.substring(pos+9,pos2);terms=terms.split(',');for(var i in terms)$('.search-form option[value='+terms[i]+']').attr('selected',true)}};var popup=$('fieldset.custom_search-popup:not(.custom_search-processed)',context).addClass("custom_search-processed");popup.click(function(e){e.stopPropagation()});popup.append('<a class="custom_search-popup-close" href="#">'+Drupal.t('Close')+'</a>');$('a.custom_search-popup-close').click(function(e){$('fieldset.custom_search-popup.opened').hide().removeClass('opened');e.preventDefault()})};
var Blueprint={};Drupal.behaviors.blueprint=function(){var forms=$("#node-form>div>div>#edit-submit,#comment-form>div>#edit-submit,#user-register>div>#edit-submit");$('<div id="saving"><p class="saving">Saving&hellip;</p></div>').insertAfter(forms);forms.click(function(){if($('#autocomplete').each(function(){this.owner.hidePopup()}).size()!=0)return;$(this).siblings("input:submit").hide();$(this).hide();$("#saving").show();var notice=function(){$('<p id="saving-notice">Not saving? Wait a few seconds, reload this page, and try again. Every now and then the internet hiccups too :-)</p>').appendTo("#saving").fadeIn()};setTimeout(notice,24e3)})};
Drupal.settings.views=Drupal.settings.views||{ajax_path:'views/ajax'};Drupal.behaviors.quicktabs=function(context){$('.quicktabs_wrapper:not(.quicktabs-processed)',context).addClass('quicktabs-processed').each(function(){Drupal.quicktabs.prepare(this)})};Drupal.quicktabs=Drupal.quicktabs||{};Drupal.quicktabs.ajax={};Drupal.quicktabs.scripts={};Drupal.quicktabs.css={};Drupal.quicktabs.prepare=function(el){var i=0,qtid=el.id.substring(el.id.indexOf('-')+1);$(el).find('ul.quicktabs_tabs li a').each(function(){this.myTabIndex=i++;this.qtid=qtid;$(this).unbind('click').bind('click',quicktabsClick)});var $active_tab=$(el).children('.quicktabs_tabs').find('li.active a');if($active_tab.hasClass('qt_tab')||$active_tab.hasClass('qt_ajax_tab')){$active_tab.trigger('click')}else $(el).children('.quicktabs_tabs').find('li.first a').trigger('click');return false};Drupal.quicktabs.tab=function(el){this.element=el;this.tabIndex=el.myTabIndex;this.qtid=el.qtid;var qtKey='qt_'+this.qtid,i=0;for(var key in Drupal.settings.quicktabs[qtKey].tabs){if(i==this.tabIndex){this.tabObj=Drupal.settings.quicktabs[qtKey].tabs[key];this.tabKey=key};i++};this.tabpage_id='quicktabs_tabpage_'+this.qtid+'_'+this.tabKey;this.container=$('#quicktabs_container_'+this.qtid);this.tabpage=this.container.find('#'+this.tabpage_id);var tab=this;this.options={success:function(response){return tab.success(response)},complete:function(response){return tab.complete()}}};Drupal.quicktabs.tab.prototype.success=function(response){this.container.append(Drupal.theme('quicktabsResponse',this,response.data.content));$.extend(true,Drupal.settings,response.data.js_css.js_settings);Drupal.quicktabs.ajax.scripts(response.data.js_css.js_files);Drupal.quicktabs.ajax.css_files(response.data.js_css.css_files);Drupal.attachBehaviors(this.container)};Drupal.quicktabs.tab.prototype.complete=function(){this.stopProgress()};Drupal.quicktabs.tab.prototype.stopProgress=function(){if(this.progress.element)$(this.progress.element).remove();$(this.element).removeClass('progress-disabled').attr('disabled',false)};Drupal.quicktabs.tab.prototype.startProgress=function(){var progressBar=new Drupal.progressBar('qt-progress-'+this.element.id,null,null,null);progressBar.setProgress(-1,Drupal.t('Loading'));this.progress={};this.progress.element=$(progressBar.element).addClass('qt-progress qt-progress-bar');this.container.prepend(this.progress.element)};Drupal.quicktabs.tab.prototype.quicktabsAjaxView=function(){var tab=this;tab.container.append(Drupal.theme('quicktabsResponse',this,null));var target;target=$('#'+tab.tabpage_id+' > div');var ajax_path=Drupal.settings.views.ajax_path;if(ajax_path.constructor.toString().indexOf("Array")!=-1)ajax_path=ajax_path[0];var args;if(tab.tabObj.args!=''){args=tab.tabObj.args.join('/')}else args='';var viewData={view_name:tab.tabObj.vid,view_display_id:tab.tabObj.display,view_args:args};$.ajax({url:ajax_path,type:'GET',data:viewData,success:function(response){if(response.__callbacks)$.each(response.__callbacks,function(i,callback){eval(callback)(target,response)})},complete:function(){tab.stopProgress()},error:function(){alert(Drupal.t("An error occurred at @path.",{'@path':ajax_path}))},dataType:'json'})};var quicktabsClick=function(){var tab=new Drupal.quicktabs.tab(this);$(this).parents('li').siblings().removeClass('active');$(this).parents('li').addClass('active');tab.container.children().addClass('quicktabs-hide');if(tab.tabpage.hasClass('quicktabs_tabpage')){tab.tabpage.removeClass('quicktabs-hide')}else if($(this).hasClass('qt_ajax_tab')){tab.startProgress();if(tab.tabObj.type!='view'){var qtAjaxPath=Drupal.settings.basePath+'quicktabs/ajax/'+tab.tabObj.type+'/';switch(tab.tabObj.type){case'node':qtAjaxPath+=tab.tabObj.nid+'/'+tab.tabObj.teaser+'/'+tab.tabObj.hide_title;break;case'block':qtAjaxPath+=tab.qtid+'/'+tab.tabObj.bid+'/'+tab.tabObj.hide_title;break;case'qtabs':qtAjaxPath+=tab.tabObj.qtid;break};$.ajax({url:qtAjaxPath,type:'GET',data:null,success:tab.options.success,complete:tab.options.complete,dataType:'json'})}else tab.quicktabsAjaxView()};return false};Drupal.theme.prototype.quicktabsResponse=function(tab,content){var newDiv=tab.tabObj.type=='view'?'<div id="'+tab.tabpage_id+'" class="quicktabs_tabpage"><div></div></div>':'<div id="'+tab.tabpage_id+'" class="quicktabs_tabpage">'+content+'</div>';return newDiv};Drupal.quicktabs.ajax.scripts=function(files){$('script').each(function(){Drupal.quicktabs.scripts[$(this).attr('src')]=$(this).attr('src')});var html='';for(i in files)if(!Drupal.quicktabs.scripts[files[i]]&&!files[i].match(/^\/misc\/jquery\.js.*$/)){Drupal.quicktabs.scripts[files[i]]=files[i];html+='<script type="text/javascript" src="'+files[i]+'"></script>'};if(html)$('body').append($(html))};Drupal.quicktabs.ajax.css_files=function(files){$('link:not(.qt-temporary-css)').each(function(){if($(this).attr('type')=='text/css')Drupal.quicktabs.css[$(this).attr('href')]=$(this).attr('href')});var html='';for(i in files)if(!Drupal.quicktabs.css[files[i].file])html+='<link class="qt-temporary-css" type="text/css" rel="stylesheet" media="'+files[i].media+'" href="'+files[i].file+'" />';if(html){$('link.ctools-temporary-css').remove();$('body').append($(html))}};

