//Max/Min Script


     function invisible()
            {              
            
		var oContent = dnn.dom.getById('dnn_ctr347_ModuleContent');
		dnn.dom.expandElement(oContent, 20);

           }
  	function invisible2()
            {              
            
		var oContent = dnn.dom.getById('dnn_ctr347_ModuleContent');
		dnn.dom.collapseElement(oContent, 20);

           }
	function invisible3()
            {              
            
		var oContent = dnn.dom.getById('dnn_ctr348_ModuleContent');
		dnn.dom.expandElement(oContent, 20);

           }
  	function invisible4()
            {              
            
		var oContent = dnn.dom.getById('dnn_ctr348_ModuleContent');
		dnn.dom.collapseElement(oContent, 20);

           }
function HienThi()
            {              
            
		var oContent = dnn.dom.getById('dnn_ctr348_ModuleContent');
		dnn.dom.collapseElement(oContent, 20);

           }

function __dnn_ContainerMaxMin_OnClick(oLnk, sContentID, mien)
{
	
	var d;
	if(mien==1)
		d= document.getElementById("mienbac").getAttribute("value");
	else if(mien==2)
		d= document.getElementById("mientrung").getAttribute("value");
	else if(mien==3)
		d= document.getElementById("miennam").getAttribute("value");
	
	//alert(d);
	window.location=d;
	//invisible(oLnk);
	//var kk=oLnk;	
	//var d= document.getElementById("d").getAttribute("value");
	//setTimeout("window.location='"+d+"'",1);
	var oContent = dnn.dom.getById(sContentID);
	if (oContent != null)
	{
		var oBtn = oLnk.childNodes[0];
		var sContainerID = oLnk.getAttribute('containerid');
		var sCookieID = oLnk.getAttribute('cookieid');
		var sCurrentFile = oBtn.src.toLowerCase().substr(oBtn.src.lastIndexOf('/'));
		var sMaxFile;
		var sMaxIcon;
		var sMinIcon;

		if (dnn.getVar('min_icon_' + sContainerID))
			sMinIcon = dnn.getVar('min_icon_' + sContainerID);
		else
			sMinIcon = dnn.getVar('min_icon');

		if (dnn.getVar('max_icon_' + sContainerID))
			sMaxIcon = dnn.getVar('max_icon_' + sContainerID);
		else
			sMaxIcon = dnn.getVar('max_icon');

		sMaxFile = sMaxIcon.toLowerCase().substr(sMaxIcon.lastIndexOf('/'));

		var iNum = 110;
		if (oLnk.getAttribute('animf') != null)
			iNum = new Number(oLnk.getAttribute('animf'));
			
		if (sCurrentFile == sMaxFile)
		{
			oBtn.src = sMinIcon;				
			//oContent.style.display = '';
			
			dnn.dom.expandElement(oContent, iNum);
			//setTimeout("invisible()",5000);
			//invisible();
			oBtn.title = dnn.getVar('min_text');
			if (sCookieID != null)
			{
				if (dnn.getVar('__dnn_' + sContainerID + ':defminimized') == 'true')
					dnn.dom.setCookie(sCookieID, 'true', 365);
				else
					dnn.dom.deleteCookie(sCookieID);
			}
			else
				dnn.setVar('__dnn_' + sContainerID + '_Visible', 'true');
		}
		else
		{
			oBtn.src = sMaxIcon;				
			//oContent.style.display = 'none';
			
			dnn.dom.collapseElement(oContent, iNum);
			//setTimeout('dnn.dom.collapseElement('+oContent+', '+iNum+');',125);
			//invisible2();
			//setTimeout("invisible2()",5000);
			oBtn.title = dnn.getVar('max_text');
			if (sCookieID != null)
			{
				if (dnn.getVar('__dnn_' + sContainerID + ':defminimized') == 'true')
					dnn.dom.deleteCookie(sCookieID);
				else
					dnn.dom.setCookie(sCookieID, 'false', 365);				
			}
			else
				dnn.setVar('__dnn_' + sContainerID + '_Visible', 'false');			
		}
		
		return true;	//cancel postback
	}
	return false;	//failed so do postback
}
function __dnn_ContainerMaxMin_OnClick2(oLnk, sContentID, mien)
{
	
	var d;
	if(mien==1)
		d= document.getElementById("mienbac_home").getAttribute("value");
	else if(mien==2)
		d= document.getElementById("mientrung_home").getAttribute("value");
	else if(mien==3)
		d= document.getElementById("miennam_home").getAttribute("value");
	//alert(d);
	window.location=d;
	//invisible(oLnk);
	//var kk=oLnk;	
	//var d= document.getElementById("d").getAttribute("value");
	//setTimeout("window.location='"+d+"'",1);
	var oContent = dnn.dom.getById(sContentID);
	if (oContent != null)
	{
		var oBtn = oLnk.childNodes[0];
		var sContainerID = oLnk.getAttribute('containerid');
		var sCookieID = oLnk.getAttribute('cookieid');
		var sCurrentFile = oBtn.src.toLowerCase().substr(oBtn.src.lastIndexOf('/'));
		var sMaxFile;
		var sMaxIcon;
		var sMinIcon;

		if (dnn.getVar('min_icon_' + sContainerID))
			sMinIcon = dnn.getVar('min_icon_' + sContainerID);
		else
			sMinIcon = dnn.getVar('min_icon');

		if (dnn.getVar('max_icon_' + sContainerID))
			sMaxIcon = dnn.getVar('max_icon_' + sContainerID);
		else
			sMaxIcon = dnn.getVar('max_icon');

		sMaxFile = sMaxIcon.toLowerCase().substr(sMaxIcon.lastIndexOf('/'));

		var iNum = 110;
		if (oLnk.getAttribute('animf') != null)
			iNum = new Number(oLnk.getAttribute('animf'));
			
		if (sCurrentFile == sMaxFile)
		{
			oBtn.src = sMinIcon;				
			//oContent.style.display = '';
			
			dnn.dom.expandElement(oContent, iNum);
			//setTimeout("invisible()",5000);
			//invisible();
			oBtn.title = dnn.getVar('min_text');
			if (sCookieID != null)
			{
				if (dnn.getVar('__dnn_' + sContainerID + ':defminimized') == 'true')
					dnn.dom.setCookie(sCookieID, 'true', 365);
				else
					dnn.dom.deleteCookie(sCookieID);
			}
			else
				dnn.setVar('__dnn_' + sContainerID + '_Visible', 'true');
		}
		else
		{
			oBtn.src = sMaxIcon;				
			//oContent.style.display = 'none';
			
			dnn.dom.collapseElement(oContent, iNum);
			//setTimeout('dnn.dom.collapseElement('+oContent+', '+iNum+');',125);
			//invisible2();
			//setTimeout("invisible2()",5000);
			oBtn.title = dnn.getVar('max_text');
			if (sCookieID != null)
			{
				if (dnn.getVar('__dnn_' + sContainerID + ':defminimized') == 'true')
					dnn.dom.deleteCookie(sCookieID);
				else
					dnn.dom.setCookie(sCookieID, 'false', 365);				
			}
			else
				dnn.setVar('__dnn_' + sContainerID + '_Visible', 'false');			
		}
		
		return true;	//cancel postback
	}
	return false;	//failed so do postback
}
