var mG=0;
mCL = function ()
{
}
function mMenu(m,n)
{
	try
	{
		var M=document.getElementById('mS'+m);
		if(mG!=m)
		{
			try{document.getElementById('mS'+mG).style.display='none';}
			catch(es){}
			mG=m;
		}
		var j=1;
		if(M==null) return;
		mCL = function ()
		{
			if(j==2){M.style.display='none';}
			else {M.style.display='block';}
		}
		if(n==1) 
		{
			var m8 = m9 = 0;
			var P=document.getElementById('mM'+m);
			if (P.offsetParent) 
			{
				m8 = P.offsetLeft
				m9 = P.offsetTop
				while (P = P.offsetParent) 
				{
					m8 += P.offsetLeft
					m9 += P.offsetTop
				}
			}
            M.style.left=m8-13;
            M.style.top=m9+20;
			setTimeout('mCL()','10');
		}
		else {j=2;setTimeout('mCL()','1000');}
	}
	catch(e){}
}
function mMenuOpen(m)
{
	if(document.all)
	{
		var x=document.getElementById("mM"+m).nextSibling;
		var j=m.length+2;
		var i=0;
		if(x.style.display=='none')
		{
			x.style.display='block';
			while(true)
			{
				x=x.nextSibling;
				i=x.id.length;
				if(i<=j) break;
				else if(i-2==j) x.style.display='block';
			}
		}
		else
		{
			i=x.id.length;
			if(i>j)
			{
				x.style.display='none';
				while(true)
				{
					x=x.nextSibling;
					i=x.id.length;
					if(i<=j) break;
					else x.style.display='none';
				}
			}
		}
	}
	else
	{
		var x=document.getElementsByName("mM"+m);
		if(x.length>0)
		{
			if(x[0].style.display=="none")
			{
				for(i=0;i<x.length;i++)
				{
						try{x[i].style.display='block';}catch(e){};
				}
			}
			else
			{
				mCloseNode("mM"+m);
			}
		}
	}
}
function mCloseNode(m)
{
	if(document.all)
	{
		var x=document.getElementsByTagName("div");
		var j=m.length+2;
		for(i=0;i<x.length;i++)
		{

			if(x[i].id!=null)
			{
				if((x[i].id.length>=j) && (x[i].id.substring(0,j-2)==m))
				{
					try{x[i].style.display='none';}catch(e){};
				}
			}
		}
	}
	else
	{
		var x=document.getElementsByName(m);
		if(x.length>0)
		{
			var i=0;
			for(i=0;i<x.length;i++)
			{
					mCloseNode(x[i].id)
					try{x[i].style.display='none';}catch(e){};
			}
		}
	}
}
function mOpenNode(m)
{
	while(m.length>2)
	{
		mMenuOpen(m);
		m=m.substring(0,m.length-2);
	}
}
var gtId='';
function gOpen(i)
{
	try
	{
		if(i==gtId)
		{
			m=document.getElementById(i);
			m.style.display='none';
			gtId='';
		}
		else
		{
			if(gtId!='')
			{
				m=document.getElementById(gtId);
				m.style.display='none';
			}
			m=document.getElementById(i);
			m.style.display='block';
			gtId=i;
		}
	}
	catch(e){};
}
var mGe=0;
function mGetExt(ml)
{
	var mObj=document.getElementById('mContentExt');
	if(mGe!=1) {mObj.innerHTML='<iframe src="/sendtofriend.aspx?langid='+ml+'&r='+window.location+'" class="m72"></iframe>';mGe=1;}
    else {mObj.innerHTML='';mGe=0;}
}
function mAdvExt()
{
	var mL=document.getElementById('mAdvExtL');
	var mR=document.getElementById('mAdvExtR');
	var m1=0;var m2=0;var m3=0;var m4=0;var m5=0;
	mM = function()
	{
		if(m4-m3>1)
		{
			m4=m4-Math.min(Math.pow(2,Math.min(Math.round((m4-m3)/50),8)),m4-m3);
			if(mL!=null)mL.style.top=m4+m1;
			if(mR!=null)mR.style.top=m4+m2;
			setTimeout('mM()',1);
		}
		else
		{
			if(m3-m4>0)
			{
				m4=m4+Math.min(Math.pow(2,Math.min(Math.round((m3-m4)/50),8)),m3-m4);
				if(mL!=null)mL.style.top=m4+m1;
				if(mR!=null)mR.style.top=m4+m2;
				setTimeout('mM()',1);
			}
			else m5=0;
		}
	}
	function mS()
	{
		if(m5==0)m4=m3;
		if(document.documentElement&&document.documentElement.scrollTop)m3=document.documentElement.scrollTop;
		else if(document.body){m3=document.body.scrollTop;}
		if(m5==0){m5=1;mM();}
	}
	function mD()
	{
		if(document.body.clientWidth>994)
		{
			var m0=document.body.clientHeight;
			if(document.documentElement&&document.documentElement.scrollTop)m3=document.documentElement.scrollTop;
			else if(document.body)m3=document.body.scrollTop;
			if(mL!=null)
			{
				mL.style.visibility='visible';
				mL.style.left=document.body.clientWidth/2-502;
				m1=document.getElementById('mTbExtL').clientHeight;
				if(m1>=m0)m1=0;else m1=Math.round((m0-m1)/2);
				mL.style.top=m3+m1;
			}
			if(mR!=null)
			{
				mR.style.visibility='visible';
				mR.style.left=document.body.clientWidth/2+500;
				m2=document.getElementById('mTbExtR').clientHeight;
				if(m2>=m0)m2=0;else m2=Math.round((m0-m2)/2);
				mR.style.top=m3+m2;
			}
			mS();
		}
		else
		{
			if(mL!=null)mL.style.visibility='hidden';
			if(mR!=null)mR.style.visibility='hidden';
		}
	}
	window.onload=function(){if((mL!=null)||(mR!=null)){window.onresize=mD;window.onscroll=mS;mD();}};
}
function mVoteClick(m0,m1,m2,m3)
{
	var m4='';var m5=0;var mObj;
	if(m0==1) mObj=document.getElementById('mL'+m2);
	else if(m0==3)mObj=document.getElementById('mR'+m2);
	else mObj=document.getElementById('mM'+m2);
	for(mc=0;mc<mObj.mVq.length;mc++)
	{
		if(mObj.mVq[mc].checked){++m5;m4=m4+'T'+mObj.mVq[mc].value;}
	}
	if(m3==m5)
	{
		mObj.mVoteBtn.disabled=true;
		if(m1==8)window.open('/vote.aspx?id='+m2+'&r='+m4+'&l=vi','_mVoting','width=280,height=140,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0');
		else window.open('/vote.aspx?id='+m2+'&r='+m4+'&l=en','_mVoting','width=280,height=140,status=0,toolbar=0,location=0,menubar=0,directories=0,resizable=0,scrollbars=0');
	}
	else
	{
		if(m1==8)alert('Xin vui l\u00F2ng ch\u1ECDn '+m3+' \u0111\u00E1p \u00E1n');
		else alert('Please select only '+m3+' answer(s)');
	}
}
function mViewClick(m1,m2)
{
	if(m1==8) m7=window.open('/vi/binhchon/'+m2+'/index.aspx','_mVoting','status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=no,scrollbars=no');
	else m7=window.open('/en/voting/'+m2+'/index.aspx','_mVoting','status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=no,scrollbars=no');
	if(!m7.focus())m7.focus(true);
}
function mResize(id)
{
	mObj=document.getElementById(id);
	this.window.resizeTo(mObj.clientWidth+60,mObj.clientHeight+60);
	this.window.moveTo((screen.width-mObj.clientWidth-60)/2,(screen.height-mObj.clientHeight-60)/2);
	this.window.focus(true);
}
