/*------------------------------------------------------------------------------
Nhip Cau Dau Tu
Common Scripts
Copyright: (c) 2006 by Linh Hoat Co., Ltd. - www.linhhoat.net
------------------------------------------------------------------------------*/


/*- Add Hover Support --------------------------------------------------------*/

// dynamically adds .hover class to elements for browsers with poor :hover
// pseudo-class support. Only applied to main nav LI elements. 
// Checking for document.defaultView because checking for
// document.defaultView.getComputedStyle will generate an error in IE

function addHover() {
	if (!document.getElementById) return false;
	if (!document.getElementsByTagName) return false;
	if (!document.defaultView) {	
		nav = document.getElementById("navigation");
		if (!nav) return false;
		navListItems = nav.getElementsByTagName("li");
		for (i = 0; i < navListItems.length; i++) {
			var node = navListItems[i];
			if (node.nodeName == "LI") {
				node.onmouseover = function() {
					this.className += " hover";
				};
				node.onmouseout = function() {
					this.className = this.className.replace(" hover", "");
				};
			}
		}
	}
}

runOnLoad = function() {
	addHover();
	//AND do some more things

};

if (window.addEventListener) {
	window.addEventListener("load", runOnLoad, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", runOnLoad)
} else {
	window.onload = runOnLoad;
}


function MakeSmaller(){
//    var my_title = document.getElementById("articleTitle");//Anh hide 03.02.2009
	var my_title = document.getElementById("div_articleTitle");
	var my_detail = document.getElementById("articleDetail");
	var my_shortdesc = document.getElementById("td_shortdesc");//Anh 03.02.2009
	var my_control = document.getElementById("textSizer");
//	var idnormal = document.getElementById("anormal");
//	idnormal.style.font-weight="bold";
//	idnormal.style.color="Navy";
//	idnormal.className="normal";
	my_title.className = "title_smaller";
	my_shortdesc.className = "shortdesc_smaller";//Anh 03.02.2009
	my_detail.className = "detail_smaller";
	my_control.className = "textSizerSmaller";
	for (i=0; i<my_detail.children.length; i++)
	{
		my_detail.children[i].className = "detail_smaller";
	}
}

function MakeLarger(){
//    var my_title = document.getElementById("articleTitle");//Anh hide 03.02.2009

	var my_title = document.getElementById("div_articleTitle");
	var my_detail = document.getElementById("articleDetail");
	var my_shortdesc = document.getElementById("td_shortdesc");//Anh 03.02.2009
	var my_control = document.getElementById("textSizer");
	var idlarge = document.getElementById("alarge");
//	idlarge.style.font-weight="bold";
//	idlarge.style.color="Navy";
	idlarge.className="large";
	my_title.className = "title_larger";
	my_shortdesc.className = "shortdesc_larger";//Anh 03.02.2009
	my_detail.className = "detail_larger";
	my_control.className = "textSizerLarger";
	for (i=0; i<my_detail.children.length; i++)
	{
		my_detail.children[i].className = "detail_larger";
	}
}