/*
Copy this off into a different directory than js_scripts, and then encrypt before going live
*/

ns = (document.layers)? true:false
ie = (document.getElementById)? true:false

function init() {
	if (ns) block = document.menuLayer;
   if (ie) block = document.getElementById('menuLayer').style;
}

var topVal=0; //set these vars as global so they are not reset for each setTimeout call to the function 
var rightVal=0;
var bottomVal=410;
var leftVal=0;

function activateMenu(){
   if(ns){
      if(menuLayer.clip.left < 190) wipe1();
      if(menuLayer.clip.right >= 20) wipe2();
   } else {
      if(rightVal < 190) wipe1();
      if(rightVal >= 20) wipe2();
   }
}

function wipe1() {
   if(ns){ 
      if(menuLayer.clip.right < 190){
         layer.clip.top += 0;
         layer.clip.right += 5;
         layer.clip.bottom += 0;
         layer.clip.left += 0;
         setTimeout("wipe1('menuLayer')",10);
      } 
   } else { 
      if(rightVal < 190){
         topVal +=0 ;
         rightVal += 5;
         bottomVal += 0;
         leftVal += 0;
         menuLayer.style.clip="rect("+topVal+"px "+rightVal+"px "+bottomVal+"px "+leftVal+"px)";
         setTimeout("wipe1('menuLayer')",10);
      } 
   }
}

function wipe2() {   
   if(ns){ 
      if(menuLayer.clip.right > 20){
         layer.clip.top += 0;
         layer.clip.right -= 5;
         layer.clip.bottom += 0;
         layer.clip.left += 0;
         setTimeout("wipe2('menuLayer')",10);
      } 
   } else { 
      if(rightVal > 20){
         topVal +=0 ;
         rightVal -= 5;
         bottomVal += 0;
         leftVal += 0;
         menuLayer.style.clip="rect("+topVal+"px "+rightVal+"px "+bottomVal+"px "+leftVal+"px)";
         setTimeout("wipe2('menuLayer')",10);
      } else {
         rightVal = 0;
      }
   }
}
