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>'}};
$(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])})})});
(function($){Drupal.behaviors.mollomPrivacy=function(context){$('.mollom-privacy a',context).click(function(){this.target='_blank'})};Drupal.behaviors.mollomCaptcha=function(context){$('a.mollom-switch-captcha',context).click(getMollomCaptcha)}
function getMollomCaptcha(){var newCaptchaType=$(this).hasClass('mollom-audio-captcha')?'audio':'image',context=$(this).parents('form'),mollomSessionId=$('input.mollom-session-id',context).val();$.getJSON(Drupal.settings.basePath+'mollom/captcha/'+newCaptchaType+'/'+mollomSessionId,function(data){if(!(data&&data.content))return;$('.mollom-captcha-content',context).parent().html(data.content);$('input.mollom-session-id',context).val(data.session_id);Drupal.attachBehaviors(context);$('input[name="mollom[captcha]"]',context).focus()});return false}})(jQuery);
Drupal.Views={};Drupal.behaviors.viewsTabs=function(context){$('#views-tabset:not(.views-processed)').addClass('views-processed').each(function(){new Drupal.Views.Tabs($(this),{selectedClass:'active'})});$('a.views-remove-link').addClass('views-processed').click(function(){var id=$(this).attr('id').replace('views-remove-link-','');$('#views-row-'+id).hide();$('#views-removed-'+id).attr('checked',true);return false})};Drupal.behaviors.viewsHoverlinks=function(){if($.browser.msie){$("div.view:not(.views-hover-processed)").addClass('views-hover-processed').hover(function(){$('div.views-hide',this).addClass("views-hide-hover");return true},function(){$('div.views-hide',this).removeClass("views-hide-hover");return true});$("div.views-admin-links:not(.views-hover-processed)").addClass('views-hover-processed').hover(function(){$(this).addClass("views-admin-links-hover");return true},function(){$(this).removeClass("views-admin-links-hover");return true})}};Drupal.Views.parseQueryString=function(query){var args={},pos=query.indexOf('?');if(pos!=-1)query=query.substring(pos+1);var pairs=query.split('&');for(var i in pairs)if(typeof(pairs[i])=='string'){var pair=pairs[i].split('=');if(pair[0]!='q'&&pair[1])args[pair[0]]=decodeURIComponent(pair[1].replace(/\+/g,' '))};return args};Drupal.Views.parseViewArgs=function(href,viewPath){var returnObj={},path=Drupal.Views.getPath(href);if(viewPath&&path.substring(0,viewPath.length+1)==viewPath+'/'){var args=decodeURIComponent(path.substring(viewPath.length+1,path.length));returnObj.view_args=args;returnObj.view_path=path};return returnObj};Drupal.Views.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.Views.getPath=function(href){href=Drupal.Views.pathPortion(href);href=href.substring(Drupal.settings.basePath.length,href.length);if(href.substring(0,3)=='?q=')href=href.substring(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.Views.Ajax=Drupal.Views.Ajax||{};Drupal.Views.Ajax.ajaxViewResponse=function(target,response){if(response.debug)alert(response.debug);var $view=$(target);if(response.status&&response.display){var $newView=$(response.display);$view.replaceWith($newView);$view=$newView;Drupal.attachBehaviors($view.parent())};if(response.messages)$view.find('.views-messages').remove().end().prepend(response.messages)};Drupal.behaviors.ViewsAjaxView=function(){if(Drupal.settings&&Drupal.settings.views&&Drupal.settings.views.ajaxViews){var ajax_path=Drupal.settings.views.ajax_path;if(ajax_path.constructor.toString().indexOf("Array")!=-1)ajax_path=ajax_path[0];$.each(Drupal.settings.views.ajaxViews,function(i,settings){if(settings.view_dom_id){var view='.view-dom-id-'+settings.view_dom_id;if(!$(view).size())view='.view-id-'+settings.view_name+'.view-display-id-'+settings.view_display_id};$('form#views-exposed-form-'+settings.view_name.replace(/_/g,'-')+'-'+settings.view_display_id.replace(/_/g,'-')).filter(':not(.views-processed)').each(function(){$('input[name=q]',this).remove();var form=this;$.each(settings,function(key,setting){$(form).append('<input type="hidden" name="'+key+'" value="'+setting+'"/>')})}).addClass('views-processed').submit(function(){$('input[type=submit], button',this).after('<span class="views-throbbing">&nbsp</span>');var object=this;$(this).ajaxSubmit({url:ajax_path,type:'GET',success:function(response){if(response.__callbacks){$.each(response.__callbacks,function(i,callback){eval(callback)(view,response)});$('.views-throbbing',object).remove()}},error:function(xhr){Drupal.Views.Ajax.handleErrors(xhr,ajax_path);$('.views-throbbing',object).remove()},dataType:'json'});return false});$(view).filter(':not(.views-processed)').filter(function(){return!$(this).parents('.view').size()}).each(function(){var target=this;$(this).addClass('views-processed').find('ul.pager > li > a, th.views-field a, .attachment .views-summary a').each(function(){var viewData={js:1};$.extend(viewData,Drupal.Views.parseQueryString($(this).attr('href')),Drupal.Views.parseViewArgs($(this).attr('href'),settings.view_base_path),settings);$(this).click(function(){$.extend(viewData,Drupal.Views.parseViewArgs($(this).attr('href'),settings.view_base_path));$(this).addClass('views-throbbing');$.ajax({url:ajax_path,type:'GET',data:viewData,success:function(response){$(this).removeClass('views-throbbing');var offset=$(target).offset(),scrollTarget=target;while($(scrollTarget).scrollTop()==0&&$(scrollTarget).parent())scrollTarget=$(scrollTarget).parent();if(offset.top-10<$(scrollTarget).scrollTop())$(scrollTarget).animate({scrollTop:(offset.top-10)},500);if(response.__callbacks)$.each(response.__callbacks,function(i,callback){eval(callback)(target,response)})},error:function(xhr){$(this).removeClass('views-throbbing');Drupal.Views.Ajax.handleErrors(xhr,ajax_path)},dataType:'json'});return false})})})})}};
jQuery.fn.setEqualHeight=function(o){var maxHeight=0,maxElement=null;jQuery(this).each(function(i){if((jQuery(this).height()+parseInt(jQuery(this).css("padding-bottom"))+parseInt(jQuery(this).css("padding-top")))>maxHeight){maxHeight=jQuery(this).height()+parseInt(jQuery(this).css("padding-top"))+parseInt(jQuery(this).css("padding-bottom"));maxElement=this}});jQuery(this).not($(maxElement)).each(function(){$(this).height(maxHeight-parseInt(jQuery(this).css("padding-top"))-parseInt(jQuery(this).css("padding-bottom")))})};$(document).ready(function(){var searchBoxes=$(".text"),searchBox=$("#edit-search-theme-form-1"),searchBoxDefault="search...",lastPrimary=$(".view-front-page-promos li.views-row-1"),lastSecondary=$("#secondary-promo-panel li.views-row-1"),maxWidth=205,maxHeight=205,minWidth=75,minHeight=205;searchBox.focus(function(){if($(this).attr("value")==searchBoxDefault)$(this).attr("value","")});searchBox.blur(function(){if($(this).attr("value")=="")$(this).attr("value",searchBoxDefault)});$('.equal-heights').setEqualHeight();$(lastPrimary).children('.views-field-field-promo-image-fid-1').css({width:maxWidth+"px",height:maxHeight+"px"});$(lastPrimary).find("img").css({'margin-left':'0px'});var htmlStr=$(lastPrimary).children('.views-field-field-promo-panel-text-value').html();$("#promo-description").html(htmlStr);var backgroundColour=$(lastPrimary).children('.views-field-field-background-colour-value').text(),textColour=$(lastPrimary).children('.views-field-field-text-colour-value').text();$(lastPrimary).children('.views-field-field-promo-title-value').addClass("large");$('.view-front-page-promos .views-field-field-promo-title-value').each(function(){var titleheight=$(this).height()-18;$(this).css({bottom:titleheight+'px'})});var htmlStr=$(lastSecondary).children('.views-field-field-promo-title-value').html()+$(lastSecondary).children('.views-field-field-promo-panel-text-value').html();$("#secondary-promo-text").html(htmlStr);$(lastSecondary).addClass("active");$("#secondary-promo-panel li").mouseover(function(){$(lastSecondary).removeClass("active");$(this).addClass("active");var secondaryText=$(this).children('.views-field-field-promo-title-value').html()+$(this).children('.views-field-field-promo-panel-text-value').html();$("#secondary-promo-text").html(secondaryText);lastSecondary=this});$(".view-front-page-promos li").mouseover(function(){$(lastPrimary).children('.views-field-field-promo-image-fid-1').css({width:minWidth+"px",height:minHeight+"px"});$(lastPrimary).children('.views-field-field-promo-title-value').removeClass("large");$(lastPrimary).find("img").css({'margin-left':'-100px'});var titleheight=$(lastPrimary).children('.views-field-field-promo-title-value').height()-18;$(lastPrimary).children('.views-field-field-promo-title-value').css({bottom:titleheight+'px'});$(lastPrimary).children('.views-field-field-promo-title-value').css({'background-color':''});$(lastPrimary).contents().find('a').css({color:''});$("#promo-description").css({'background-color':''});$("#promo-description").css({color:''});$(this).children('.views-field-field-promo-image-fid-1').css({width:maxWidth+"px",height:maxHeight+'px'});$(this).find("img").css({'margin-left':'0px'});var htmlStr=$(this).children('.views-field-field-promo-panel-text-value').html();$("#promo-description").html(htmlStr);$(this).children('.views-field-field-promo-title-value').addClass("large");var titleheight=$(this).children('.views-field-field-promo-title-value').height()+18;$(this).children('.views-field-field-promo-title-value').css({bottom:'0px'});lastPrimary=this});$('#showToggle').hide();$('#hideToggle').click(function(){$('#front-splash').toggle(400);$('#showToggle').toggle(0);$('#hideToggle').toggle(0)});$('#showToggle').click(function(){$('#front-splash').toggle(400);$('#showToggle').toggle(0);$('#hideToggle').toggle(0)})});

