/*
 QQLive. 
 Copyright 1998 - 2010
*/

function getId(id){return document.getElementById(id);};var QQLiveSetup={ver:"$Rev: 2100 $",curSSO:"",lastmodify:"$Date: 2010-01-26 11:30:45 +0800 (星期二, 26 一月 2010) $"};QQLiveSetup.log=function(_1){if(window.console){window.console.log(_1);}};QQLiveSetup.config={IE_MIN_VER:"8.13.4808.0",FF_MIN_VER:"8.14.4895.0",STARTUP_MIN_VER:"8.14.4895.0",IE_FLASH_MIN_VER:"9.0.124.0",FF_FLASH_MIN_VER:"10.0",QQLIVE_DOWNLOAD_URL:"qqlive",QQLIVE_DOWNLOAD_TPTURL:"",QQLIVE_INSTALLER_CAB:"http://dl_dir.qq.com/qqtv/MMInstaller.cab#version=1,0,0,3",FLASH_CAB:"http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0",FLASH_SETUP_AX:"http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player_ax.exe",FLASH_SETUP_PLUGIN:"http://fpdownload.macromedia.com/get/flashplayer/current/install_flash_player.exe",MEDIAPLAYER_DOWNLOAD_URL:"http://dl_dir.qq.com/qqtv/qqlivesetup.exe",GUIDE_SWF:"download_guide2.swf?20091116",PROGID_QQLIVE_INSTALLER:"QQLiveInstaller.InstallHelper.1",FLASH_START:"start",PAGE_LOADING:"loading",PAGE_ERROR:"error",PAGE_NONSUPPORT:"nonsupport",PAGE_PREVINSTALL:"prevInstall",PAGE_FFERROR:"errorFFF",QQLIVE_DOWNLOAD_VERSION:"QQLive 2009",QQLIVE_SWF_PATH:"http://cache.tv.qq.com/out/",QQLIVE_SWF_SKIN:"skins/"};QQLiveSetup.lang={NOTSUPPORT:"该浏览器暂不支持QQLive播放器",STEPTIPS:"请按照以下提示安装QQLive播放器",CLICKBTN:"请点击按钮开始安装QQLive播放器",LOWVERSION:"您尚未安装QQLive播放器或版本过低"};QQLiveSetup.version={compare:function(_2,_3){_2=_2.replace(/,/g,".");_3=_3.replace(/,/g,".");var _4=_2.split(".");var _5=_3.split(".");for(var i=0;i<4;i++){var _6=Number(_4[i]);var _7=Number(_5[i]);if(_6>_7){return 1;}else{if(_6<_7){return-1;}}}
return 0;},get:function(){var _8=0;QQLiveSetup.installer.installerObj=null;if(QQLiveSetup.browser.isCanFF()){QQLiveSetup.installer.installerObj=document.embeds["FF_MM_Install"];if(!QQLiveSetup.installer.installerObj){QQLiveSetup.log("cannot find embed which id is 'FF_MM_Install'");}
try{QQLiveSetup.installer.installerObj.CreateAX("MMInstall.dll");_8=QQLiveSetup.installer.installerObj.GetVersion();}
catch(e){}}else{if(!!QQLiveSetup.browser.ie){try{QQLiveSetup.installer.installerObj=new ActiveXObject(QQLiveSetup.config.PROGID_QQLIVE_INSTALLER);_8=QQLiveSetup.installer.installerObj.GetVersion();}
catch(e){}}}
QQLiveSetup.log("local player version is "+_8);return _8;},check:function(_9){var _a=QQLiveSetup.version.get();var _b;var _c=parseInt(_a/10000/100,10);var _d=parseInt(_a/10000,10)-_c*100;var _e=parseInt(_a,10)-(_c*100*10000+_d*10000);_b=_c+"."+_d+"."+_e;_9=_9||(!!QQLiveSetup.browser.ie?QQLiveSetup.config.IE_MIN_VER:QQLiveSetup.config.FF_MIN_VER);if(QQLiveSetup.version.compare(_b,_9)<0){return false;}else{return true;}}};QQLiveSetup.browser=(function(){var t,_f,vff,_10,vsf,_11,_12,_13,_14,_15,_16,_17=false,_18=false,_19=navigator.userAgent,_1a=/(?:MSIE.(\d+\.\d+))|(?:(?:Firefox|GranParadiso|Iceweasel|Minefield).(\d+\.\d+))|(?:Opera.(\d+\.\d+))|(?:AppleWebKit.(\d+(?:\.\d+)?))/,_1b=/(Windows.*?;)|(Mac OS X.*?;)/,_1c=/Windows.+?(\d+\.\d+)/,_1d=/AdobeAIR/,_1e=/Chrome.(\d+\.\d+)/,_1f=/Version\/(\d+(?:\.\d+)?)/,_20=_1a.exec(_19),os=_1b.exec(_19);if(_20){_f=_20[1]?parseFloat(_20[1],10):NaN;vff=_20[2]?parseFloat(_20[2],10):NaN;}
return{firefox:vff,ie:_f,isCanFF:function(){if(!!vff&&vff>=3){return true;}
return false;},isBrwValid:function(){return(!!_f||(!!vff&&vff>=3));}};})();QQLiveSetup.installer={timer:null,installerObj:null,isMMInstalled:function(){if(QQLiveSetup.browser.isCanFF()){var _21=document.embeds["FF_MM_Install"];try{_21.CreateAX("MMInstall.dll");return true;}
catch(e){return false;}}else{if(!!QQLiveSetup.browser.ie){try{var _22=new ActiveXObject(QQLiveSetup.config.PROGID_QQLIVE_INSTALLER);_22=null;return true;}
catch(e){return false;}}}
return false;},checkFFHasMMEmbed:function(){return!!getId("FF_MM_Install");},checkMMIsInstall:function(){if(QQLiveSetup.installer.isMMInstalled()){clearInterval(QQLiveSetup.installer.timer);QQLiveSetup.installer.timer=null;var _23=QQLiveSetup.version.check();if(!_23){if(QQLiveSetup.version.get()==0){QQLiveSetup.flash.showInstallBtn(QQLiveSetup.lang.CLICKBTN);}else{QQLiveSetup.flash.showInstallBtn(QQLiveSetup.lang.LOWVERSION);}}else{window.location.reload();}}},hide:function(){var _24=getId("QQLiveInstaller");if(!!_24){_24.style.display="none";}},autoDownload:function(){var _25=QQLiveSetup.config.PAGE_LOADING;var _26="";var _27=QQLiveSetup.version.get();if(_27==0){_26="正在下载QQLive播放器";}else{_26="版本过低，正在升级QQLive播放器";}
if(QQLiveSetup.browser.isCanFF()){_25=PAGE_ERROR;_26="您尚未安装QQLive播放器或版本过低";}else{if(!QQLiveSetup.installer.installerObj){QQLiveSetup.installer.installerObj=new ActiveXObject(QQLiveSetup.config.PROGID_QQLIVE_INSTALLER);}
try{QQLiveSetup.installer.installerObj.DownloadSetup(QQLiveSetup.config.QQLIVE_DOWNLOAD_URL,QQLiveSetup.config.QQLIVE_DOWNLOAD_TPTURL,1," /S",QQLiveSetup.installer.downloadCallBack);}
catch(e){_25=PAGE_ERROR;_26="自动安装QQLive播放器失败";}}
if(!!document["UISWF"]){document["UISWF"].showPanel(_25);document["UISWF"].changePanelTitle(_26);}},downloadCallBack:function(_28,_29){var _2a="";var _2b="";QQLiveSetup.log(_28+","+_29);switch(_28){case 0:_2a="正在准备下载...";break;case 1:if(_29>93){_29="93";}
_2a="正在下载..."+_29+"%";break;case 2:_29="96";_2a="正在安装..."+_29+"%";_2b="正在安装QQLive播放器，请稍候";break;case 3:_29="100";_2a="运行安装程序完毕!";_2b="运行安装程序完毕";break;case-1:_2a="启动下载失败！";break;case-2:_2a="安装程序被终止！";break;case-3:_2a="下载失败!";break;case-100:_2a="下载路径不合法！";break;default:_2a="未知状态！";break;}
var _2c="";if(_28==1||_28==2||_28==3){try{document["UISWF"].setProgress(_29/100);if(_2b!=""){document["UISWF"].changePanelTitle(_2b);}
if(_28==3){window.location.reload();}}
catch(e){}}else{if(_28<0){try{QQLiveSetup.flash.showManualInstall("自动安装QQLive播放器失败");QQLiveSetup.log(_2a);}
catch(e){}}}}};QQLiveSetup.flash={getFullVersion:function(){var _2d="0.0";if(!!QQLiveSetup.browser.ie){var swf=null;try{swf=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}
catch(e){}
if(!!swf){var _2e=swf.GetVariable("$version").replace(/^[^\d]+/g,"");_2d=_2e.replace(/,/g,".");}}else{if(navigator.plugins&&navigator.plugins.length>0){var swf=navigator.plugins["Shockwave Flash"];if(!!swf){var _2f=swf.description.split(" ");for(var i=0;i<_2f.length;++i){if(!isNaN(parseInt(_2f[i]))){_2d=_2f[i];break;}}}}}
QQLiveSetup.log("local flash player is "+_2d);return _2d;},getMainVer:function(){var _30=QQLiveSetup.flash.getFullVersion();if(_30.indexOf(".")>0){return _30.split(".")[0];}
return 0;},isFlashVerVaild:function(){var _31=false;if(!!QQLiveSetup.browser.ie){_31=QQLiveSetup.version.compare(QQLiveSetup.flash.getFullVersion(),QQLiveSetup.config.IE_FLASH_MIN_VER)==-1?false:true;}else{_31=QQLiveSetup.version.compare(QQLiveSetup.flash.getFullVersion(),QQLiveSetup.config.FF_FLASH_MIN_VER)==-1?false:true;}
return _31;},Fresh:function(){window.location.reload();},RunQQLive:function(){window.location.href=QQLiveSetup.curSSO;},JumpUrl:function(){location.href=QQLiveSetup.config.MEDIAPLAYER_DOWNLOAD_URL;},showNotSupport:function(){if(!document["UISWF"]){return;}
document["UISWF"].showPanel(QQLiveSetup.config.PAGE_NONSUPPORT);document["UISWF"].changePanelTitle(QQLiveSetup.lang.NOTSUPPORT);},showInstallStep:function(){if(!document["UISWF"]){return;}
document["UISWF"].showPanel(QQLiveSetup.config.FLASH_START);document["UISWF"].changePanelTitle(QQLiveSetup.lang.STEPTIPS);},showManualInstall:function(_32){if(!document["UISWF"]){return;}
if(!!QQLiveSetup.browser.ie){document["UISWF"].showPanel(QQLiveSetup.config.PAGE_ERROR);}else{document["UISWF"].showPanel(QQLiveSetup.config.PAGE_FFERROR);}
document["UISWF"].changePanelTitle(_32);},showInstallBtn:function(_33){if(!document["UISWF"]){return;}
_33=_33||QQLiveSetup.lang.CLICKBTN;document["UISWF"].showPanel(QQLiveSetup.config.PAGE_PREVINSTALL);document["UISWF"].changePanelTitle(_33);}};QQLiveSetup.player={startup:function(){if(QQLiveSetup.browser.isBrwValid()==false){return;}
if(QQLiveSetup.flash.isFlashVerVaild()==false){return;}
if(QQLiveSetup.version.check(QQLiveSetup.config.STARTUP_MIN_VER)==false){return;}
window.location.href="qqlive://system_startup/";}};function QQLiveObject(_34,_35){this.width=_34;this.height=_35;this.ocxParams={};this.callback=null;this.beforeDestory=null;};QQLiveObject.prototype={addParam:function(key,_36){this.ocxParams[key]=_36;},getParam:function(key){if(key in this.ocxParams){return this.ocxParams[key];}
return null;},getSSO:function(){var sso="";var _37="qqlive://sso/";var url=this.getParam("URL");if(url==null){sso=_37;return sso;}
if(url.indexOf(_37)==0){return url;}
sso=_37;var _38=this.getParam("Type");switch(_38){case"1":sso+="projectid=";sso+=url;break;case"2":sso+="videoid=";sso+=url;break;}
return sso;},destory:function(){if(typeof this.beforeDestory=="function"&&this.beforeDestory()==false){return;}
QQLiveSetup.log("ready to destory...");if((!!QQLiveSetup.browser.ie||!!QQLiveSetup.browser.isCanFF())&&!!QQLiveSetup.installer.installerObj){try{QQLiveSetup.installer.installerObj.Destroy();QQLiveSetup.log("destory successful");}
catch(e){QQLiveSetup.log("destory failed");}}},attachOnMsgEvent:function(){var _39=this;var _3a=function(id,url){if(id==1100){if(typeof(_39.callback)=="function"){_39.callback(url);}}};if(!!QQLiveSetup.browser.ie){getId("QQLiveOcx").attachEvent("OnMsg",_3a);}else{if(QQLiveSetup.browser.isCanFF()){getId("QQLiveOcx").AddEventListener("OnMsg",_3a,false);}}},getCtrl:function(){return getId("QQLiveOcx")||null;},setClientLink:function(_3b){QQLiveSetup.curSSO=_3b;},showFlashInstall:function(_3c){var _3d="";_3d+="<div style=\"position:relative;height:"+this.height+"px;width:"+this.width+"px;font-size:12px;border:1px solid #000000;background:#000000;\">";_3d+="<div style=\"position:absolute;top:50%;left:50%;width:300px;height:85px;margin:-40px 0 0 -150px;text-align:left; overflow:hidden;\">";_3d+="<h1 style=\"height:40px;margin:0 0 0 0;padding:0;color:#FF9902;font-size:18px;font-weight:bold;\">您尚未安装Flash播放器或版本过低</h1>";_3d+="<p style=\"height:26px;margin:0;padding:0;color:#a0a0a0;\">请点击<a href=\"##\" onclick=\"window.location.href='";_3d+=!!QQLiveSetup.browser.ie?QQLiveSetup.config.FLASH_SETUP_AX:QQLiveSetup.config.FLASH_SETUP_PLUGIN;_3d+="'\" style=\"margin:0 3px;color:#FF9902;text-decoration:underline;\">下载到本地</a>，然后手动安装Flash播放器</p>";_3d+="<p style=\"height:14px;margin:0;padding:0;color:#a0a0a0;\">（安装完成后，请点击<a href=\"##\" onclick=\"javascript:window.location.reload()\" style=\"margin:0 3px;color:#FF9902;text-decoration:underline;\">刷新</a>该页面）</p>";_3d+="</div>";_3d+="</div>";getId(_3c).innerHTML=_3d;},fillMMInstall:function(_3e,_3f){var _40="";_40+="<OBJECT style=\"display:none;\" classid=\"clsid:1DABF8D5-8430-4985-9B7F-A30E53D709B3\" codebase=\""+QQLiveSetup.config.QQLIVE_INSTALLER_CAB+"\" ID=QLiveInstaller></OBJECT>";_40+="<table cellpading=0 cellspacing=0 width="+this.width+" height="+this.height+" bgcolor=#000000><tr><td><div id='"+_3f+"'></div></td></tr></table>";getId(_3e).innerHTML=_40;},showGuideFlash:function(_41,_42,_43){var _44="";_44+="<OBJECT ID=\"UISWF\" CLASSID=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" codebase=\""+QQLiveSetup.config.FLASH_CAB+"\" width=\""+this.width+"\" height=\""+this.height+"\"  >\n";_44+=" <param name=\"movie\" value=\""+QQLiveSetup.config.QQLIVE_SWF_PATH+QQLiveSetup.config.QQLIVE_SWF_SKIN+QQLiveSetup.config.GUIDE_SWF+"\" />\n";_44+=" <param name=\"allowscriptaccess\" value=\"always\"/>\n";_44+=" <param name=\"wmode\" value=\"transparent\">";_44+=" <embed src=\""+QQLiveSetup.config.QQLIVE_SWF_PATH+QQLiveSetup.config.QQLIVE_SWF_SKIN+QQLiveSetup.config.GUIDE_SWF+"\" width=\""+this.width+"\" height=\""+this.height+"\" quality=\"high\" allowscriptaccess=\"always\" wmode=\"transparent\" name = \"UISWF\" pluginspage=\"http://www.macromedia.com/go/getflashplayer\" type=\"application/x-shockwave-flash\"></embed>";_44+="</OBJECT>\n";getId(_41).innerHTML=_44;if(_43&&!_42&&QQLiveSetup.installer.timer==null){QQLiveSetup.installer.timer=setInterval(QQLiveSetup.installer.checkMMIsInstall,500);}},showIEPlayer:function(_45){var _46="";_46="<Object id='QQLiveOcx' width="+this.width;_46+=" height="+this.height;_46+=" classid=CLSID:11F2A418-94B2-4E16-9B0C-B00C0435F903";_46+=" standby=\"Loading Tencent QQ视频 componets...\">";for(var p in this.ocxParams){if(this.ocxParams[p]!=null){_46+=" <PARAM NAME=\""+p+"\" VALUE=\""+this.ocxParams[p]+"\">";}}
_46+=" </Object>";getId(_45).innerHTML=_46;},showFFPlayer:function(_47){if(!QQLiveSetup.browser.isCanFF()){return;}
var _48="";_48="<embed id=QQLiveOcx width="+this.width+" height="+this.height;_48+=" type=\"application/tecent-qqlive-plugin\">";getId(_47).innerHTML=_48;var ocx=getId("QQLiveOcx");QQLiveSetup.log("width="+this.width);QQLiveSetup.log("height="+this.height);for(var p in this.ocxParams){QQLiveSetup.log(p+"="+this.ocxParams[p]);ocx[p]=this.ocxParams[p];}
ocx.CreateAX("LiveMedia.dll");},write:function(_49,_4a){if(!getId(_49)){QQLiveSetup.log("未找到对象:"+_49);return;}
var _4b=this;getId(_49).style.backgroundColor="#000000";_4a=typeof _4a=="undefined"?true:_4a;var _4c=QQLiveSetup.flash.isFlashVerVaild();if(!_4c){this.showFlashInstall(_49);return false;}
QQLiveSetup.curSSO=this.getSSO();if(!!QQLiveSetup.browser.ie&&_4a==true){var _4d=_49;_49="_qqlivecontent";this.fillMMInstall(_4d,_49);}
var _4e=QQLiveSetup.installer.isMMInstalled();var _4f=QQLiveSetup.version.check();if((!QQLiveSetup.browser.ie&&!QQLiveSetup.browser.isCanFF())||!_4e||!_4f){window.onbeforeunload=function(){_4b.destory();};this.showGuideFlash(_49,_4e,_4a);return;}
this.addParam("ClientMode",3);if(!!QQLiveSetup.browser.ie){this.showIEPlayer(_49);}else{if(QQLiveSetup.browser.isCanFF()){this.showFFPlayer(_49);}}
this.attachOnMsgEvent();},play:function(vid){return this.write(vid,false);},startup:function(){QQLiveSetup.player.startup();}};function OnOk(){if(!QQLiveSetup.browser.ie&&!QQLiveSetup.browser.isCanFF()){QQLiveSetup.flash.showNotSupport();return;}
if(!QQLiveSetup.installer.isMMInstalled()){if(!!QQLiveSetup.browser.ie){QQLiveSetup.flash.showInstallStep();}else{if(QQLiveSetup.installer.checkFFHasMMEmbed()==false){QQLiveSetup.flash.showNotSupport();return;}
QQLiveSetup.flash.showManualInstall(QQLiveSetup.lang.LOWVERSION);QQLiveSetup.installer.hide();}
return;}
if(!QQLiveSetup.version.check()){if(!!QQLiveSetup.browser.ie){if(QQLiveSetup.version.get()==0){QQLiveSetup.flash.showInstallBtn(QQLiveSetup.lang.CLICKBTN);}else{QQLiveSetup.flash.showInstallBtn(QQLiveSetup.lang.LOWVERSION);}}else{QQLiveSetup.flash.showManualInstall(QQLiveSetup.lang.LOWVERSION);}}};function flashCall(cmd){switch(cmd){case"downloadQQLive":QQLiveSetup.flash.JumpUrl();break;case"fresh":QQLiveSetup.flash.Fresh();break;case"runQQLive":QQLiveSetup.flash.RunQQLive();break;case"installQQLive":QQLiveSetup.installer.autoDownload();break;case"SLA":window.open("http://live.qq.com/help/index.html?id=8","_blank");break;}};var IsInstall=QQLiveSetup.installer.isMMInstalled;var CheckVersion=QQLiveSetup.version.check;