var Timer;
var pageReady=false;
var menuBottomPos="";
var stopPoint;
var menuHeight;



function initializePage(siteSection){
	if (siteSection=="shades")
	{
		menuHeight="-155px";
	}
	if(siteSection=="atomic")
	{
		menuHeight="-155px";
	}
	if(siteSection=="opt")
	{
		menuHeight="-137px";	
	}
	if(siteSection=="so"){
		menuHeight="-134px";
	}
	pageReady=true;
	
}

function toggleStoreMenu(dir){
	
	
	if(dir=="up"){
	if(document.getElementById("storeMenuSlider").style.marginBottom=="0px")
	{
	return false;
	}
	clearInterval(Timer);
	menuBottomPos=document.getElementById("storeMenuSlider").style.marginBottom;
	menuBottomPos=Number(menuBottomPos.replace("px",""));
	Timer=setInterval('slideMenu(12,"0px")',25);
	}
	else if(dir=="down" && pageReady==true){
	if(document.getElementById("storeMenuSlider").style.marginBottom==menuHeight)
	{
	return false;
	}
	clearInterval(Timer);
	menuBottomPos=document.getElementById("storeMenuSlider").style.marginBottom;
	menuBottomPos=Number(menuBottomPos.replace("px",""));
	
	
	Timer=setInterval('slideMenu(-12,menuHeight)',25);
	

	}
}


function slideMenu(step,stopPoint){

	menuBottomPos+=step;
	if(step>0)
	{
		if(menuBottomPos>Number(stopPoint.replace("px",""))){
		menuBottomPos=Number(stopPoint.replace("px",""));
		}
	}
	else{
	
		if(menuBottomPos<Number(stopPoint.replace("px",""))){
	    menuBottomPos=Number(stopPoint.replace("px",""));}
	}
	document.getElementById("storeMenuSlider").style.marginBottom = (menuBottomPos.toString()+'px');  
	if(document.getElementById("storeMenuSlider").style.marginBottom==stopPoint)
	{
		clearInterval(Timer);
	}
}