// JavaScript Document

  var pressMe = 0;
  var state1 = 1;
  var state2 = 1;
  var state3 = 1;
  var state4 = 1;
  function pointers(){
	  document.getElementById('button1').style.cursor ='pointer';
	  document.getElementById('button2').style.cursor ='pointer';
	  document.getElementById('button3').style.cursor ='pointer';
	  document.getElementById('button4').style.cursor ='pointer';	  
  }
   function pointersOff(){
	  document.getElementById('button1').style.cursor ='wait';
	  document.getElementById('button2').style.cursor ='wait';
	  document.getElementById('button3').style.cursor ='wait';
	  document.getElementById('button4').style.cursor ='wait';	  
  }
  
  function slideDivs(num){
	switch(num){
		case 1:
		if(state1 == 0){
			pointersOff();
		   d1 = new Tween(document.getElementById('divExpander1').style,'width',Tween.elasticEaseOut,0,369,2,'px');
		   pressMe++;
		   d1.start();
		   d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state1 = 1;
		} else if(state1 == 1){
			pointersOff();
		   d1 = new Tween(document.getElementById('divExpander1').style,'width',Tween.regularEaseOut,369,0,.5,'px');
		   pressMe++;
		   d1.start();
		   d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state1 = 0;
		}
		  if(state2 == 0){
		   d2 = new Tween(document.getElementById('divExpander2').style,'width',Tween.elasticEaseOut,0,519,2,'px');
		   pressMe++;
		   d2.start();
		   d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state2 = 1;
		}
		  if(state3 == 0){
		   d3 = new Tween(document.getElementById('divExpander3').style,'width',Tween.elasticEaseOut,0,664,2,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 1;
		}
		
		  
		break;
		case 2:

		  if(state1 == 1){
		   d1  = new Tween(document.getElementById('divExpander1').style,'width',Tween.regularEaseOut,369,0,.5,'px');
		   pressMe++;
		   d1.start();
		   d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state1 = 0;
		} else if (state2 == 1 && state1 == 0){
			pointersOff();
		   d1 = new Tween(document.getElementById('divExpander1').style,'width',Tween.elasticEaseOut,0,369,2,'px');
		   pressMe++;
		   d1.start();
		   d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state1 = 1;
		}
		  if(state2 == 0){
		   pointersOff();
		   d2  = new Tween(document.getElementById('divExpander2').style,'width',Tween.elasticEaseOut,0,519,2,'px');
		   pressMe++;
		   d2.start();
		   d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state2 = 1;
		}
		  if(state3 == 0){
		   d3  = new Tween(document.getElementById('divExpander3').style,'width',Tween.elasticEaseOut,0,664,2,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 1;
		}
		  
		break;
		case 3:
		  pointersOff();
		  if(state3 === 1 && state2 === 0 && state1 === 0){
		  	
		  	d1 = new Tween(document.getElementById('divExpander1').style,'width',Tween.elasticEaseOut,0,369,2,'px');
		  	pressMe++;
		  	d1.start();
		  	d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		  	state1 = 1;
			d2 = new Tween(document.getElementById('divExpander2').style,'width',Tween.elasticEaseOut,0,519,2,'px');
		    pressMe++;
		    d2.start();
		    d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		    state2 = 1; 
		  } else if(state3 === 1 && state2 === 1 && state1 === 0){
		    d2  = new Tween(document.getElementById('divExpander2').style,'width',Tween.regularEaseOut,519,0,.5,'px');
		    pressMe++;
		    d2.start();
		    d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		    state2 = 0;
		  } else if(state3 === 1 && state2 === 1 && state1 === 1){
		    d1  = new Tween(document.getElementById('divExpander1').style,'width',Tween.regularEaseOut,369,0,.5,'px');
		    pressMe++;
		    d1.start();
		    d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		    state1 = 0;
		    d2  = new Tween(document.getElementById('divExpander2').style,'width',Tween.regularEaseOut,519,0,.5,'px');
		    pressMe++;
		    d2.start();
		    d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		    state2 = 0;
		  } else if(state3 == 0){
		   pointersOff();
		   d3  = new Tween(document.getElementById('divExpander3').style,'width',Tween.elasticEaseOut,0,664,2,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 1;
		  }
		  
		break;
		case 4:
		  pointersOff();
		  
		  if(state1 === 0 && state2 === 0 && state3 === 0){
		   d1 = new Tween(document.getElementById('divExpander1').style,'width',Tween.elasticEaseOut,0,369,2,'px');
		   pressMe++;
		   d1.start();
		   d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state1 = 1;
		   d2 = new Tween(document.getElementById('divExpander2').style,'width',Tween.elasticEaseOut,0,519,2,'px');
		   pressMe++;
		   d2.start();
		   d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state2 = 1; 
		   d3  = new Tween(document.getElementById('divExpander3').style,'width',Tween.elasticEaseOut,0,664,2,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 1;	   
		  } else if(state1 === 0 && state2 === 0 && state3 === 1){
		   d3  = new Tween(document.getElementById('divExpander3').style,'width',Tween.regularEaseOut,664,0,.5,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 0;
		  } else if(state1 === 0 && state2 === 1 && state3 === 1){
		   d3  = new Tween(document.getElementById('divExpander3').style,'width',Tween.regularEaseOut,664,0,.5,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 0; 		   
		   d2  = new Tween(document.getElementById('divExpander2').style,'width',Tween.regularEaseOut,519,0,.5,'px');
		   pressMe++;
		   d2.start();
		   d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state2 = 0;  
		  } else if(state1 === 1 && state2 === 1 && state3 === 1){
		   d3  = new Tween(document.getElementById('divExpander3').style,'width',Tween.regularEaseOut,664,0,.5,'px');
		   pressMe++;
		   d3.start();
		   d3.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state3 = 0; 		   
		   d2  = new Tween(document.getElementById('divExpander2').style,'width',Tween.regularEaseOut,519,0,.5,'px');
		   pressMe++;
		   d2.start();
		   d2.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state2 = 0;
		   d1  = new Tween(document.getElementById('divExpander1').style,'width',Tween.regularEaseOut,369,0,.5,'px');
		   pressMe++;
		   d1.start();
		   d1.onMotionFinished = function(){ pressMe--; if(pressMe === 0){ pointers(); } };
		   state1 = 0;
		  }
		 
		break;
		
	}
	  
  }
