 //<![CDATA[ 

dojo.require("dojo.fx");

var animOut = new Array();
var animIn= new Array();
var currentAnimation;




  var fadeOut2 = dojo.fadeOut({node: "swimm",duration: 500});
  var fadeIn2 = dojo.fadeIn({node: "swimm",duration: 500});
  var wipeOut2 = dojo.fx.wipeOut({node: "swimm",duration: 500});
  var wipeIn2 = dojo.fx.wipeIn({node: "swimm",duration: 500});
  animOut[2] = dojo.fx.combine([fadeOut2, wipeOut2]);
  animIn[2] = dojo.fx.combine([fadeIn2, wipeIn2]);
  
  var fadeOut1 = dojo.fadeOut({node: "others",duration: 500});
  var fadeIn1 = dojo.fadeIn({node: "others",duration: 500});
  var wipeOut1 = dojo.fx.wipeOut({node: "others",duration: 500});
  var wipeIn1 = dojo.fx.wipeIn({node: "others",duration: 500});
  animOut[1] = dojo.fx.combine([fadeOut1, wipeOut1]);
  animIn[1] = dojo.fx.combine([fadeIn1, wipeIn1]);
  
  var fadeOut3 = dojo.fadeOut({node: "helth",duration: 500});
  var fadeIn3 = dojo.fadeIn({node: "helth",duration: 500});
  var wipeOut3 = dojo.fx.wipeOut({node: "helth",duration: 500});
  var wipeIn3 = dojo.fx.wipeIn({node: "helth",duration: 500});
  animOut[3] = dojo.fx.combine([fadeOut3, wipeOut3]);
  animIn[3] = dojo.fx.combine([fadeIn3, wipeIn3]);
  
  var fadeOut4 = dojo.fadeOut({node: "recreation",duration: 500});
  var fadeIn4 = dojo.fadeIn({node: "recreation",duration: 500});
  var wipeOut4 = dojo.fx.wipeOut({node: "recreation",duration: 500});
  var wipeIn4 = dojo.fx.wipeIn({node: "recreation",duration: 500});
  animOut[4] = dojo.fx.combine([fadeOut4, wipeOut4]);
  animIn[4] = dojo.fx.combine([fadeIn4, wipeIn4]);
  
  
  var fadeOut6 = dojo.fadeOut({node: "masters",duration: 500});
  var fadeIn6 = dojo.fadeIn({node: "masters",duration: 500});
  var wipeOut6 = dojo.fx.wipeOut({node: "masters",duration: 500});
  var wipeIn6 = dojo.fx.wipeIn({node: "masters",duration: 500});
   animOut[6] = dojo.fx.combine([fadeOut6, wipeOut6]);
  animIn[6] = dojo.fx.combine([fadeIn6, wipeIn6]);
  
 
 
  function doOut() { 
	 if(document.getElementById("swimm").offsetHeight>10){   
    currentAnimation = animOut[2];
    currentAnimation.play();
	 }
	 if(document.getElementById("others").offsetHeight>10){   
		    currentAnimation = animOut[1];
		    currentAnimation.play();
			 }
	 if(document.getElementById("helth").offsetHeight>10){   
		    currentAnimation = animOut[3];
		    currentAnimation.play();
			 }
	 if(document.getElementById("recreation").offsetHeight>10){   
		    currentAnimation = animOut[4];
		    currentAnimation.play();
			 }
	 
	 if(document.getElementById("masters").offsetHeight>10){
    currentAnimation = animOut[6];
    currentAnimation.play();
	 }
	 
	var sub2 = document.getElementsByTagName('div');
		for(i = 0; i < sub2.length; i++) {
			if(sub2[i].className=="submenu2"){
				sub2[i].style.display="none";	
			}
			}
		
	var	sub3 = document.getElementsByTagName('div');
		for(i = 0; i < sub3.length; i++) {
			if(sub3[i].className=="submenu3"){
				sub3[i].style.display="none";	
			}
			}
  }
  
  
 function doOutItm(itm){
	  switch(itm){
	  case 1: 
		  if(document.getElementById("others").offsetHeight>10){   
		    currentAnimation = animOut[1];
		    currentAnimation.play();
			 };break; 
			 
	  case 2: 
		  if(document.getElementById("swimm").offsetHeight>10){   
		    currentAnimation = animOut[2];
		    currentAnimation.play();
			 };break; 
			 
	  case 3: 
		  if(document.getElementById("helth").offsetHeight>10){   
		    currentAnimation = animOut[3];
		    currentAnimation.play();
			 };break;	
	  case 4: 
		  if(document.getElementById("recreation").offsetHeight>10){   
		    currentAnimation = animOut[4];
		    currentAnimation.play();
			 };break;
  }
  }
  function doIn(item) {
	  if(item>=2){
		  doOutItm(item-1);
	  }
	  if(item<=6){
		  doOutItm(item+1);
		  } 
	  currentAnimation = animIn[item]; currentAnimation.play(); 
	  }
  
  
  
//]]>