var Libary_Prefix="";var isBeta=true;function loadScriptsLibrary(url,callback){var scripts=document.getElementsByTagName("SCRIPT");for(var i=0;i<scripts.length;i++){var k=scripts[i].src;if(k.indexOf("adaptiveplugin.js")!=-1){var preurl=k.substring(0,k.length-17);url=preurl+url;if(preurl!=""){Libary_Prefix=k.substring(0,k.indexOf("scripts/"))+"scripts/"}}}var oScriptEl=document.createElement("script");oScriptEl.type="text/javascript";oScriptEl.language="javascript";oScriptEl.src=url;document.getElementsByTagName("head")[0].appendChild(oScriptEl);if(window.navigator.userAgent.indexOf("MSIE")==-1){oScriptEl.onload=function(){callback()}}else{oScriptEl.onreadystatechange=function(){if(oScriptEl.readyState=="complete"||oScriptEl.readyState=="loaded"){callback()}}}}var AdaptivePlugin=function(){var isWin=(navigator.appVersion.toLowerCase().indexOf("win")!=-1)?true:false,isMac=(navigator.appVersion.indexOf("Mac")!=-1)?true:false,isIE=(navigator.appVersion.indexOf("MSIE")!=-1)?true:false,isOpera=(navigator.userAgent.indexOf("Opera")!=-1)?true:false,isFireFox=(navigator.userAgent.indexOf("FireFox")!=-1)?true:false,isChrome=(navigator.userAgent.indexOf("Chrome")!=-1)?true:false,UNDEF="undefined",OBJECT="object",win=window,doc=document,nav=navigator,pluginObj=null,parentObj=null,introObj=null;usePlugin=true,useOldVersion=false,pluginId=null,installRequired=false;usingNewFFVerCheck=true,checkInstallTimer=null,checkInstallMaxTime=600000,checkInstallInterval=300;checkCount=0;installSuccessCallback=null,installFailedCallback=null;installProgress=0,pluginCallBackFunction=null;function getPluginVersion(){if(isIE){return getWinIEVersion()}else if(!isMac&&!isIE){return getWinFFVersion()}else{return getBaseVersion()}}function getWinIEVersion(){var k;var cf=null;try{k=new ActiveXObject("NeuLionLib.AxVersionChecker");if(k){cf=k.AdaptivePluginVersion;if(cf==""){cf=null}}}catch(e){}return{"installVersion":cf,"latestVersion":(ADAPTIVEPLUGIN_VERSION)?ADAPTIVEPLUGIN_VERSION:null}}function getWinFFVersion(){var isInstall=false;if(nav.plugins){for(var i=0;i<nav.plugins.length;i++){var c=nav.plugins[i];var c2=c.description;if(c2.indexOf("NeuLion Adaptive Plugin")!=-1){isInstall=true;var v=c2.split(" ");var k=v[3];if(k&&k.split(".").length==4){return{"installVersion":k,"latestVersion":(ADAPTIVEPLUGIN_VERSION)?ADAPTIVEPLUGIN_VERSION:null}}else{usingNewFFVerCheck=false;return getBaseVersion()}}}if(!isInstall){return{"installVersion":null,"latestVersion":(ADAPTIVEPLUGIN_VERSION)?ADAPTIVEPLUGIN_VERSION:null}}}}function getBaseVersion(){var isInstall=false;if(nav.plugins&&nav.plugins.length>0){for(var i=0;i<nav.plugins.length;i++){var c=nav.plugins[i];var c2=c.description;if(c2.indexOf("NeuLion Adaptive Plugin")!=-1){isInstall=true;break}}if(!isInstall){return{"installVersion":null,"latestVersion":(ADAPTIVEPLUGIN_VERSION)?ADAPTIVEPLUGIN_VERSION:null}}}var str=createObjectStr("tempadpocxid","tempadpocxid",false);var d=doc.createElement("DIV");d.innerHTML=str;doc.getElementsByTagName("body")[0].appendChild(d);var p=doc.getElementById("tempadpocxid");var cf=null;if(p){try{cf=p.currentVersion}catch(e){cf==null}}doc.getElementsByTagName("body")[0].removeChild(d);return{"installVersion":cf,"latestVersion":(ADAPTIVEPLUGIN_VERSION)?ADAPTIVEPLUGIN_VERSION:null}}function getUpgradePluginVersion(){var str=createObjectStr("tempadpocxid","tempadpocxid",true);var d=doc.createElement("DIV");d.innerHTML=str;d=doc.getElementsByTagName("body")[0].appendChild(d);if(isIE){d.style.display="none"}var p=doc.getElementById("tempadpocxid");var cf=null;if(p){try{cf=p.currentVersion}catch(e){}}doc.getElementsByTagName("body")[0].removeChild(d);return{"installVersion":cf,"latestVersion":ADAPTIVEPLUGIN_VERSION}}function clean(){if(pluginObj){pluginObj.shutdown()}pluginObj=null;for(var l in AdaptivePlugin){AdaptivePlugin[l]=null}AdaptivePlugin=null}var cleanUp=function(){if(typeof win.addEventListener!=UNDEF){win.addEventListener("unload",clean,false)}else if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("unload",clean,false)}else if(typeof win.attachEvent!=UNDEF){win.attachEvent("onunload",clean)}else if(typeof win.onunload=="function"){var fnOld=win.onunload;win.onunload=function(){fnOld();clean()}}else{win.onunload=clean}}();function createObjectStr(id,name,isDecting){var str='';if(isIE){var codeBase="";if(!isDecting){str+='<object id="'+id+'" name="'+name+'" classid="CLSID:'+ADAPTIVEPLUGIN_CLASSID+'" width="1" height="1">'}else{str+='<object id="'+id+'"';str+=' name="'+name+'"';str+=' classid="CLSID:'+ADAPTIVEPLUGIN_CLASSID+'"';str+=' codebase="'+codeBase+'"';str+=' width="1" height="1">'}str+='<param name="hidden" value="true" />';str+='</object>'}else{str+='<embed id="'+id+'" name="'+name+'" width="1" height="1"  type="'+ADAPTIVEPLUGIN_MIMETYPE+'">';str+='<param name="hidden" value="true" />';str+='</embed>'}return str}function showExpressInstallPage(){var str="";if(introObj){introObj.style.display=""}var url="scripts/nlas/custominstall/index.html";var left=(parentObj)?parentObj.offsetLeft+400:200;if((left+680)>screen.width){left=screen.width-680}win.open(url,"_blank","height=500,width=680,left="+left+",top=120")}function startInstall(installCompleleteCallBack,installShowFailedCallback){var ver=getPluginVersion();if(ver.installVersion==null){installProgress=1}else{installProgress=2}installSuccessCallback=installCompleleteCallBack;installFailedCallback=installShowFailedCallback;checkPluginInstall()}function refreshPlugins(){if(!nav.plugins){return}nav.plugins.refresh(0)}function checkPluginInstall(){if(!isMac){checkCount++;refreshPlugins();var ver=getPluginVersion();if(ver.installVersion!=null&&!needUpgrade(ver.installVersion)){if(isIE){var testver=getBaseVersion();if(testver.installVersion==null){checkInstallTimer=win.setTimeout(function(){checkPluginInstall()},checkInstallInterval);return}}win.clearTimeout(checkInstallTimer);checkInstallTimer=null;if(installSuccessCallback!=null){installSuccessCallback(installProgress)}return}if(!isIE&&!usingNewFFVerCheck){checkInstallInterval=5000;checkInstallTimer=win.setTimeout(function(){checkPluginInstall()},5000)}else{checkInstallTimer=win.setTimeout(function(){checkPluginInstall()},checkInstallInterval)}}else{win.setTimeout(function(){installSuccessCallback(installProgress)},1000)}}function hideExpressInstall(isPlugin){if(introObj){doc.getElementsByTagName("body")[0].removeChild(introObj)}if(parentObj){parentObj.style.visibility="visible"}usePlugin=isPlugin;if(useOldVersion){useOldVersionCallback()}else{if(pluginCallBackFunction){pluginCallBackFunction()}}}function useOldVersionCallback(){if(pluginObj==null){var d=doc.createElement("DIV");if(isIE){d.style.display="none"}d.innerHTML=createObjectStr(pluginId,pluginId,false);doc.getElementsByTagName("body")[0].appendChild(d);pluginObj=doc.getElementById(pluginId);usePlugin=true;try{pluginObj.startup()}catch(error){var k=doc.getElementsByTagName("body")[0];for(var i=0;i<k.childNodes.length;i++){if(k.childNodes[i]&&k.childNodes[i].id==id){k.removeChild(k.childNodes[i]);break}}pluginObj=null;usePlugin=false;showInstallDialog(installRequired);return}if(pluginCallBackFunction){pluginCallBackFunction()}}if(parentObj){parentObj.style.visibility="visible"}}function showIntroOnParentObject(htmlStr){if(parentObj){var a=parentObj.offsetLeft;var b=parentObj.height;var c=parentObj.offsetTop;var d=parentObj.width;if(introObj==null){var div=doc.createElement("DIV");div.style.position="absolute";div.style.zIndex=9000;div.style.left=0;div.style.top=0;div.style.width="100%";div.style.height="100%";div.align="center";div.style.verticalAlign="middle";if(!htmlStr){var iframe=doc.createElement("iframe");var isRequired=(installProgress==1)?installRequired:(!meetMinVersion());var url="scripts/nlas/custominstall/index.html?installProgress="+installProgress+"&isPluginRequired="+isRequired;url=url+"&lib_prefix="+Libary_Prefix;iframe.src=url;iframe.scrolling="no";iframe.style.border=0;iframe.setAttribute("frameborder","0",0);iframe.width=620;iframe.height=500;div.appendChild(iframe);introObj=doc.getElementsByTagName("body")[0].appendChild(div);var k=introObj.offsetHeight;o=(k-500)/2;if(o>0)iframe.style.margin=o+"px"}else{div.innerHTML=htmlStr;introObj=doc.getElementsByTagName("body")[0].appendChild(div)}}else{div.innerHTML=htmlStr}parentObj.style.visibility="hidden"}}function needUpgrade(curVer){var latestVer=ADAPTIVEPLUGIN_VERSION;if(curVer){var curVerArray=curVer.split(".");var latestVerArray=latestVer.split(",");for(var i=0;i<latestVerArray.length;i++){if(new Number(latestVerArray[i])>new Number(curVerArray[i])){return true}}}return false}function meetMinVersion(){var minVer=ADAPTIVEPLUGIN_MIN_VERSION;var curVer=getPluginVersion().installVersion;if(curVer){var curVerArray=curVer.split(".");var minVerArray=minVer.split(",");for(var i=0;i<minVerArray.length;i++){if(new Number(minVerArray[i])>new Number(curVerArray[i])){return false}}}return true}function loadAllScriptLib(fn){loadScriptsLibrary("ax_settings.js",fn)}function addLoadEvent(fn){if(typeof win.addEventListener!=UNDEF){win.addEventListener("load",function(){loadAllScriptLib(fn)},false)}else if(typeof doc.addEventListener!=UNDEF){doc.addEventListener("load",function(){loadAllScriptLib(fn)},false)}else if(typeof win.attachEvent!=UNDEF){win.attachEvent("onload",function(){loadAllScriptLib(fn)})}else if(typeof win.onload=="function"){var fnOld=win.onload;win.onload=function(){fnOld();loadAllScriptLib(fn)}}else{win.onload=function(){loadAllScriptLib(fn)}}}function showInstallDialog(isPluginRequired){installProgress=1;showIntroOnParentObject()}function showUpgradeDialog(){installProgress=2;showIntroOnParentObject()}return{usePlugin:function(){return usePlugin},useOldVersion:function(){useOldVersion=true},embedPlugin:function(parObj,id,callbackFunction,isPluginRequired,isExpressInstallShow,isExpressUpgradeShow){addLoadEvent(function(){pluginCallBackFunction=callbackFunction;if(!isPluginRequired){installRequired=false}else{installRequired=true}var pluginVersion=getPluginVersion();parentObj=document.getElementById(parObj);pluginId=id;if(pluginVersion.installVersion!=null&&!needUpgrade(pluginVersion.installVersion)){installProgress=0;if(pluginObj==null){var d=doc.createElement("DIV");if(isIE)d.style.display="none";d.innerHTML=createObjectStr(id,id,false);doc.getElementsByTagName("body")[0].appendChild(d);pluginObj=doc.getElementById(id)}try{pluginObj.startup()}catch(error){var k=doc.getElementsByTagName("body")[0];for(var i=0;i<k.childNodes.length;i++){if(k.childNodes[i]&&k.childNodes[i].id==id){k.removeChild(k.childNodes[i]);break}}pluginObj=null;usePlugin=false;if(isExpressInstallShow)showInstallDialog(installRequired);else{if(pluginCallBackFunction)pluginCallBackFunction()}return}parentObj.style.visibility="visible";usePlugin=true;if(pluginCallBackFunction)pluginCallBackFunction()}else if(pluginVersion.installVersion==null){usePlugin=false;if(isExpressInstallShow)showInstallDialog(installRequired);else{if(pluginCallBackFunction)pluginCallBackFunction()}}else if(needUpgrade(pluginVersion.installVersion)){usePlugin=false;if(isExpressUpgradeShow)showUpgradeDialog();else{if(pluginCallBackFunction)pluginCallBackFunction()}}})},isPluginInstalled:function(){var pluginVersion=getPluginVersion();if(pluginVersion.installVersion==null||pluginVersion.installVersion==""){return false}if(pluginVersion.installVersion!=null&&pluginVersion.installVersion!=""&&!needUpgrade(pluginVersion.installVersion)){var pluginVersion=getBaseVersion();if(pluginVersion.installVersion==null||pluginVersion.installVersion==""){return false}}return true},isPluginNeedUpdrage:function(){var pluginVersion=getPluginVersion();if(pluginVersion.installVersion!=null&&pluginVersion.installVersion!=""&&needUpgrade(pluginVersion.installVersion)){return true}return false},getCurrentVersion:function(){return getPluginVersion().installVersion},getPeerPluginPort:function(){var pluginVersion=getPluginVersion();if(pluginVersion.installVersion!=null&&pluginVersion.installVersion!=""&&pluginObj==null){return-1}if(pluginObj!=null){if(isIE){return pluginObj.localPort}else{return pluginObj.getLocalPort()}}return null},addLoadEvent:addLoadEvent,hideExpressInstall:hideExpressInstall,showExpressInstall:showExpressInstallPage,startInstall:startInstall}}();
