var atomicTimer;
var atomicMenuWidth;
var atomicMenuHeight;

function toggleAtomicMenu(dir,e){
	atomicMenuHeight=document.getElementById("atomicMenu").style.height;
	atomicMenuHeight=Number(atomicMenuHeight.replace("px",""));
if (!e) var e = window.event; 
e.cancelBubble = true;
if (e.stopPropagation) e.stopPropagation();

	
	if(dir=="up"){
	
	if(document.getElementById("atomicMenu").style.width=="103px" && document.getElementById("atomicMenu").style.height=="112px")
	{
	return false;
	}
		
	clearInterval(atomicTimer);
	atomicMenuWidth=document.getElementById("atomicMenu").style.width;
	atomicMenuWidth=Number(atomicMenuWidth.replace("px",""));
	atomicTimer=setInterval('slideAtomicMenu(7,"103px")',35);
	}
	else if(dir=="down" && pageReady==true){
	if(document.getElementById("atomicMenu").style.width=="49px")
	{
	return false;
	}
	
	var menuItems = document.getElementById('atomicMenu').getElementsByTagName('h2');
		
			for (i=0; i<menuItems.length; i++) {
			menuItems[i].style.visibility = "hidden";
			}	
			
			
		
	clearInterval(atomicTimer);
	
			atomicTimer=setInterval('growAtomicMenu(-4,"76px")',35);	
	

	}
}

function slideAtomicMenu(step,stopPoint){

	atomicMenuWidth+=step;
	if(step>0)
	{
		if(atomicMenuWidth>Number(stopPoint.replace("px",""))){
		atomicMenuWidth=Number(stopPoint.replace("px",""));
		}
	}
	else{
	
		if(atomicMenuWidth<Number(stopPoint.replace("px",""))){
	    atomicMenuWidth=Number(stopPoint.replace("px",""));}
	}
	document.getElementById("atomicMenu").style.width = (atomicMenuWidth.toString()+'px');  
	if(document.getElementById("atomicMenu").style.width==stopPoint)
	{
		clearInterval(atomicTimer);
		if(step>0)
		{
			atomicTimer=setInterval('growAtomicMenu(4,"112px")',35);	
		}
		
	}
}


function growAtomicMenu(step,stopPoint){

	atomicMenuHeight+=step;
	if(step>0)
	{
		if(atomicMenuHeight>Number(stopPoint.replace("px",""))){
		atomicMenuHeight=Number(stopPoint.replace("px",""));
		}
	}
	else{
	
		if(atomicMenuHeight<Number(stopPoint.replace("px",""))){
	    atomicMenuHeight=Number(stopPoint.replace("px",""));}
	}
	document.getElementById("atomicMenu").style.height = (atomicMenuHeight.toString()+'px');  
	if(document.getElementById("atomicMenu").style.height==stopPoint)
	{
		var menuItems = document.getElementById('atomicMenu').getElementsByTagName('h2');
		if(document.getElementById("atomicMenu").style.height=="112px"){
			for (i=0; i<menuItems.length; i++) {
			menuItems[i].style.visibility = "visible";
			}	
		}
		clearInterval(atomicTimer);
		if(step<0)
		{
			atomicMenuWidth=document.getElementById("atomicMenu").style.width;
	atomicMenuWidth=Number(atomicMenuWidth.replace("px",""));
	
	
	atomicTimer=setInterval('slideAtomicMenu(-7,"49px")',35);
	
		}
	}
}



function initializeAtomicMenu(){
	document.getElementById("atomicMenu").style.width="49px";
	document.getElementById("atomicMenu").style.height="76px";
	//setTimeout('waitThree()',700);
}



function waitThree(){
	if(!document.captureEvents){
	toggleAtomicMenu("down","MOUSEOUT");
	}
	else{
		toggleAtomicMenu("down", Event.MOUSEOUT);
	}
		
}