function showTab(id, numId)
{
	var identity = document.getElementById(id);

	var status = identity.style.display;



	var toHide = document.getElementById('web');
	toHide.style.display = 'none';
	var toHide = document.getElementById('ad3d');
	toHide.style.display = 'none';
	var toHide = document.getElementById('lightad');
	toHide.style.display = 'none';

	identity.style.display = 'block';
} 

function overStyle(id)
{
	var menu = document.getElementById('menu'+id);
	menu.className = "menu"+id+"Over";
}

function outStyle(id)
{
	var menu = document.getElementById('menu'+id);
	menu.className = "menu"+id;
}

function showDiv(id)
{
	var identity = document.getElementById(id);

	var status = identity.style.display;

	if (status == 'block') {
		identity.style.display = 'none';
	} else {
		identity.style.display = 'block';
	}
} 

function showTab(id, numId)
{
	var identity = document.getElementById(id);

	var status = identity.style.display;

	var toHide = document.getElementById('expolinc');
	toHide.style.display = 'none';
	var toHide = document.getElementById('cable');
	toHide.style.display = 'none';
	var toHide = document.getElementById('digital');
	toHide.style.display = 'none';

	identity.style.display = 'block';
} 


function changeNewsTextSize(type)
{
	var body = $('newsBody');
	if (type == 0) {
		if (body.className == 'newsBodyHuge') {
			body.className = 'newsBodyBig';
		} else if (body.className == 'newsBodyBig') {
			body.className = 'newsBodyNormal';
		} else if (body.className == 'newsBodyNormal') {
			body.className = 'newsBodySmall';
		}
	}

	if (type == 1) {
		if (body.className == 'newsBodyBig') {
			body.className = 'newsBodyHuge';
		} else if (body.className == 'newsBodyNormal') {
			body.className = 'newsBodyBig';
		} else if (body.className == 'newsBodySmall') {
			body.className = 'newsBodyNormal';
		}
	}
}

function showNews(newsCatId)
{
	for (var i = 1; i != 5; i++) {
		$('newsTab'+i).className = "newsInActive";
		$('newsDisplay'+i).className = "hidden";
	}

	$('newsDisplay'+newsCatId).className = "visible";
	$('newsTab'+newsCatId).className = "newsActive";
}

function showSearch(searchId)
{
	for (var i = 1; i != 5; i++) {
		$('searchTab'+i).className = "searchInActive";
		$('searchDisplay'+i).className = "hidden";
	}

	$('searchDisplay'+searchId).className = "visible";
	$('searchTab'+searchId).className = "searchActive";
}

function mouseOver(id, type)
{
	if ($(type+'Tab'+id).className == type+"InActive") {
		$(type+'Tab'+id).className = type+"InActiveOver";
	} else {
		$(type+'Tab'+id).className = type+"ActiveOver";
	}
}

function mouseOut(id, type)
{
	if ($(type+'Tab'+id).className == type+"InActiveOver") {
		$(type+'Tab'+id).className = type+"InActive";
	} else {
		$(type+'Tab'+id).className = type+"Active";
	}
}

function productImage(image, name, width, height)
{
	window.open('/9/'+image+'/'+name, 'productDetail', 'width='+width+',height='+height+',status=yes,resizable=no,dependent=yes,alwaysRaised=yes');
}

// ROLLOVER MENU CODE

var active = 0;
var oldId = 0;
var img = new Array();

function hide() {
	if (active == 0) {
		if (oldId != 1) {
			if(document.getElementById('popup'+oldId)) {
				document.getElementById('popup'+oldId).style.visibility = "hidden" ;
			}
		}
	}
}

function popupOn(id) {
	active = 1;
	if (oldId != 0) { 
		if (oldId != 1) {
		
			if(document.getElementById('popup'+oldId)) {
				document.getElementById('popup'+oldId).style.visibility = "hidden";
			}
		}
	}
	oldId = id;
	if (oldId != 1) {
		if(document.getElementById('popup'+oldId)) {
			document.getElementById('popup'+id).style.visibility = "visible";

			var width = getWinWidth();

			var menu = document.getElementById('menu'+id);
			var coords = findPos(menu);

			var menuLeft = coords[0] - (width - 962) / 2;
			document.getElementById('popup'+id).style.left = menuLeft + 'px';
		}
	}
}

function popupOver() {
	active = 1;
}

function popupOff() {
	active = 0;
	if (oldId == 1)
		null;
	else
		setTimeout('hide()', 1000);
}

function findPos(obj) {
	var curleft = curtop = 0;
	if (obj.offsetParent) {
		curleft = obj.offsetLeft
		curtop = obj.offsetTop
		while (obj = obj.offsetParent) {
			curleft += obj.offsetLeft
			curtop += obj.offsetTop
		}
	}
	return [curleft,curtop];
}

function getWinWidth() {
  var myWidth = 0;
  if( typeof( window.innerWidth ) == 'number' ) {
    //Non-IE
    myWidth = window.innerWidth;
  } else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
    //IE 6+ in 'standards compliant mode'
    myWidth = document.documentElement.clientWidth;
  } else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
    //IE 4 compatible
    myWidth = document.body.clientWidth;
  }
  return myWidth;
}