function IsInstallUClive()
{
        	
	try{//支持
		var liveobject=new ActiveXObject("'ULIVECTRL.ULiveCtrlCtrl.1'");
		var varRet = liveobject.Play;
		
		if (varRet == true)
			return true;
		else
			return false;
			
	}catch(e){//不支持
	
		return false;
	}
	return false;
}
function DetectActiveX(CLSID,Uname)
 {
    try
    {
       var comActiveX = new ActiveXObject(Uname); 
    }
    catch(e)
    {
    	//alert(111);
 	return false;
    }  
    return true;
}
 	

function gotoerr(url)
{
	url = url ? url : "http://uc.sina.com.cn/download/ulive/SinaUClive_beta_070622.exe";
	//alert("没有安装UC live,请下载安装");
	if(confirm("没有安装UC live,是否下载安装？")){
		window.open(url);
	}
	return false;		
}

function UCliveAction(ucLiveUrl)
{
	var bRet = DetectActiveX('070CA17A-4BD2-4612-83B4-32B1B9159B47','ULIVECTRL.ULiveCtrlCtrl.1');	
	if (bRet == true)
	{		
		//location.href='UCLIVE://sdfsd';
		if(ucLiveUrl){
			window.location.href = ucLiveUrl;
		}else{
			//alert("您已经安装UC live")；
			window.location.href='UCLIVE://';
		}
	}
	else
	{		
		gotoerr();	
	}
}
			  

