﻿function ShowHideSubMenuDiv(SubMenuDivID)
{
	subMenu = document.getElementById(SubMenuDivID);
	
	if (subMenu.className == "hidden")
		subMenu.className = "SubMenuDiv";
	else
		subMenu.className = "hidden";
}

function findPos(obj) {
	var curleft = curtop = 0;

	if (obj.offsetParent) {
	    do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
	}
	return [curleft,curtop];
}

function setLangTipDiv() {
    langTipDiv = document.getElementById("LanguageTipDiv");                 
	if (langTipDiv != null) 
	{
		langDiv = document.getElementById("ENLangDiv");
		pos = findPos(langDiv);
        langTipDiv.style.top = pos[1] + langDiv.offsetHeight - 2 + "px";
		langTipDiv.style.display = "block";
		langTipDiv.style.left = pos[0] + langDiv.offsetWidth/2 - langTipDiv.offsetWidth + 60 + "px";
	
	}
}

window.onresize = function(event) {
    setLangTipDiv();
}

onload = function()
{
    //alert(document.getElementById("LeftNavDiv").offsetHeight + ", " + document.getElementById("MainContentDiv").offsetHeight);
	document.getElementById("PageSplitterMiddleDiv").style.height = document.getElementById("LeftNavDiv").offsetHeight - 720 + "px";
	
	// Set the position of the language tip division                        
    setLangTipDiv();
	
	//alert(document.getElementById("PageSplitterDiv").offsetHeight);
}

/*
function tS(){ x=new Date(); x.setTime(x.getTime()); return x; } 
function lZ(x){ return (x>9)?x:'0'+x; }
function tH(x){ ap=(x>11)?'pm':'am'; if(x==0){ x=12; } return (x>12)?x-=12:x; } 
function fY(x){ return (x<500)?x+1900:x; } 
function dT(){ if(fr==0){ fr=1; document.write('<span id="tP" style="font-weight: bold;">'+eval(oT)+'</span>'); } tP.innerText=eval(oT); setTimeout('dT()',1000); } 
var dN=new Array('Chủ Nhật','Thứ Hai','Thứ Ba','Thứ Tư','Thứ Năm','Thứ Sáu','Thứ Bảy'),mN=new Array('/1','/2','/3','/4','/5','/6','/7','/8','/9','/10','/11','/12'),ap,fr=0,oT="dN[tS().getDay()]+', ' +' '+tS().getDate()+mN[tS().getMonth()]+'/'+fY(tS().getYear())";

function dT_EN(){ if(fr_EN==0){ fr_EN=1; document.write('<span id="tP_EN" style="font-weight: bold;">'+eval(oT_EN)+'</span>'); } tP_EN.innerText=eval(oT_EN); setTimeout('dT_EN()',1000); } 
var dN_EN=new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday'),mN_EN=new Array('January','February','March','April','May','June','July','August','September','October','November','December'),ap_EN,fr_EN=0,oT_EN="dN_EN[tS().getDay()]+', ' +' '+mN_EN[tS().getMonth()]+' '+tS().getDate()+', '+fY(tS().getYear())";
*/
