var the_timeout;
var move;
var interval_ID;
var maxWidth;



function stopMenu()
{
clearInterval(interval_ID);
}

function startMenu(step)
{
interval_ID = setInterval('moveDiv("menuTabs",'+step+');',15);
}

function position()
{
	try{
		if(CurrentPosition)
		{
			if(CurrentPosition > 0.7)
			{
				moveDiv("menuTabs",(-maxWidth + 810));
			}
			if(CurrentPosition < 0.7 && CurrentPosition > 0.5)
			{
				moveDiv("menuTabs",(-maxWidth + 1000));
			}	
		}
	
	}catch(error){}
	
}

function moveDiv(divID,step)
{
  // get the stylesheet
  //
  var the_style = getStyleObject(divID);
		
  if (the_style)
  {
    // get the current coordinate and add 5
    //
    var current_left = parseInt(the_style.left);
    var new_left = current_left + step;

    // set the left property of the DIV, add px at the
    // end unless this is NN4
    //
		//alert(step);
		//alert(current_left);
		
		if(step > 0 && current_left < 0 ){
		
			if (document.layers) 
			{
				the_style.left = new_left;
			}
			else 
			{  
				the_style.left = new_left + "px";
			}
		}
		if(step < 0 && current_left > (-maxWidth + 810)){
		
			if (document.layers) 
			{
				the_style.left = new_left;
			}
			else 
			{  
				the_style.left = new_left + "px";
			}
		}
		
  }
}


function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its
    if(document.getElementById && document.getElementById(objectId)) {
	// W3C DOM
	return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	// MSIE 4 DOM
	return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	// NN 4 DOM.. note: this won't find nested layers
	return document.layers[objectId];
    } else {
	return false;
    }
} // getStyleObject
