if(!BOSS){var BOSS={}}BOSS.play={};BOSS.jqmLogin=null;BOSS.jqmCode=null;BOSS.play.F=null;BOSS.pageLoadTime;BOSS.getLen=function(e){var a=0;for(var c=0,b=e.length;c<b;c++){var d=e.charCodeAt(c);if(d>=0&&d<=128){a=a+1}else{a=a+2}}return a};BOSS.editor=function(d,a){var b="reContentView";if($.browser.msie){var c=$('<textarea id="'+b+'" name="'+b+'" onpropertychange="BOSS.textCounter(\''+d+"','"+b+"',"+a+')"></textarea>').attr("class",$("#"+d).attr("class"));$("#"+d).after(c).css("display","none")}else{$("#"+d).attr("value","").attr("oninput","BOSS.textCounter('"+d+"','"+b+"',"+a+")")}$(".face a").each(function(e){$(this).click(function(){BOSS.showFace(d,b,a,e);return false})})};BOSS.textCounter=function(j,e,b){var h=document.getElementById(j);var g=document.getElementById(e)||false;var i="";var a;if(g){i=g.innerHTML.replace(/<img src=\"http:\/\/pic.boosj.com\/images\/play\/face\/face([0-9]{1,2})\.gif\">/gi,"[face$1]").replace(/&lt;/g,"<").replace(/&gt;/g,">")}else{i=h.value}a=BOSS.getLen(i);document.getElementById("remLen").innerHTML=b>=a?"\u8fd8\u53ef\u8f93\u5165 <span style='color:#f00'>"+(b-a)+"</span> \u4e2a\u5b57\u7b26":"<span style='color:#f00'>\u8f93\u5165\u8d85\u51fa "+(a-b)+" \u4e2a\u5b57\u7b26</span>";h.value=i;return false};BOSS.play.submitReview=function(){if(!BOSS.isLogin()){BOSS.showLogin()}else{var c=document.getElementById("reContent");var b=$.trim(c.value);if(b.length==0){alert("\u8bc4\u8bba\u5185\u5bb9\u4e0d\u80fd\u4e3a\u7a7a\uff01");return false}if(BOSS.getLen(b)>400){alert("\u8bc4\u8bba\u5185\u5bb9\u8d85\u51fa\uff01");return false}var e=BOSS.play.RID;var d=$.trim(document.getElementById("reviewName").value);var a="";if(document.getElementById("isViewName").checked){a=d;if(d==""){d=$.trim(document.getElementById("hidName").value)}}$.getScript("/frontRepost!replypostForAct_new.action?inchBbsReplypost.username="+encodeURI(encodeURI(d))+"&nkname="+encodeURI(encodeURI(a))+"&inchBbsReplypost.content="+encodeURI(encodeURI(b))+"&inchBbsReplypost.sid="+e+"&inchBbsReplypost.sid_type=2000&_"+new Date().valueOf(),function(f){BOSS.play.showReview();document.getElementById("reContent").value="";if(document.getElementById("reContentView")){document.getElementById("reContentView").value=""}});return false}};BOSS.play.getVideoFilePath=function(c){var a="";var b=c;if(b.length>2){b=b.substring(0,b.length-2);switch(b.length){case 1:case 2:a=b+"/"+c;break;case 3:a=b.substring(0,1)+"/"+b.substring(1,b.length)+"/"+c;break;case 4:a=b.substring(0,2)+"/"+b.substring(2,b.length)+"/"+c;break;case 5:a=b.substring(0,1)+"/"+b.substring(1,3)+"/"+b.substring(3,b.length)+"/"+c;break;case 6:a=b.substring(0,2)+"/"+b.substring(2,4)+"/"+b.substring(4,b.length)+"/"+c;break}}else{a=c}return a+"_1.htm"};BOSS.play.showReview=function(){var a="/static/actPaly_/"+BOSS.play.getVideoFilePath(BOSS.play.RID);if(!document.getElementById("review:iframe")){var b='<iframe id="review:iframe" style="margin:6px auto auto -6px;width:671px; height:0;" frameBorder="0" scrolling="no" allowtransparency="true"  src="'+a+'"></iframe>';$("#pinglun").append(b)}else{document.getElementById("review:iframe").src=a+"?_"+new Date().valueOf()}};BOSS.showLogin=function(){var b=arguments[0];if(!document.getElementById("loginLayer")){$("body").append('<div id="loginLayer" class="jqmWindow"></div>')}if(!b){document.getElementById("loginLayer").innerHTML='<a href="#" title="\u5173\u95ed\u767b\u9646\u6846" class="jqmClose"><strong>\u5173\u95ed</strong></a><p>\u7528\u6237\u767b\u9646</p><div><label for="loginLayerName">\u7528\u6237\u540d\uff1a&nbsp;</label><input type="text" id="loginLayerName" value="" /></div><div><label for="loginLayerPass">\u5bc6&nbsp;&nbsp;\u7801\uff1a&nbsp;</label><input type="password" value="" id="loginLayerPass" onkeydown="if(event.keyCode==13)$(\'.butLogin\').click();" /></div><div><a href="javascript:void(0);" title="\u767b\u9646" class="butLogin" onclick="BOSS.play.login()"><strong>\u767b\u9646</strong></a><a href="http://nuser.boosj.com:8088/register.action" target="_blank" title="\u6ce8\u518c" class="butRegister"><strong>\u6ce8\u518c</strong></a></div>'}else{var a=parseInt(Math.random()*10);while(a>4||a==0){a=parseInt(Math.random()*10)}document.getElementById("codeNum").value=a;document.getElementById("loginLayer").innerHTML='<a href="#" title="\u5173\u95ed" class="jqmClose"></a><div style="height:20px;margin:8px auto;"><span>\u6295\u7968\u9a8c\u8bc1\u7801 \uff1a</span><span id="randomPic"><img src="http://act.boosj.com/front/random.jsp" tabIndex=4 width="70" height="20" name="checkCode"/></span><span style="cursor:pointer;" onclick="getRandom();">\u70b9\u51fb\u5237\u65b0</span></div><div style="height:20px;margin:8px auto;"><label for="loginLayerPass">\u586b\u5199\u7b2c<span id="strNum">'+a+'</span>\u4e2a\u5b57\uff1a</label><input type="text" value="" id="code"/></div><div align="center"><input type="button" value="\u6295\u7968" id="butbt" onclick="checkCookie()"></div>'}if(!$.jqm){$.getScript("/js/jqModal-2.0.js",function(){BOSS.jqmLogin=$("#loginLayer").jqm({opacity:0.8});BOSS.jqmLogin.jqmShow({modal:true})})}else{if(BOSS.jqmLogin){BOSS.jqmLogin.jqmShow()}}return false};BOSS.play.login=function(){var c=document.getElementById("loginLayerName"),b=document.getElementById("loginLayerPass"),a=function(g){if(g.userID==""){alert(g.error);return false}try{BOSS.jqmLogin.jqmHide();if(BOSS.play.F){BOSS.play.F();BOSS.play.F=null}}catch(f){}};if($.trim(c.value).length!=0&&$.trim(b.value).length!=0){BOSS.login(c.value,b.value,"",a)}return false};function showVideoList(){var request=false;try{request=new XMLHttpRequest()}catch(trymicrosoft){try{request=new ActiveXObject("Msxml2.XMLHTTP")}catch(othermicrosoft){try{request=new ActiveXObject("Microsoft.XMLHTTP")}catch(failed){request=false}}}if(!request){alert("Error initializing XMLHttpRequest!")}var url="/frontVideo!popForJson.action?video.action_id=101&video.t3=1&video.orderby=a.ballot&randnum="+Math.random();request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState==4){if(request.status==200){var responseText=request.responseText;var myObject=eval("("+responseText+")");var obj=document.getElementById("ph");obj.innerHTML="";for(var i=0;i<myObject.video.length;i++){var li=document.createElement("li");li.className="li"+(i+1);var title=myObject.video[i].video_title;var popNum=myObject.video[i].popularity+myObject.video[i].ballot;var str1='<h1><a href="http://yxhz.boosj.com/actPaly_'+myObject.video[i].video_id+'.html" title="'+myObject.video[i].video_title+'" target="_blank">'+myObject.video[i].video_title+"</a></h1><span>"+myObject.video[i].ballot+"</span></li>";li.innerHTML=str1;obj.appendChild(li)}}}};request.send(null)}function getBallotRecord(b){var e=false;try{e=new XMLHttpRequest()}catch(d){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){e=false}}}if(!e){alert("Error initializing XMLHttpRequest!")}var c="/frontBR!getVideoBallot.action?inchCmsVideo.video_id="+b+"&randnum="+Math.random();e.open("GET",c,true);e.onreadystatechange=function(){if(e.readyState==4){if(e.status==200){var h=e.responseText;if(document.getElementById(b+"_ballot")!=null){var g=document.getElementById(b+"_ballot");g.innerHTML=h}}}};e.send(null)}function getClickNum(b){var e=false;try{e=new XMLHttpRequest()}catch(d){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){e=false}}}if(!e){alert("Error initializing XMLHttpRequest!")}var c="/frontVideo!updateClickNum.action?inchCmsVideo.video_id="+b+"&randnum="+Math.random();e.open("GET",c,true);e.onreadystatechange=function(){if(e.readyState==4){if(e.status==200){}}};e.send(null)}function ballotRecord(){var i=document.getElementById("bt_btn");i.disabled="disabled";var d=document.getElementById("video_id").value;var c=document.getElementById("bblock").value;var g=document.getElementById("flag").value;var b=false;try{b=new XMLHttpRequest()}catch(f){try{b=new ActiveXObject("Msxml2.XMLHTTP")}catch(h){try{b=new ActiveXObject("Microsoft.XMLHTTP")}catch(e){b=false}}}if(!b){alert("Error initializing XMLHttpRequest!")}var a="/frontBR!brInsert.action?inchCmsBallotRecord.video_id="+d+"&inchCmsBallotRecord.bblock="+c+"&inchCmsBallotRecord.troop="+g+"&random="+Math.random();b.open("GET",a,true);b.onreadystatechange=function(){if(b.readyState==4){if(b.status==200){var k=b.responseText;if(k=="-1"){BOSS.showLogin()}else{if(k=="3"){alert("\u4e00\u5c0f\u65f6\u5185\u4e0d\u80fd\u518d\u6295\u7968\uff01")}else{alert(k);if(k=="\u6295\u7968\u6210\u529f\uff01"){var j=document.getElementById(d+"_ballot");if(j.innerHTML!=""){j.innerHTML=parseInt(j.innerHTML)+1}BOSS.jqmLogin.jqmHide()}}}i.disabled="";document.getElementById("butbt").disabled=""}if(b.status==404){BOSS.showLogin()}}};b.send(null)}function getClickNum(video_id){var request=false;try{request=new XMLHttpRequest()}catch(trymicrosoft){try{request=new ActiveXObject("Msxml2.XMLHTTP")}catch(othermicrosoft){try{request=new ActiveXObject("Microsoft.XMLHTTP")}catch(failed){request=false}}}if(!request){alert("Error initializing XMLHttpRequest!")}var url="/frontVideo!getClickNum.action?video_id="+video_id+"&randnum="+Math.random();request.open("GET",url,true);request.onreadystatechange=function(){if(request.readyState==4){if(request.status==200){var responseText=request.responseText;var myObject=eval("("+responseText+")");var click_num=document.getElementById("click_num");click_num.innerHTML=myObject.clickNum;var reViewNum=document.getElementById("reViewNum").value;reViewNum=myObject.reviewNum;if(reViewNum>0){BOSS.play.showReview()}}}};request.send(null)}function testTime(){var d=new Date("2009-08-29 09:00:00".replace(/-/g,"/"));var c=new Date("2009-09-08 09:00:00".replace(/-/g,"/"));var e=new Date();if(d<e&&e<c){if(document.getElementById("bt_btn")){document.getElementById("bt_btn").style.display="";var b=document.getElementById("bt_btn");b.disabled=""}}if(d>e){var a=document.getElementById("video_id").value;document.getElementById(a+"_ballot").style.display="none"}}function showCode(){if(!BOSS.isLogin()){BOSS.showLogin()}else{BOSS.showLogin("checkCode");getRandom()}}function checkCookie(){document.getElementById("butbt").disabled="disabled";var e=false;try{e=new XMLHttpRequest()}catch(d){try{e=new ActiveXObject("Msxml2.XMLHTTP")}catch(g){try{e=new ActiveXObject("Microsoft.XMLHTTP")}catch(a){e=false}}}if(!e){alert("Error initializing XMLHttpRequest!")}var c=document.getElementById("code").value;var f=document.getElementById("codeNum").value;var b="/frontBR!checkCode.action?code="+c+"&strNum="+f+"&random="+Math.random();e.open("GET",b,true);e.onreadystatechange=function(){if(e.readyState==4){if(e.status==200){var h=e.responseText;if(h=="1"){ballotRecord()}else{if(h=="-1"){alert("\u8bf7\u5148\u767b\u5f55..")}else{if(h=="\u7b54\u6848\u4e0d\u6b63\u786e,\u8bf7\u8f93\u5165\u6b63\u786e\u7b54\u6848!"){alert(h);document.getElementById("butbt").disabled=""}}}}}};e.send(null)}function getRandom(){var a=document.getElementById("randomPic");var b="/front/login/random.jsp?random="+Math.random();a.innerHTML="<img src='"+b+"' tabIndex='4' width='70' height='22' onclick='getRandom()'/>"}$(document).ready(function(){BOSS.play.RID=document.getElementById("res").value;BOSS.play.FLAG=document.getElementById("flag").value;showVideoList();getClickNum(BOSS.play.RID);if(BOSS.outCallback!==undefined){BOSS.outCallback=function(){document.getElementById("reviewName").disabled=false;document.getElementById("reviewName").value="";document.getElementById("hidName").value="";document.getElementById("isViewName").style.visibility="hidden";document.getElementById("incognito").style.visibility="hidden";document.getElementById("reviewBack").style.visibility="visible"}}if(BOSS.inCallback!==undefined){BOSS.inCallback=function(c){if(c.userID!=""){document.getElementById("reviewBack").style.visibility="hidden";document.getElementById("isViewName").style.visibility="visible";document.getElementById("incognito").style.visibility="visible";document.getElementById("reviewName").value=c.userName;document.getElementById("hidName").value=c.userName;try{document.getElementById("loginLayerName").value="";document.getElementById("loginLayerPass").value="";BOSS.jqmLogin.jqmHide()}catch(b){}}}}$("#butReview").click(BOSS.play.submitReview);$("#isViewName").click(function(){var b=document.getElementById("reviewName");b.disabled=!this.checked;if(!this.checked){b.value=document.getElementById("hidName").value}});BOSS.editor("reContent",400);if(window.attachEvent){var a=["data","onmouseover","onmouseout","onmousedown","onmouseup","ondblclick","onclick","onselectstart","oncontextmenu"];BOSS.event.add(window,"unload",function(){var b;for(var e=document.all.length;e--;){b=document.all[e];for(var f=a.length;f--;){b[a[f]]=null}}})}});
