function getObj(name)
{
  if (document.getElementById)
  {
  	this.obj = document.getElementById(name);
	this.style = document.getElementById(name).style;
  }
  else if (document.all)
  {
	this.obj = document.all[name];
	this.style = document.all[name].style;
  }
  else if (document.layers)
  {
	this.obj = getObjNN4(document,name);
	this.style = this.obj;
  }
}

function getObjNN4(obj,name)
{
	var x = obj.layers;
	var foundLayer;
	for (var i=0;i<x.length;i++)
	{
		if (x[i].id == name)
		 	foundLayer = x[i];
		else if (x[i].layers.length)
			var tmp = getObjNN4(x[i],name);
		if (tmp) foundLayer = tmp;
	}
	return foundLayer;
}

var active_submenu;

function showSubmenu (index)
{
	hideActiveSubmenu();
	var sm = new getObj('submenu_'+index);
	if (sm)
	{
		sm.style.display = 'block';
	}
	var m = new getObj('menu_'+index);
	m.style.backgroundPosition = '0px -36px';
	m.style.color = '#ffffff';
	active_submenu = index;
}

function hideActiveSubmenu()
{
	if (active_submenu)
	{
		var sm = new getObj('submenu_'+active_submenu);		
		sm.style.display = 'none';
		var m = new getObj('menu_'+active_submenu);
		m.style.backgroundPosition = '0px 0px';
		m.style.color = '#849db4';
		active_submenu = null;
	}
}

function showProduct (location)
{
	document.location = location;
	createCookie('dragT',dragT,1);
	createCookie('contentT',contentT,1);
	createCookie('startY',startY,1);
}
function clearScroller()
{
	eraseCookie('dragT');
	eraseCookie('contentT');
}
function setScroller()
{
	if ((readCookie('dragT')))
	{
	
		dragT = readCookie('dragT');
		contentT = readCookie('contentT');
		//startY = readCookie('startY');
		moveTo();
		xUp();
		up();
		xDown();
		up();
	}

}
