/*
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.SiteAnnouncements;
   if (ie) block = document.getElementById('SiteAnnouncements').style;
}
//set these vars as global so they are not reset for each setTimeout call to the function
var topVal=0;  
var rightVal=700;
var bottomVal=0;
var leftVal=0;

function activateSlider(){
   if(ns){// netscape
      if(SiteAnnouncements.clip.bottom < 380) wipe1();
      if(SiteAnnouncements.clip.bottom >= 20) wipe2();
   } else {// internet explorer, firefox
      if(bottomVal < 380) wipe1();
      if(bottomVal >= 20) wipe2();
   }
}

function wipe1() {// extends layer
   if(ns){// netscape
      if(SiteAnnouncements.clip.bottom < 380){
         layer.clip.top += 0;
         layer.clip.right += 5;
         layer.clip.bottom += 0;
         layer.clip.left += 0;
         setTimeout("wipe1('SiteAnnouncements')",10);
      } 
   } else {// internet explorer, firefox
      if(bottomVal < 380){
         topVal +=0 ;
         rightVal += 0;
         bottomVal += 5;
         leftVal += 0;
         SiteAnnouncements.style.clip="rect("+topVal+"px "+rightVal+"px "+bottomVal+"px "+leftVal+"px)";
         setTimeout("wipe1('SiteAnnouncements')",10);
      }
   }
}

function wipe2() {// retracts the layer
   if(ns){ 
      if(SiteAnnouncements.clip.bottom > 0){
         layer.clip.top += 0;
         layer.clip.right -= 5;
         layer.clip.bottom += 0;
         layer.clip.left += 0;
         setTimeout("wipe2('SiteAnnouncements')",10);
      } 
   } else { 
      if(bottomVal > 0){
         topVal +=0 ;
         rightVal += 0;
         bottomVal -= 5;
         leftVal += 0;
         SiteAnnouncements.style.clip="rect("+topVal+"px "+rightVal+"px "+bottomVal+"px "+leftVal+"px)";
         setTimeout("wipe2('SiteAnnouncements')",10);
      } else {
         bottomVal = 0;
      }
   }
}
