var videoRequest;var count=1;var timer;function CallVideo(){var urlStr='/servlet/VideoLive?dummy='+Math.random();if(window.ActiveXObject){videoRequest=new ActiveXObject('Microsoft.XMLHttp');}
else{if(window.XMLHttpRequest){videoRequest=new XMLHttpRequest();mBrowserType='nonWindows';}}
if(videoRequest){videoRequest.onreadystatechange=getVideo;videoRequest.open('get',urlStr);try{if(window.ActiveXObject){videoRequest.send();}
else{param='';videoRequest.send(param);}}
catch(ajaxEx){alert(ajaxEx);}}}
function getVideo(){var videoTitle;if(videoRequest.readyState==4){if(videoRequest.status==200){var dataFilter=videoRequest.responseText.split("^");var VidId=document.getElementById('WVID');var s1 = new SWFObject("/WVJsp/mediaplayer.swf","mediaplayer","270","248","7");s1.addParam('allowscriptaccess','always');s1.addParam("allowfullscreen","true");s1.addVariable("width","270");s1.addVariable("height","248");s1.addVariable("file",dataFilter[1]);s1.addVariable("autostart","true");s1.addVariable("enablejs","true");s1.addVariable("javascriptid","mediaplayer");s1.write("container");var player=document.getElementById('Player');videoTitle=document.getElementById('videoTitle');var CurrentRating=document.getElementById('CuRating');var TotalView=document.getElementById('LiveView');/*var ObjectId=document.getElementById('InteractiveMovie');var ObjectId=document.getElementById('InteractiveMovie');*/var Thrating=document.getElementById('ThanksRating');Thrating.innerHTML=' ';videoTitle.innerHTML=dataFilter[0];TotalView.innerHTML='Views  :'+dataFilter[4];if(dataFilter[5]<=30){CurrentRating.innerHTML='Current Rating  : <img src="/image/WVImage/Home/Red1Star.gif"/>';}
if(dataFilter[5]>30&&dataFilter[5]<=50){CurrentRating.innerHTML='Current Rating  : <img src="/image/WVImage/Home/Red2Star.gif"/>';}
if(dataFilter[5]>50&&dataFilter[5]<=70){CurrentRating.innerHTML='Current Rating  : <img src="/image/WVImage/Home/Red3Star.gif"/>';}
if(dataFilter[5]>70&&dataFilter[5]<=90){CurrentRating.innerHTML='Current Rating  : <img src="/image/WVImage/Home/Red4Star.gif"/>';}
if(dataFilter[5]>90&&dataFilter[5]<=100){CurrentRating.innerHTML='Current Rating  : <img src="/image/WVImage/Home/RedAllStar.gif"/>';}
VidId.innerHTML=dataFilter[6];/*ObjectId.src=dataFilter[1];*/var VideoTime=dataFilter[8];var VideoDuration=VideoTime.split(" ");var VT=parseInt(VideoDuration[0]);VT=VT+10;try{//timer=setTimeout("CallVideo()",1000*VT);
}
catch(ex){}}}}
function stopLiveVideo(){clearTimeout(timer);}

function getLength(swf) { return(thisMovie(swf).getLength()); };
function thisMovie(movieName) {if(navigator.appName.indexOf("Microsoft") != -1) {return window[movieName];} else {
return document[movieName];}}
function getUpdate(typ,pr1,pr2,swf) {if((swf != "null")&&(pr1 != undefined)) {if(typ == "item") { currentItem = pr1; }
else if(typ == "state") {currentState = pr1;if((currentState == "3")&&(currentItem == getLength("mediaplayer")-1)) {
CallVideo();}}}}
