/*Copyright by Nguyen Duc Minh*/;
function mCopyright()
{
	if(top.location!=window.location)top.location=window.location
}
var mG=0;
mCL = function ()
{
	if(document.all)
	{ 
		if((document.getElementById('mIam')!=null)&&(document.getElementById('mIam').getAttribute('mOnIP')!=null)) document.getElementById('mIam').style.visibility='visible'
		else if((document.getElementById('mCountryId')!=null)&&(document.getElementById('mCountryId').getAttribute('mOnIP')!=null)) document.getElementById('mCountryId').style.visibility='visible'
	}
}
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';
				if(document.all)
				{
					if((document.getElementById('mIam')!=null)&&(document.getElementById('mIam').getAttribute('mOnIP')!=null)) document.getElementById('mIam').style.visibility='visible'
					else if((document.getElementById('mCountryId')!=null)&&(document.getElementById('mCountryId').getAttribute('mOnIP')!=null)) document.getElementById('mCountryId').style.visibility='visible'
				}
			}
			else 
			{
				M.style.display='block';
				if(document.all)
				{
					if((document.getElementById('mIam')!=null)&&(document.getElementById('mIam').getAttribute('mOnIP')!=null)) document.getElementById('mIam').style.visibility='hidden'
					else if((document.getElementById('mCountryId')!=null)&&(document.getElementById('mCountryId').getAttribute('mOnIP')!=null)) document.getElementById('mCountryId').style.visibility='hidden'
				}
			}
		}
		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;
			M.style.top=m9+28;
			setTimeout('mCL()','10');
		}
		else {j=2;setTimeout('mCL()','1000');}
	}
	catch(e){}
}
function mVN(m)
{
	try
	{
		var i=1;
		C = function ()
		{
			if(i==2)
			{
				try{frames[0].window.document.mForm.m[parent.mVm].checked=true;}
				catch(ef){}
				try{window.document.mForm.m[mVm].checked=true;}
				catch(ep){}
				v.style.display='none';
			}
	        }
		v=document.getElementById('mVN');
		if(m==1) 
		{
			v.style.display='block';
			document.forms[0].m[mVm].checked=true;
		}
		else {i=2;setTimeout('C()','1000');}
	}
	catch(ee){}
}
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)
		{
			mViewClick(8,m2);
			mAjax(null,'/vi/binhchon/'+m2+'/bophieu/'+m4+'/');
		}
		else 
		{
			mViewClick(2,m2);
			mAjax(null,'/en/voting/'+m2+'/vote/'+m4+'/');
		}
	}
	else
	{
		if(m1==8)alert('Xin vui l\u00F2ng ch\u1ECDn '+m3+' \u0111áp án');
		else alert('Please select only '+m3+' answer(s)');
	}
}
function mViewClick(m1,m2)
{
	if(m1==8)mOpen('/vi/binhchon/'+m2+'/','_mVoting');
	else mOpen('/en/voting/'+m2+'/','_mVoting');
}
function mOpen(m1)
{
	window.showModalDialog(m1,window,'center:on;resizable:off;scroll:off;status:off;dialogHeight:200px;dialogWidth:200px;');
}
function mPopup(m1,m2,m3,m4)
{
	 if(m3==null) m3=280;
    if(m4==null) m4=200;
	m5=(screen.width-m3)/2;if(m5<0)m5=0;
	m6=(screen.height-m4-10)/2;if(m6<0)m6=0;
	m7=window.open(m1,m2,'width='+m3+',height='+m4+',left='+m5+',top='+m6+',status=no,toolbar=no,location=no,menubar=no,directories=no,resizable=yes,scrollbars=no');
	if(!m7.focus())m7.focus(true);
}
function mAjax(m1,m2)
{
	var m3;
	try{m3=new ActiveXObject('Msxml2.XMLHTTP');}
	catch(e)
	{
		try{m3=new XMLHttpRequest();}
		catch (e)
		{
			try{m3=new ActiveXObject('Microsoft.XMLHTTP');}
			catch(e)
			{
				alert('Your browser do not support ajax - Trình duy\u1EC7t c\u1EE7a b\u1EA1n không h\u1ED7 tr\u1EE3 ajax.');
				return false;
			}
		}
	}
	m3.onreadystatechange=function()
	{
        if(m1!=null) 
        {
		    if(m3.readyState==4) m1.innerHTML=m3.responseText;
		    else m1.innerHTML='<center><img src="/icons/wait.gif" class="z99"></center>';
        }
	};
	m3.open('GET',m2,true);m3.send(null);
}
function mAjaxG(m1,m2)
{
    if(m2==2) mAjax(document.getElementById('mGL'),'/ajax/glossary/en/'+m1+'/');
    else mAjax(document.getElementById('mGL'),'/ajax/glossary/vi/'+m1+'/');
}
function mAjaxMap(m1,m2)
{
	if(m2!=null)
	{
		mAjax(document.getElementById('mOnIPmap'),'/ajax/'+m1+'/'+m2+'/');
		var m=document.mfOnIP.mCountryId.options.length;
		for(j=0;j<m;j++)
		{
			if(document.mfOnIP.mCountryId.options[j].value==m2)
			{
				document.mfOnIP.mCountryId.selectedIndex=j;
				break;
			}
		}
	}
	else
	{
		m2=document.mfOnIP.mCountryId.options[document.mfOnIP.mCountryId.selectedIndex].value;
		mAjax(document.getElementById('mOnIPmap'),'/ajax/'+m1+'/'+m2+'/');
	}
}
function mSearch(m1,m2,m3)
{
	var m3;
	try{mH=new ActiveXObject('Msxml2.XMLHTTP');}
	catch(e)
	{
		try{mH=new XMLHttpRequest();}
		catch (e)
		{
			try{mH=new ActiveXObject('Microsoft.XMLHTTP');}
			catch(e)
			{
				alert('Your browser do not support ajax - Trình duy\u1EC7t c\u1EE7a b\u1EA1n không h\u1ED7 tr\u1EE3 ajax.');
				return false;
			}
		}
	}
	mH.onreadystatechange=function()
	{
		    if(mH.readyState==4) document.getElementById('mOnIP').innerHTML=mH.responseText;
		    else document.getElementById('mOnIP').innerHTML='<center><img src="/icons/wait.gif" class="z99"></center>';
	};
    mF=document.forms['mZSS'];
    if(m3==0)
    {
        m3=document.mSP.mPg.options[document.mSP.mPg.selectedIndex].value;
    }
    if(m1==1)
    {
        if(m2==2)
        {
            if(mF.mQ.value.length!=0)
            {
                if((''+window.location).indexOf('#search/')<2)window.location=window.location+'#search/';
                var p='mQ='+mF.mQ.value;mH.open('POST','/ajax/search/P'+m3+'/',true);
                mH.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
                mH.setRequestHeader('Content-length', p.length)
                mH.setRequestHeader('Connection', 'close');
                mH.send(p);
            }
            else alert('Please enter at least one word to search for');
        }
        else
        {
            if(mF.mQ.value.length!=0)
            {
                if((''+window.location).indexOf('#timkiem/')<2)window.location=window.location+'#timkiem/';
                var p='mQ='+mF.mQ.value;mH.open('POST','/ajax/timkiem/T'+m3+'/',true);
                mH.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
                mH.setRequestHeader('Content-length', p.length)
                mH.setRequestHeader('Connection', 'close');
                mH.send(p);
            }
            else alert('Xin nh\u1EADp c\u1EE5m t\u1EEB tìm ki\u1EBFm');
        }
    }
    else
    {
        if(m2==2)
        {
            if((mF.mQ.value.length!=0)||(mF.mCountryId.selectedIndex!=0)||(mF.mEndUse.selectedIndex!=0))
            {
                if((''+window.location).indexOf('#search/')<2)window.location=window.location+'#search/';
                var p='mQ='+mF.mQ.value+'&mC='+mF.mCountryId.options[mF.mCountryId.selectedIndex].value+'&mB='+mF.mEndUse.options[mF.mEndUse.selectedIndex].value;mH.open('POST','/ajax/project/P'+m3+'/',true);
                mH.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
                mH.setRequestHeader('Content-length', p.length)
                mH.setRequestHeader('Connection', 'close');
                mH.send(p);
            }
            else alert('Please choose at least one search terms');
        }
        else
        {
            if((mF.mQ.value.length!=0)||(mF.mCountryId.selectedIndex!=0)||(mF.mEndUse.selectedIndex!=0))
            {
                if((''+window.location).indexOf('#timkiem/')<2)window.location=window.location+'#timkiem/';
                var p='mQ='+mF.mQ.value+'&mC='+mF.mCountryId.options[mF.mCountryId.selectedIndex].value+'&mB='+mF.mEndUse.options[mF.mEndUse.selectedIndex].value;mH.open('POST','/ajax/duan/P'+m3+'/',true);
                mH.setRequestHeader('Content-type', 'application/x-www-form-urlencoded');
                mH.setRequestHeader('Content-length', p.length)
                mH.setRequestHeader('Connection', 'close');
                mH.send(p);
            }
            else alert('Xin nh\u1EADp ho\u1EB7c ch\u1ECDn ít nh\u1EA5t 1 \u0111i\u1EC1u ki\u1EC7n tìm ki\u1EBFm');
        }
    }
    return false;
}
function mNow(d)
{
	if(document.getElementById('mNow')!=null) document.getElementById('mNow').innerHTML=d;
}
function mGlossasy(i)
{
	var mObj=document.getElementById('mGL'+i);
	if(mObj.style.display=='block')
	{
		mObj.style.display='none';
	}
	else 
	{
		mObj.style.display='block';
	}
}
function mAjaxN(m2)
{
    m0=document.forms[0];
    m1=m0.mYear.options[m0.mYear.selectedIndex].text+'/'+m0.mMonth.options[m0.mMonth.selectedIndex].text+'/';
    if(m2==2) mAjax(document.getElementById('mZSL'),'/ajax/newsletters/en/'+m1);
    else mAjax(document.getElementById('mZSL'),'/ajax/newsletters/vi/'+m1);
}
function mProduct(m)
{
	if((m) && (document.forms['mPL'].mPageId!=null)) document.forms['mPL'].mPageId.selectedIndex=0;
	document.forms['mPL'].submit()
}
var mGe=0;
function mGetExt(m1,m2,m3)
{
	var mObj=document.getElementById('mContentExt');
	if(m1==8)
	{
		switch(m2)
		{
			case 1: if(mGe!=1) {mObj.innerHTML='<iframe src="/vi/guibanbe/" class="m96"></iframe>';mGe=1;}
				    else {mObj.innerHTML='';mGe=0;}
				    break;
			case 2: if(mGe!=2) {mObj.innerHTML='<iframe src="/vi/phanhoi/banbientap/" class="m97"></iframe>';mGe=2;}
				    else {mObj.innerHTML='';mGe=0;}
				    break;
		}
	}
	else
	{
		switch(m2)
		{
			case 1: if(mGe!=1) {mObj.innerHTML='<iframe src="/en/sendtofriend/" class="m96"></iframe>';mGe=1;}
				    else {mObj.innerHTML='';mGe=0;}
				    break;
			case 2: if(mGe!=2) {mObj.innerHTML='<iframe src="/en/feedback/editorialstaff/" class="m97"></iframe>';mGe=2;}
				    else {mObj.innerHTML='';mGe=0;}
				    break;
		}
	}
}
function mResize(id)
{
	mObj=document.getElementById(id);
    if(document.all)
    {
        window.dialogWidth=mObj.clientWidth+60+'px';
        window.dialogHeight=mObj.clientHeight+60+'px';
    }
    else
    {
	    this.window.resizeTo(mObj.clientWidth+60,mObj.clientHeight+80);
	    this.window.moveTo((screen.width-mObj.clientWidth-60)/2,(screen.height-mObj.clientHeight-80)/2);
    }
}
function mProjectDetail()
{
	var mObj=document.getElementById('mPD');
	if(mObj.style.display=='block')
	{
		document['mPDI'].src='/icons/plus.gif'
		mObj.style.display='none';
	}
	else 
	{
		mObj.style.display='block';
		document['mPDI'].src='/icons/minus.gif'
	}
}
function mRun(i)
{
	Ic=Ic+i;if(Ic<0)Ic=Ia-1;else if(Ic==Ia) Ic=0;
	document['mPI'].src='/mfiles/project/'+m912C[Ic];
    document.getElementById('mPRN').innerHTML=parseInt(Ic)+1;
	if (document.all)
	{
		document.images.mPI.style.filter='revealTrans(duration=1,transition='+(Ic%23)+')';
		document.images.mPI.filters.revealTrans.apply();
		document.images.mPI.filters.revealTrans.play();
	}
}
function mAutoRun()
{
	if(Ir==1)
	{
		Ir=0;document['mPRO'].src='/mfiles/icons/stop.gif';
	}
	else 
	{
	    Ir=1;document['mPRO'].src='/mfiles/icons/auto.gif';mR();
	}
}
function mR(){if(Ir==1){mRun(1);setTimeout('mR()',mT);}}
mCopyright();
            