////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	// start everything
	//
	//
	//
addLoadEvent(function() {
	//change the name in quotes to the element id that contains your links
	preparePageScroll('exploreLinks'); 
	preparePageScroll('landLinks');
	preparePageScroll('equestrianLinks'); 
	prepareTopLinks();
});


////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	// preparePageScroll(navId)
	//
	//
	//
function preparePageScroll(navId) {
	if(!document.getElementById(navId)) return false;
	var nav = document.getElementById(navId);
	var links = nav.getElementsByTagName('a');
	for(var i=0; i < links.length; i++) {
		links[i].destination = links[i].getAttribute('href').split('#')[1];
		links[i].onclick = function() {
			pageScroll(this.destination);
			return false;
		}
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	// prepareTopLinks()
	//
	//
	//
function prepareTopLinks() {
	var links = getElementsByClassName('toTop');
	for(var i=0; i < links.length; i++) {
		links[i].destination = links[i].getAttribute('href').split('#')[1];
		links[i].onclick = function() {
			
			pageScroll(this.destination);
			return false;
		}
	}
}
////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	// pageScroll()
	//
	//
	//
function pageScroll(element) {
	new Effect.ScrollTo(element);
}
////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	// getElementsByClassName()
	//
	//
	//
function getElementsByClassName(value) {
	var selectedElems = new Array();
	var allElems = document.getElementsByTagName("*");
	for(var i=0; i<allElems.length; i++) {
		if(allElems[i].className == value) {
			selectedElems.push(allElems[i]);
		}
	}
	return selectedElems;
}
////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//
	//
	// addLoadEvent
	//
	//
	//
function addLoadEvent(func) {
	var oldonload = window.onload;
	if(typeof window.onload != 'function') {
		window.onload = func;
	}else{
		window.onload = function() {
			oldonload();
			func();
		}
	}
}
