// Javascripts Epoch Times

var cacheMenuId=false;
var cacheClass=false;
function activateMenu(Id)
{
	thisMenuId=document.getElementById('menu_'+Id);
	thisSubMenuId=document.getElementById('submenu_'+Id);
	thisCacheMenuId=document.getElementById('menu_'+cacheMenuId);
	thisCacheSubMenuId=document.getElementById('submenu_'+cacheMenuId);
	if(thisMenuId && Id!=cacheMenuId)
	{
		if(thisCacheMenuId)
		{
			thisCacheMenuId.className=cacheClass;
		}
		cacheClass=thisMenuId.className;
		thisMenuId.className=cacheClass+'_active';
		cacheMenuId=Id;
		if(thisSubMenuId)
		{
		 if(thisCacheSubMenuId) 
		 {
		  thisCacheSubMenuId.style.display='none';
		 }
		 thisSubMenuId.style.display='block';
		} 
		else if (thisCacheSubMenuId) 
		{
		 thisCacheSubMenuId.style.display='none';
		}
	}

  var cookie = readCookie("style");  
  var title = cookie ? cookie : getPreferredStyleSheet();  
  setActiveStyleSheet(title);

}

var cacheHoverMenuId=false;
var cacheHoverClass=false;
function menuActivateHover(Id,actie)
{
	thisMenuId=document.getElementById('menu_'+Id);
	thisCacheMenuId=document.getElementById('menu_'+cacheHoverMenuId);
	if(actie=="hover")
	{
		if(thisMenuId && Id!=cacheMenuId)
		{
			cacheHoverClass=thisMenuId.className;
			thisMenuId.className=cacheHoverClass+'_active';
			cacheHoverMenuId=Id;
		}
	}
	else
	{
		if(thisMenuId && Id!=cacheMenuId)
		{
			thisMenuId.className=cacheHoverClass;
			cacheHoverMenuId=false;
		}
	}
}

var ns4=document.layers?1:0
var ns6=document.getElementById&&!document.all?1:0 
var ie=document.all?1:0
var transparency = 100;

function fade(id,actie)
{
	if(actie=="in")
	{
		transparency=20;
	}else{
		transparency=00;
	}
	thisId=document.getElementById('img_'+id);
	if(thisId){
		if (ie) {
			if(thisId){
				thisId.filters.alpha.opacity=transparency
			}
		}
		if (ns6) {
			if(thisId){
				thisId.style.MozOpacity=transparency/100
			}
		}
	}
}
