function checksearch()
{
	if (document.getElementById('search_input').value != '')
	{
		document.getElementById('search_input').className = 'show';
	}
	else
	{
		document.getElementById('search_input').className = 'hide';
	}
}
function tc_over(tab_container, ddcontainer, xtab)
{
	var tabs = new Array('tc1', 'tc2', 'tc3', 'tc4');
	var dropdown = new Array('wwdmenuc', 'wwdmenu', 'wwdmenub', 'wwdmenud');
	var dropdown_select = new Array('ddown1', 'ddownx1', 'ddowny1', 'ddownz1');
	
	document.getElementById(tab_container).className = 'tabcontainer_over';	
	
	for (x in tabs)
	{
		if (tabs[x] == tab_container)
		{
			document.getElementById(dropdown[x]).style.visibility = 'visible';
		}
		else if (x == xtab)
		{
			document.getElementById(tabs[x]).className = 'tabcontainer_select';
			document.getElementById(dropdown[x]).style.visibility = 'hidden';
			document.getElementById(dropdown_select[x]).className = 'dropdownmenu_over';
		}
		else
		{
			document.getElementById(tabs[x]).className = 'tabcontainer_out';	
			document.getElementById(dropdown[x]).style.visibility = 'hidden';
			document.getElementById(dropdown_select[x]).className = 'dropdownmenu_over';
		}
	}
}
function tc_out(tab_container, ddcontainer)
{
	var tabs = new Array('tc1', 'tc2', 'tc3', 'tc4');
	var dropdown = new Array('wwdmenuc', 'wwdmenu', 'wwdmenub', 'wwdmenud');
	/*
	if (tab_container != 'tc2')
	{
		document.getElementById('wwdmenu').style.visibility = 'hidden';
		document.getElementById(tab_container).className = 'tabcontainer_out';
	}
	*/
}
function sm_over(submenu)
{
	document.getElementById(submenu).className = 'submenu_over';
}
function sm_out(submenu)
{
	document.getElementById(submenu).className = 'submenu_out';
}
function ddown_over(dropdownmenu)
{
	document.getElementById(dropdownmenu).className = 'dropdownmenu_over';
}
function ddown_out(dropdownmenu)
{
	document.getElementById(dropdownmenu).className = 'dropdownmenu_out';
}
function ddown_clear(ddcontainer, tabselected, tabclass)
{
	if (tabclass != 'tabcontainer_select')
	{
		document.getElementById(tabselected).className='tabcontainer_out';
	}
	else
	{
		document.getElementById(tabselected).className='tabcontainer_select';
	}
	
	document.getElementById(ddcontainer).style.visibility='hidden'; 
	/*
	if (tabclass != 'tabcontainer_over')
	{
		document.getElementById(tabselected).className='tabcontainer_out';
	}
	
	document.getElementById(ddcontainer).style.visibility='hidden'; 
	*/
}
function ddown_clearall(xtab)
{
	var tabs = new Array('tc1', 'tc2', 'tc3', 'tc4');
	var dropdown = new Array('wwdmenuc', 'wwdmenu', 'wwdmenub', 'wwdmenud');
	
	for (x in tabs)
	{
		if (x == xtab)
		{
			document.getElementById(tabs[x]).className = 'tabcontainer_select';	
			document.getElementById(dropdown[x]).style.visibility = 'hidden';
		}
		else
		{
			document.getElementById(tabs[x]).className = 'tabcontainer_out';	
			document.getElementById(dropdown[x]).style.visibility = 'hidden';
		}
	}
}
function openPdf(num)
{
	if(num == 1)
	window.open('../pdf/Beville_release FINAL.pdf');
	if(num == 2)
	window.open('../pdf/Lake Las Vegas ownership shift FINAL.pdf');
	if(num == 3)
	window.open('../pdf/LaForgia joins Atalon Group 6.08.pdf');
	if(num == 4)
	window.open('../pdf/LLV - ReleaseFINAL.pdf');
}

function load(n){
	setTimeout("fade('f2')",2000);
	setTimeout("fade('f1')",12000);
	setTimeout("fade('f3')",18000);	
	setTimeout("fade('f3')",18000);	
	setTimeout("fade('f2')",18000);
	setTimeout("fade('f2')",18000);	
	
	if (n != 1){
		setTimeout("load("+n+"-1)", 18000);
	}
}
function setopacity(){
	var f1 = document.getElementById("f1");
	var f2 = document.getElementById("f2");
	var f3 = document.getElementById("f3");		
	
	f1.style.opacity = 0;
	f2.style.opacity = 0;
	f3.style.opacity = 0;
}

var TimeToFade = 3000.0;

function fade(eid)
{
  var element = document.getElementById(eid);
  if(element == null)
    return;
   
  if(element.FadeState == null)
  {
    if(element.style.opacity == null
        || element.style.opacity == ''
        || element.style.opacity == '1')
    {
      element.FadeState = 2;
    }
    else
    {
      element.FadeState = -2;
    }
  }
   
  if(element.FadeState == 1 || element.FadeState == -1)
  {
    element.FadeState = element.FadeState == 1 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade - element.FadeTimeLeft;
  }
  else
  {
    element.FadeState = element.FadeState == 2 ? -1 : 1;
    element.FadeTimeLeft = TimeToFade;
    setTimeout("animateFade(" + new Date().getTime()
        + ",'" + eid + "')", 33);
  } 
}
function animateFade(lastTick, eid)
{ 
  var curTick = new Date().getTime();
  var elapsedTicks = curTick - lastTick;
 
  var element = document.getElementById(eid);
 
  if(element.FadeTimeLeft <= elapsedTicks)
  {
    element.style.opacity = element.FadeState == 1 ? '1' : '0';
    element.style.filter = 'alpha(opacity = '
        + (element.FadeState == 1 ? '100' : '0') + ')';
    element.FadeState = element.FadeState == 1 ? 2 : -2;
    return;
  }
 
  element.FadeTimeLeft -= elapsedTicks;
  var newOpVal = element.FadeTimeLeft/TimeToFade;
  if(element.FadeState == 1)
    newOpVal = 1 - newOpVal;

  element.style.opacity = newOpVal;
  element.style.filter =
      'alpha(opacity = ' + (newOpVal*100) + ')';
 
  setTimeout("animateFade(" + curTick
      + ",'" + eid + "')", 33);
}
