var activeElement=false;
var activeLast=false;

var showedElement=false;
var showedLast=false;
var shortActiveElement=false;

var lastActiveBottom=false;
var timeOut=false;
function showGoBeyondPromo(goBoo){
 if(goBoo){
  }
}
function initMenu()
{
	var childs=document.getElementById('menu_container').getElementsByTagName('a');
	
	for(var i=0; i<childs.length; i++)
	{
		if(childs[i].id=='h_active')
		{
			activeElement=childs[i];
			
			showedLast=document.getElementById( childs[i].getAttribute('rel'));
		}
		childs[i].onmouseover=active;
		childs[i].onmouseout=unactive;
	}
	document.getElementById('sub_header_menu').onmouseover=blockUnactive;
	document.getElementById('sub_header_menu').onmouseout=unactive;
  
	if(document.getElementById('left_main_content')) 
	childs=document.getElementById('left_main_content').getElementsByTagName('div');
	
	for(var i=0; i<childs.length; i++)
	{
		if(childs[i].id)
		{
			if(childs[i].id.match(/^thumb/g))
			{
			//alert(childs[i]);
				childs[i].onmouseover=active_bottom;
				
				if(childs[i].className=='bottom_active')
				{
					lastActiveBottom=childs[i];

					var big=lastActiveBottom.id.match(/[0-9]/);
					
					if(document.getElementById('big_'+big))
					{
						document.getElementById('big_'+big).style.display='block';
					}
				}
				//childs[i].onmouseover=active_bottom;
			}
		}
	}

}

function blockUnactive(e)
{
	e=e||event;
	
	var target=false;
	
	if(e.srcElement) target=e.srcElement;
	else target=e.target;
	
	clearTimeout(timeOut);
  }

function active(e)
{
	e=e||event;
	
	var target=false;
	  
	if(e.srcElement) target=e.srcElement;
	else target=e.target;
	
	activeElement.id='';
	if(shortActiveElement)  shortActiveElement.id='';
	
	shortActiveElement=target;
	
	shortActiveElement.id='h_active';
	
	clearTimeout(timeOut);
	if(showedLast) showedLast.style.display='none';
	
	showedLast=document.getElementById( target.getAttribute('rel') );
	showedLast.style.display='block';

	
}

function unactive()
{
  
	timeOut=setTimeout(unactiveDone, 1000); 
}

function unactiveDone()
{
	if(shortActiveElement) shortActiveElement.id='';
  activeElement.id='h_active';
	if(showedLast) showedLast.style.display='none';
	showedLast=document.getElementById( activeElement.getAttribute('rel') );
	showedLast.style.display='block';
}
function active_bottom(e)
{

	e=e||event;
	var target=false;
	
	if(e.srcElement) target=e.srcElement;
	else target=e.target;
	var big=0;
	
	if(lastActiveBottom && !target.getAttribute('href') && target!=lastActiveBottom)
	{
		
		
		lastActiveBottom.className='';
		big=lastActiveBottom.id.match(/[0-9]/);
		
		if(document.getElementById('big_'+big))
		{
			document.getElementById('big_'+big).style.display='none';
		}
		
		
		
	
	}
	
	if(!target.getAttribute('href') && target!=lastActiveBottom)
	{
		lastActiveBottom=target;
		lastActiveBottom.className='bottom_active';
		
		big=lastActiveBottom.id.match(/[0-9]/);
		
		if(document.getElementById('big_'+big))
		{
			document.getElementById('big_'+big).style.display='block';
		}
	}
	
}
	

function showParams(obj)
{
	var str='';
	for(i in obj)
	{
		str+=i+':'+obj[i]+"\n";
	}
	return str;
}


function writeFlash(movie, id, width, height, play, loop, quality, Scale, WMode, Menu, SAlign, Align, bgcolor, base, FlashVars, DivID){
	var strFlash = "";
	strFlash = '<OBJECT classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" style="Z-INDEX:0" codebase="http://active.macromedia.com/flash2/cabs/swflash.cab#version=4,0,0,0" ';
	strFlash += 'Width="' + width + '" ';
	strFlash += 'Height="' + height + '" ';
	strFlash += 'ID="' + id + '" >';
	strFlash += '<PARAM NAME="Movie" value="' + movie + '" />';
	strFlash += '<PARAM NAME="Width" value="' + width + '" />';
	strFlash += '<PARAM NAME="Height" value="' + height + '" />';
	strFlash += '<PARAM NAME="Play" value="' + play + '" />';
	strFlash += '<PARAM NAME="Loop" value="' + loop + '" />';
	strFlash += '<PARAM NAME="Quality" value="' + quality + '" />';
	strFlash += '<PARAM NAME="Scale" value="' + Scale + '" />';
	if (WMode.toLowerCase() == "transparent")
	{
		strFlash += '<PARAM NAME="WMode" value="' + WMode + '" />';
	}
	strFlash += '<PARAM NAME="Menu" value="' + Menu + '" />';
	strFlash += '<PARAM NAME="SAlign" value="' + SAlign + '" />';
	strFlash += '<PARAM NAME="Align" value="' + Align + '" />';
	strFlash += '<PARAM NAME="BGColor" value="' + bgcolor + '" />';
	strFlash += '<PARAM NAME="Base" value="' + base + '" />';
	strFlash += '<PARAM NAME="flashvars" value="' + FlashVars + '" />';
	strFlash += '<EMBED ';
	strFlash += 'NAME="' + id + '" ';
	strFlash += 'TYPE="application/x-shockwave-flash" ';
	strFlash += 'PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" ';
	strFlash += 'src="' + movie + '" ';
	strFlash += 'width="' + width + '" ';
	strFlash += 'height="' + height + '" ';
	strFlash += 'Play="' + play + '" ';
	strFlash += 'loop="' + loop + '" ';
	strFlash += 'Quality="' + quality + '" ';
	strFlash += 'Scale="' + Scale + '" ';
	if (WMode.toLowerCase() == "transparent")
	{
		strFlash += 'WMode="' + WMode + '" ';
	}
	strFlash += 'Menu="' + Menu + '" ';
	strFlash += 'SAlign="' + SAlign + '" ';
	strFlash += 'Align="' + Align + '" ';
	strFlash += 'bgcolor="' + bgcolor + '" ';
	strFlash += 'base="' + base + '" ';
	strFlash += 'flashvars="' + FlashVars + '">';
	strFlash += '</EMBED>';
	strFlash += '</OBJECT>';
	if (arguments[15]){
		if (document.getElementById){
			document.getElementById(arguments[15]).innerHTML = strFlash;
		}
	}
	else{
		document.write(strFlash);
	}
} 

function showExpandablePromo(){
document.getElementById("flyout").style.visibility = "visible";
}
function hideExpandablePromo(){
document.getElementById("flyout").style.visibility = "hidden";
}	
function execMouseover(){
showExpandablePromo();
if (typeof offTimer != "undefined"){
	clearTimeout(offTimer);
}
}
function execMouseout(){
offTimer = setTimeout("hideExpandablePromo()", 1000);
}

function test(text)
{
document.getElementById('test').innerHTML=text;
}

