function $(id){ return document.getElementById(id); }
function removeChildNodes(id){ e = $(id); while(e.hasChildNodes){ e.removeChild(e.firstChild); } }
function toggleVisible(id) { var e = $(id); e.style.display = e.style.display ? "" : "none"; }
function hide(id){ $(id).style.display = "none"; }
function show(id){ $(id).style.display = ""; }



function mouseX(ev) {
	if (ev.pageX) return ev.pageX;
	else if (ev.clientX) return ev.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
	else return null;
}
function mouseY(ev) {
	if (ev.pageY) return ev.pageY;
	else if (ev.clientY) return ev.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
	else return null;
}




/* IE have difficulty with following stdEventProc */
//window.onload = stdOnLoadProc;
//window.onclick = stdOnClickProc;
//window.onmousedown = stdOnMouseDownProc;
//window.onmouseup = stdOnMouseUpProc;
//window.onkeydown = stdOnKeyDownProc;
//window.onkeyup = stdOnKeyUpProc;







function headerTab(t){
	$("headerTab_all").className=(t=="all"?"section_tabs_current":"");
	$("headerTab_web").className=(t=="web"?"section_tabs_current":"");
	$("headerTab_video-retail").className=(t=="video-retail"?"section_tabs_current":"");
	setCookie("headerTab",t,7);
}



function menuToggle(id){
	toggleVisible(id+'_container');
	
	if( $(id+'_container').style.display=='none' ){
		setCookie(id, 'off', 7);
		if( $(id+'_switch').src.indexOf('orange')>=0 ){
			$(id+'_switch').src = '/images/menu_orange_open.gif';
		}else{
			$(id+'_switch').src = '/images/menu_blue_open.gif';
		}
	}else{
		setCookie(id, 'on', 7);
		if( $(id+'_switch').src.indexOf('orange')>=0 ){
			$(id+'_switch').src = '/images/menu_orange_close.gif';
		}else{
			$(id+'_switch').src = '/images/menu_blue_close.gif';
		}
	}
}


