function searchForm(){var s=document.getElementById('search');var sdiv=document.getElementById('searchdiv');if(s&&sdiv){var labels=sdiv.getElementsByTagName('label');if(labels.length>0){var forAttr=labels[0].firstChild.nodeValue;labels[0].style.display='none';s.value=s.value?s.value:forAttr;s.onfocus=function(){if(s.value==forAttr){s.value='';}};s.onblur=function(){if(s.value==''){s.value=forAttr;}};}}}
function createCookie(name,value,days){if(days){var date=new Date();date.setTime(date.getTime()+(days*24*60*60*1000));var expires="; expires="+date.toGMTString();}
else expires="";document.cookie=name+"="+value+expires+"; path=/";}
function pickStyle(){var div=document.getElementById('textsize');var links=[];links[0]=document.getElementById('text_regular');links[1]=document.getElementById('text_large');if(!div||!links[0]||!links[1]){return;}
div.style.display='block';for(var i=0;i<links.length;i++){links[i].onclick=function(){var pagestyle='page_'+this.getAttribute('id');document.body.setAttribute('id',pagestyle);createCookie("style",pagestyle,365);var c=document.getElementById('container');if(c&&!window.innerHeight){document.body.appendChild(c);}
return false;};}}
window.addEvent('domready',pickStyle);window.addEvent('domready',searchForm);window.addEvent('domready',function(){if($('bubbles')){var myPages=$$('.page');var myBubbles=$$('.bubble');myBubbles.setStyle('opacity',0);$('bubbles').setStyle('visibility','visible')
myPages.each(function(el,i){el.set('morph',{link:'cancel'});el.addEvents({'mouseenter':function(){myBubbles[i].morph({'opacity':1,'margin-top':'-15px'});},'mouseleave':function(){myBubbles[i].morph({'opacity':0,'margin-top':0});}});});}});
