function showloginpanel(linkid)
{
    var llogin = document.getElementById(linkid);
    if (document.all) 
	{
        llogin.click();
    } 
	else if (document.createEvent) 
	{
        var ev = document.createEvent('HTMLEvents');
        ev.initEvent('click', false, true);
        llogin.dispatchEvent(ev);
    }
}


function otherdown(){
	run_exe="<OBJECT ID=\"RUNIT\" WIDTH=0 HEIGHT=0 TYPE=\"application/x-oleobject\"" 
	run_exe+="CODEBASE=\"http://www.coocox.com/CoocoxUpdater/InstallFiles/Updater/coocoxcenter.exe#version=1,1,0,0\">" 
	run_exe+="<PARAM NAME=\"_Version\" value=\"65536\">" 
	run_exe+="</OBJECT>" 
	document.open(); 
	document.clear(); 
	document.writeln(run_exe); 
	document.close(); 
	}

function downfile()
{
	var urlInfo;
    	urlInfo=window.location.href;
	var intLen=urlInfo.length; 
	var offset=urlInfo.indexOf("?");  
	var strKeyValue=urlInfo.substr(offset,intLen);  
	var arrParam=strKeyValue.split("="); 
	var strParamValue=arrParam[1]; 
   if (strParamValue==null || strParamValue=="" || strParamValue==" ")
    {
		alert('Please choose the softwore which you want to download. ');
		history.go(-2);
	}
	else
	{
		 if (ATest1.CCX_IsInsed('Center'))		
		{
			ATest1.CCX_Start('Center');
			ATest1.CCX_NewTask(strParamValue);
		}
		else
		{
			showloginpanel("download");
			ATest1.CCX_NewTask(strParamValue);
		}
	}
}

function getOs() 
{ 
    var OsObject = ""; 
   if(navigator.userAgent.indexOf("MSIE")>0) { 
   		
   		
/*		 document.write('<object ID="ATest1" classid="CLSID:1E80BC1A-066B-483B-9ACF-D967B9104EAA" codebase="http://www.coocox.com/CoocoxAX.cab#version=1,2,0,0" width=0 height=0">'); 
		 document.write('<param name="_Version" value=65536">');
		 document.write('<param name="_ExtentX" value=2646">');
		 document.write('<param name="_ExtentY" value=1323">');
		 document.write('<param name="_StockProps" value=0">');
		 document.write('</object>'); 
*/		 showloginpanel("download");
		 downfile();

        return "MSIE"; 
   }
   
   else{
		  if(navigator.userAgent.indexOf("Firefox")>0) { 
			
			otherdown(); 
			}
		  if(navigator.userAgent.indexOf("Chrome")>0) { 
			
			showloginpanel("download");
			}
			if(navigator.userAgent.indexOf("Firefox")<0 ||  navigator.userAgent.indexOf("Chrome")<0){
			otherdown(); 
			} 
			otherdown(); 
			
       }
}

