function handleLayer(key, part) {

	var layer = key + part;
	var one = document.getElementById(layer).style;

	if (one.visibility == 'hidden') {
		hideLayer(key + 'View');
		showLayer(layer);
		showLayer('hide'+layer);
		hideLayer('show'+layer);

		var another;
		if (part == 'All'){
			another = key + 'Top';
		}
		else {
			another = key + 'All';
		}
		hideLayer(another);
		showLayer('show'+another);
		hideLayer('hide'+another);
	}
	else {
		showLayer(key + 'View');
		hideLayer(layer);
		hideLayer('hide'+layer);
		showLayer('show'+layer);
	}
}

function showLayer(o) {
	var layer = document.getElementById(o);
	var one = null;
	if (layer != null) one = layer.style;
	
	if (one != null) {
		one.visibility = 'visible';
		one.display = 'block';
	}
}

function hideLayer(o) {
	var layer = document.getElementById(o);
	var one = null;
	if (layer != null) one = layer.style;
	
	if (one != null) {
		one.visibility = 'hidden';
		one.display = 'none';
	}
}

function showabout(brand) {
	//second argument in open can not be a variable for IE
	window.open('/common/brand-about-popup.jsp?b=' + escape(brand), 'About','width=475,height=240,resizable=1,scrollbars=yes');
}

function restoreNoFollow(url, prefix) {
	if (url.indexOf(prefix) == 0 ||
		(url.indexOf("/") == 0 && url.lastIndexOf(".htm") == url.length - 4))
	    return url;

	return "/" + url + ".htm";
}

/*
window.onerror = function (msg, url, line) {
   alert("Message : " + msg );
   alert("url : " + url );
   alert("Line number : " + line );
}
*/


