
function SmoothScroll(){
 var d=0.5;
 var f=80;
 var l=location.href;
 if(document.location.hash.substr(0,2)=='#_'){
  var id=document.location.hash.substr(2);
  new Effect.ScrollTo(id,{delay:0.3,duration:d,fps:f});
 }
 $$('a[href^=#]:not([href=#])').each(function(e){
  e.observe('click',function(event){
   var h=this.hash.substr(1);
   new Effect.ScrollTo(h,{duration:d,fps:f,afterFinish:function(){if(h!='Wrap'){document.location.hash='#'+h;}}});
   Event.stop(event);
   return false;
  }.bindAsEventListener(e));
 });
}

function openLively(){
 var w=800;
 var h=600;
 var m=navigator.mimeTypes['application/vnd.google-lively.room'];
 var url=(m && m.enabledPlugin) ?
 'http://embed.lively.com/iframe?rid=-2479442258999282551' :
 'http://www.lively.com/html/landing.html';
 window.open(url,'','scrollbars=1,location=0,width='+w+',height='+h);
}

function mc(s){
 var m='QGF4ZWwtbWVkaWEuY29t';
 var base64list='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=';
 var t='',p=-8,a=0,c,d;
 for(var i=0;i<m.length;i++){
  if((c=base64list.indexOf(m.charAt(i)))<0) continue;
  a=(a<<6)|(c&63);
  if((p+=6)>=0){
   d=(a>>p)&255;
   if(c!=64){
    t+=String.fromCharCode(d);
    a&=63;
    p-=8;
   }
  }
 }
 ma=s+t;
 document.write('<a '+'hr'+'ef="mai'+'lto'+':'+ma+'">'+ma+'</'+'a>');
}

function readImage(dir){
 var path=dir+'img/img.php';
 Event.observe(window,'load',function(){
  $$(".imgs").each(function(e){
   var idn=e.id;
   var size=idn.split('-')[0];
   var id=idn.split('-')[1];
   new Ajax.Request(path,{
    'method':'get',
    'parameters':{'s':size,'id':id,'r':1},
    onSuccess:function(){
     e.style.backgroundImage='url('+path+'?s='+size+'&id='+id+')';
    }
   });
  });
 });
}

Event.observe(window,'load',function(){
 SmoothScroll();
});