 dojo.require("dojo.fx");
 var j=0;
 var animOut = new Array();
 var animIn= new Array();
 var subdiv;
 
 subdiv = document.getElementsByTagName('div');
	for(i = 0; i < subdiv.length; i++) {
		if(subdiv[i].className=="submenu"){
			 var fadeOut = dojo.fadeOut({node: ""+j,duration: 500});
			  var fadeIn = dojo.fadeIn({node: ""+j,duration: 500});
			  var wipeOut = dojo.fx.wipeOut({node: ""+j,duration: 500});
			  var wipeIn = dojo.fx.wipeIn({node: ""+j,duration: 500});			  
			  animOut[j] = dojo.fx.combine([fadeOut, wipeOut]);
			  animIn[j]= dojo.fx.combine([fadeIn, wipeIn]);
			  dojo.style(""+j, "visibility", "hidden");
			  j++;
	}
	}
 
  
  var currentAnimation;
  
  
  
  function doOut() { 
	var x;
	var i;
	for(i = 0; i < subdiv.length; i++) {
		if(subdiv[i].className=="submenu"){
	if(subdiv[i].offsetHeight>10){
		  for(x = 0; x < 6; x++) {
        currentAnimation = animOut[x];
    currentAnimation.play();
		  }
	  	}
	 }
	}
  }
  
  function doIn(item) {
	  var x=0;
		  for(x = 0; x <= 6; x++) {
			  if(x!=item){
        currentAnimation = animOut[x];
    currentAnimation.play();
			  }
		  }
	 
	  switch(item) 
	  { 
	   case 0: currentAnimation = animIn[0]; currentAnimation.play(); break;
	   case 1: currentAnimation = animIn[1]; currentAnimation.play(); break;
	   case 2: currentAnimation = animIn[2]; currentAnimation.play(); break;
	   case 3: currentAnimation = animIn[3]; currentAnimation.play(); break;
	   case 4: currentAnimation = animIn[4]; currentAnimation.play(); break;
	   case 5: currentAnimation = animIn[5]; currentAnimation.play(); break;
	   case 6: currentAnimation = animIn[6]; currentAnimation.play(); break;
		   }

	        
	  }