/* ds1.js */
var DS1Site={basePath:null,isLoading:false,hasInit:true,hasClicked:false,hasPosted:false,$postedForm:null,onReady:function()
{this.basePath=$('script[@src*=/js/]:first').attr('src').split('/js/')[0];this.basePath=document.location.protocol+'//'+document.location.host;var selector,$elms;for(selector in this.elements)
{$elms=$(selector);if($elms.size()>0)
{this.elements[selector]($elms);}}
for(selector in this.repeatables)
{$elms=$(selector);if($elms.size()>0)
{this.repeatables[selector]($elms);}}},repeatables:{'textarea.html':function($elms)
{var fckeditor_base_path=DS1Site.basePath+'/js/fckeditor/';var styles_path=$('link[rel=stylesheet]:first').attr('href').split('?')[0];$elms.each(function()
{var editor=new FCKeditor(this.id);editor.BasePath=fckeditor_base_path;editor.Config['EditorAreaCSS']=styles_path;editor.Config['BodyClass']='container';editor.ToolbarSet='Default';editor.Height=250;editor.ReplaceTextarea();});}},elements:{'.page .images':function($elms){var showImage=function($image){$('.page .hero img:visible').fadeOut('fast',function(){$image.fadeIn('normal');});}
$('.page .hero img').each(function(i){$(this).attr('id','image-'+i);}).hide().eq(0).show();$('li a',$elms).each(function(i){$(this).attr('rel','#image-'+i);}).bind('click',function(e){var $this=$(this).css('opacity','0.35');$target=$($this.attr('rel'));if(!$target.is(':visible')){showImage($target);}
e.stopPropagation();e.preventDefault();return false;}).eq(0).css('opacity','0.35');},'.menu':function($elms){var $submenus=$('.menu ul > li > a');$submenus.click(function(){$(this).next().toggle("slow");}).next().hide();$('.menu a.current').parents('ul').show();$submenus.each(function(){});},'.news-pane:first':function($elms){var fitNewsPane=function(){var header_height=44+$elms.siblings('.news-header').height();var window_height=$(window).height();var min_height=200;$elms.height(Math.max(min_height,window_height-header_height));};fitNewsPane();$(window).bind('resize',fitNewsPane);},'a.obfuscated':function($elms){$elms.each(function(){var $this=$(this);var content=$this.text();content=content.replace(new RegExp('©','g'),'@');content=content.replace(new RegExp('•','g'),'.');var href='mailto:'+$this.attr('n')+'@'+$this.attr('d');$(this).attr('href',href).text(content);});}}}
$(document).ready(function()
{DS1Site.onReady();});