/* TIMER */

var timerID = 0;
var tStart  = null;
var direct = 1;
var wait = 6000;
var setwait = wait;
var interrupt = 0;


function UpdateTimer() {
   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }

   if(!tStart)
      tStart   = new Date();

   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();

   tDate.setTime(tDiff);
 
   if (interrupt == 0) {
	   if (direct == 1) {
	   		SlideBoxTop.slideRight();
	   		wait = setwait;
	   		if (SlideBoxTop.actualTime == 0) {
	   			direct = 0;
	   			wait = 0;
	   		}
	   } else {
	   	    SlideBoxTop.slideLeft();	
	   	    wait = setwait;
	   	    if (SlideBoxTop.actualTime == 0) {
	   			direct = 1;
	   			wait = 0;
	   	    }
	   }
   } else {
   	  interrupt = 0;	
   	  wait = setwait;
   }
   
   timerID = setTimeout("UpdateTimer()", wait);
}

function Start() {
   tStart   = new Date();

   timerID  = setTimeout("UpdateTimer()", wait);
}

function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }

   tStart = null;
}

function showFilter() {
	elm = document.getElementById("layout-body-filter").className;
	if (elm && elm == "visible") {
		document.getElementById("layout-body-filter").style.display = 'none';
		document.getElementById("layout-body-filter").style.visibility = 'hidden';
		document.getElementById("layout-body-filter").className = 'hidden';
		document.getElementById("layout-body-header-design-button-selected").id = 'layout-body-header-design-button';
	} else {
		document.getElementById("layout-body-filter").style.display = 'block';
		document.getElementById("layout-body-filter").style.visibility = 'visible';
		document.getElementById("layout-body-filter").className = 'visible';
		document.getElementById("layout-body-header-design-button").id = 'layout-body-header-design-button-selected';
	}
}
/* ///////////////////////////////////////// */
