// ScrollLinks original code by Valerio Proietti (http://www.mad4milk.net/)

var ScrollLinks = {
    currentHash: false,
    start: function(){
        this.allinks = document.getElementsByTagName('a');
        for (i=0; i<this.allinks.length; i++){
            var lnk = this.allinks[i];
            if ((lnk.href && lnk.href.indexOf('#') != -1) && ( (lnk.pathname == location.pathname) || ('/'+lnk.pathname == location.pathname) ) && (lnk.search == location.search)) {
                lnk.onclick = function(){
                    this.initialHref = this.href;
                    this.initialHash = this.hash;
										this.currentHash = this.initialHash.substr(1);
										new Effect.ScrollTo(this.currentHash,{duration:1.0}); return false;
                }
            }
        }
    }
}

/* This one works to hide all content under .hide classname. The same like bellow using $$('div.hide')

var HideTheHide = {
    start: function(){
			allNodes = document.getElementsByClassName("hide");
			for(i = 0; i < allNodes.length; i++) {
					allNodes[i].style.display = "none";
			}
    }
}
*/

var HideTheHide = {
    start: function(){
			allNodes = $$('.hide');
			for(i = 0; i < allNodes.length; i++) {
					allNodes[i].style.display = "none";
			}
    }
}

window.onload = function(){
    HideTheHide.start();
    ScrollLinks.start();
}