activ = null;
activ_background = null;

backgrounds = new Array();
backgrounds['about'] = new Array();
backgrounds['about']['closed'] = new Image();
backgrounds['about']['closed'].src = '/static_media/css_lib/images/content/li-closed.gif';
backgrounds['about']['open'] = new Image();
backgrounds['about']['open'].src = '/static_media/css_lib/images/content/li-open.gif';
backgrounds['press'] = new Array();
backgrounds['press']['closed'] = new Image();
backgrounds['press']['closed'].src = '/static_media/css_lib/images/content/press/expand.gif';
backgrounds['press']['open'] = new Image();
backgrounds['press']['open'].src = '/static_media/css_lib/images/content/press/collapse.gif';
backgrounds['products'] = new Array();
backgrounds['products']['closed'] = new Image();
backgrounds['products']['closed'].src = '/static_media/css_lib/images/content/press/expand.gif';
backgrounds['products']['open'] = new Image();
backgrounds['products']['open'].src = '/static_media/css_lib/images/content/press/collapse.gif';
backgrounds['sync'] = new Array();
backgrounds['sync']['closed'] = new Image();
backgrounds['sync']['closed'].src = '/static_media/css_lib/images/content/sync/expand.gif';
backgrounds['sync']['open'] = new Image();
backgrounds['sync']['open'].src = '/static_media/css_lib/images/content/sync/collapse.gif';

/**
 * rt66_toggle
 */
function rt66_toggle(obj, curr_element, bg_sec, accordeon, horizontal)
{
	var el = getObj(obj);
	var background_el = getObj(curr_element);
	
	if (accordeon == 1)
	{ // accordeon style
		if (el.style.display != 'none') 
		{
			el.style.display = 'none';
			background_el.style.backgroundImage = 'url(' + backgrounds[bg_sec]['closed'].src + ')';
		}
		else 
		{
			el.style.display = '';
			background_el.style.backgroundImage = 'url(' + backgrounds[bg_sec]['open'].src + ')';		
		}
	}
	else
	{ // tabs style
		classes = new Array();
		
		if (horizontal)
		{ // horizontal sytle
			classes['active'] = 'tab_name_active';
			classes['inactive'] = 'tab_name';	
		}
		else
		{ // vertical style
			classes['active'] = 'product_active';
			classes['inactive'] = 'product_categories';	
		}
		
		if(activ_background)
		{
			activ_background.className = classes['inactive'];
		}
		
		if (activ)
		{
			activ.style.display = "none";
		}
		
		activ_background = background_el;
		activ = el;
		el.style.display = "block";
		background_el.className = classes['active']; 	
	}
}

/**
 * getObj
 * 
 * get the corresponding element
 */
function getObj(name)
{
	if (document.getElementById)
	{
		element = document.getElementById(name);
	}
	else if (document.all)
	{
		element = document.all[name];
	}
	else if (document.layers)
	{
		element = document.layers[name];
	}
	return element;
}