/*
*
*
*	slideScroll
*	Licensed under the GNU Lesser General Public License version 2.1
*	Copyright (c) 2008 nori (norimania@gmail.com)
*	http://moto-mono.net
*	Licensed under the MIT
*
*
*/

(function(){

var interval = 20;
var easing = 0.6;
var comeLink = true;
	
var d=document,dE=d.documentElement,lH=location.hash,timer,t,p={},a=d.getElementsByTagName("a"),$h=function(hash){return document.getElementById(hash.replace("#",""));}
function cp(){return{x:d.body.scrollLeft||dE.scrollLeft,y:d.body.scrollTop||dE.scrollTop}}
function sp(t){var h=dE.clientHeight,w=dE.clientWidth,mH=dE.scrollHeight,mW=dE.scrollWidth;p.top=(mH-h)<t.offsetTop?mH-h:t.offsetTop;p.left=(mW-w)<t.offsetLeft?mW-w:t.offsetLeft;}
function np(){var x=cp().x,y=cp().y,sx=Math.ceil((x-p.left)/(5*easing)),sy=Math.ceil((y-p.top)/(5*easing));return{x:x-sx,y:y-sy,ax:sx,ay:sy}}
function scroll(){timer=setInterval(function(){np();if(Math.abs(np().ax)<1&&Math.abs(np().ay)<1){clearInterval(timer);window.scroll(p.left,p.top);}
window.scroll(np().x,np().y);},interval);}
function hs(){if(!$h(lH))return false;sp($h(lH));window.scroll(0,0);if(document.all)setTimeout(function(){scroll();},50);else scroll();}
function sus(){for(var i=0;i<a.length;i++){if(a[i].hash&&$h(a[i].hash)&&a[i].href.match(new RegExp(location.href.split("#")[0]))){a[i].onclick=function(){clearInterval(timer);sp($h(this.hash));scroll();return false;}}}}
function ae(t,l,fn){try{t.addEventListener(l,fn,false);}catch(e){t.attachEvent("on"+l,function(){fn.apply(t);});}}
if(comeLink&&lH)ae(window,"load",hs);ae(window,"load",sus);})();


/* This script and many more are available free online at  
The JavaScript Source!! http://javascript.internet.com  
Created by: Jeroen Haan | http://www.haan.net */  
/* -----------------------------------------------  
   Link Enhancer - v.1.1  
   (c) 2007 www.haan.net  
   contact: jeroen@haan.net  
   You may use this script but please leave the credits on top intact.  
   Please inform us of any improvements made.  
   When useful we will add your credits.  
  ------------------------------------------------ */  
     
// Give the outbound links a blank target and their own style   
// and optional the inbound too or vise versa   
// It will leave the mailto alone and skip anchor tags without the href attribute   
  
function enhanceLinks() {   
    var links = document.getElementsByTagName("a");   
    var thisDomain = document.domain.split('www.');   
    var thisDomain = (thisDomain[1]) ? thisDomain[1] : document.domain ;   
     for (var i = 0; i < links.length; i++) {   
        if(links[i].href.indexOf(thisDomain) == -1 && links[i].href != '') {   
              links[i].target = '_blank';   
            links[i].className = 'link_ext';   
         }   
        // or else do this too if you like   
        // else    
        // {   
        //  links[i].target = '_self';   
        //  links[i].className = 'link_int';   
        // }           
    }   
}   
  
// Multiple onload function created by: Simon Willison   
// http://simon.incutio.com/archive/2004/05/26/addLoadEvent   
function addLoadEvent(func) {   
  var oldonload = window.onload;   
  if (typeof window.onload != 'function') {   
    window.onload = func;   
  } else {   
    window.onload = function() {   
      if (oldonload) {   
        oldonload();   
      }   
      func();   
    }   
  }   
}   
  
addLoadEvent(function() {   
  enhanceLinks();   
}   
);   
