
function findheight(divid){var e=$(divid).style;var originalVisibility=e.visibility;var originalDisplay=e.display;e.visibility='hidden';e.display='block';var originalHeight=$(divid).clientHeight;e.display=originalDisplay;e.visibility=originalVisibility;return originalHeight;}
function fakehover(on,base,suffix){if(on){$(base+'_'+suffix).className+=' hoverjs';}else{$(base+'_'+suffix).className=$(base+'_'+suffix).className.replace(/ hoverjs/g,"");}}
function hoveroncontent(on,id){fakehover(on,id,'status_content');}
function hoverontop(on,id){fakehover(on,id,'status_content');fakehover(on,id,'div');}
function hoveronstatus(on,id){fakehover(on,id,'div');}
function tooltip(id){$(id).down('.tooltip').appear({from:0.0,to:0.93,duration:1.0});}
function tooltipoff(id){$(id).down('.tooltip').fade({from:0.93,to:0.0,duration:0.75});}
var shade_state=[];var shade_effect=[];var shade_height=[];var shade_scroll=[];var content_min_height=0;function finishclose(id){shade_state[id]="closed";$(id).style.display='none';$(id).style.height=shade_height[id]+'px';if($(id+"_more_info")){$(id+"_more_info").appear({duration:1,afterFinish:function(){$('content').style.minHeight='';}});}
if($(id+"_triangle")){$(id+"_triangle").appear({duration:0.33});}
if($(id+"_triangle2")){$(id+"_triangle2").fade({duration:0.33});}}
function shade_close(id){switch(shade_state[id]){case undefined:shade_state[id]="closed";shade_close(id);break;case"closed":break;case"open":shade_state[id]="closing";shade_effect[id]=Effect.BlindUp(id,{scaleTo:20,afterFinish:function(){finishclose(id);}});break;case"closing":break;case"opening":shade_effect[id].cancel();shade_state[id]="open";shade_close(id);break;}}
function finishopen(id){shade_state[id]="open";$(id).style.height=shade_height[id]+'px';if($(id+"_more_info")){$(id+"_more_info").slideUp({duration:0.75});}
if($(id+"_triangle")){$(id+"_triangle").fade({duration:0.33});}
if($(id+"_triangle2")){$(id+"_triangle2").appear({duration:0.33});}
var scroll=shade_scroll[id];shade_scroll[id]='';if(scroll&&scroll!=''){Effect.ScrollTo(scroll,{offset:-100});}}
function shade_open_scroll(id,scroll){switch(shade_state[id]){case undefined:shade_state[id]="closed";shade_open_scroll(id,scroll);break;case"closed":shade_state[id]="opening";shade_scroll[id]=scroll;$('content').style.minHeight=content_min_height+'px';shade_effect[id]=Effect.BlindDown(id,{duration:0.75});finishopen(id);break;case"open":break;case"closing":shade_effect[id].cancel();shade_state[id]="closed";shade_open_scroll(id,scroll);break;case"opening":break;}}
function shade_open(id){shade_open_scroll(id,'');}
function shadeinit(prefix,ids){if(!ids){ids=prefix;prefix="";}
if(prefix!=""){prefix+="_";}
if(ids.constructor.toString().indexOf("Array")==-1){ids=[ids];}
var max_shade_height=0;for(var id=0;id<ids.length;id++){var elem=$(prefix+ids[id]);shade_height[prefix+ids[id]]=elem.getHeight();if(shade_height[prefix+ids[id]]>max_shade_height){max_shade_height=shade_height[prefix+ids[id]];}
elem.style.display='none';if($(prefix+ids[id]+"_more_info")){$(prefix+ids[id]+"_more_info").style.display='block';}}
content_min_height=$('content').getHeight()+max_shade_height;}
function shade(id){switch(shade_state[id]){case undefined:case"closed":Effect.Appear(id);if($(id+"_more_info")){$(id+"_more_info").fade({duration:1});}
shade_state[id]="open";break;case"open":Effect.Fade(id);if($(id+"_more_info")){$(id+"_more_info").appear({duration:1});}
shade_state[id]="closed";break;}}
var search_shade_state;function search(){switch(search_shade_state){case undefined:case"closed":Effect.Appear('searchbox',{afterFinish:function(){$('searchbox').focus();}});search_shade_state="open";break;case"open":Effect.Fade('searchbox');search_shade_state="closed";break;}}
function searchclose(){if(search_shade_state=="open"){$('searchbox').fade();search_shade_state="closed";}}
function searchsubmit(){$('searchform').submit();}
function search_shade_init(){$('searchbox').style.display='none';$('searchbox').style.visibility='visible';search_shade_state="closed";$('searchlink').onclick=function(){search();return false;};}
Element.observe(window,"load",function(){search_shade_init();});var puffing=false;var puff_resetting=false;function puff_logo(){if(!puffing){puffing=true;var newLeft=$('content').getWidth()-parseInt($('logo').getStyle('right'))-$('logo').getWidth();Effect.Queues.get('puff').interval=0;$('logo').setStyle({left:newLeft+"px",right:"auto"});new Effect.Pulsate('logo',{duration:2.0,queue:{position:'end',scope:'puff'}});new Effect.Fade('content2',{to:0.2,duration:1.25,queue:{position:'end',scope:'puff'}});new Effect.Move('logo',{x:25-$('content').getWidth()/2,y:0,mode:'relative',duration:3.0,transition:Effect.Transitions.spring,queue:{position:'end',scope:'puff'}});new Effect.Move('logo',{x:0,y:120,mode:'relative',duration:1.0,transition:Effect.Transitions.sinoidal,queue:{position:'end',scope:'puff'}});new Effect.Parallel([new Effect.Scale('logo',600,{sync:true,scaleFromCenter:true}),new Effect.Opacity('logo',{sync:true,from:0.75,to:0.0})],{duration:8.0,queue:{position:'end',scope:'puff'},afterFinish:function(){$('logo').setStyle({left:"auto",right:"10px",top:'15px',opacity:'0',width:'100px',height:'136px'});}});new Effect.Appear('content2',{duration:1.5,from:0.2,to:1.0,queue:{position:'end',scope:'puff'}});new Effect.Appear('logo',{duration:1.5,from:0.15,to:0.75,queue:{position:'end',scope:'puff'}});new Effect.SwitchOff('logo',{queue:{position:'end',scope:'puff'},afterFinish:function(){setInterval(function(){new Effect.Appear('logo',{duration:6.0,to:0.75,afterFinish:function(){puffing=false;}});},2000);}});}else{if(!puff_resetting){Effect.Queues.get('puff').each(function(effect){effect.cancel();});puff_resetting=true;$('logo').setStyle({left:"auto",right:"10px",top:'15px',opacity:'0',width:'100px',height:'136px'});$('content2').setStyle({opacity:1.0});new Effect.Appear('logo',{duration:2.0,to:0.75,afterFinish:function(){puff_resetting=false;puffing=false;}});}}}
Element.observe(window,'load',function(){if($('logo')){$('site_title').observe('click',function(){puff_logo();return false;});$('logo').observe('click',function(){puff_logo();return false;});}});function add_if_overflowing(elem,add){if(elem.clientWidth<elem.scrollWidth){while(elem.clientWidth<elem.scrollWidth){elem.innerHTML=elem.innerHTML.substring(0,elem.innerHTML.length-1);}
elem.innerHTML=elem.innerHTML.substring(0,elem.innerHTML.length-3)+"...";}}
function add_if_overflowing_class(elem,clazz,add){var elems=elem.select("."+clazz);for(var j=0;j<elems[0].length;j++)
add_if_overflowing(elems[0][j],add);}
function add_overflowing(){add_if_overflowing_class(document.body,'overflow_hider','...');}
Element.observe(window,'load',function(){add_overflowing();});Element.observe(window,'resize',function(){add_overflowing();});
