// JavaScript Document
function prepMove(){
	prepMoveElements("breast");
	prepMoveElements("body");
	prepMoveElements("face");
	prepMoveElements("nonsurg");
	prepMoveElements("portfolio_nav");
}

function prepMoveElements(section){
	if(!document.getElementsByTagName) return false;
	if(!document.getElementById) return false;
	if(!document.getElementById(section + "_scroller")) return false;
	if(!document.getElementById(section + "_slider")) return false;
	if(!document.getElementById(section + "_up")) return false;
	if(!document.getElementById(section + "_down")) return false;
	
	var container = document.getElementById(section + "_scroller");
	var slider = document.getElementById(section + "_slider");
	var upper = document.getElementById(section + "_up");
	var downer = document.getElementById(section + "_down");
	
	// var shiftval = container.clientHeight;
	
	var shiftval = 80;
	if(section == "portfolio_nav"){ shiftval = 345; }
	
	var maxtop = (0 - (slider.scrollHeight) + shiftval);
	var maxbtm = 0;
	
	var speed = 20;
	if(section == "portfolio_nav"){ speed = 25; }
	
	// alert(shiftval);
	// alert(maxtop);
	
	downer.onclick = function() {
		if(!slider.style.top) {
			slider.style.top = "0px";
		}
		var final_y = (parseInt(slider.style.top)) - (shiftval);
		moveElement(section + "_slider", final_y, speed);
		return false;
	}
	
	upper.onclick = function() {
		if(!slider.style.top) {
			slider.style.top = "0px";
		}
		var final_y = (parseInt(slider.style.top)) + (shiftval);
		moveElement(section + "_slider", final_y, speed);
		return false;
	}
	
}

addLoadEvent(prepMove);