var ajax=new AJAX();ajax.setcharset("GBK");function reportErr(a){openWin("/"+sitePath+"js/err.html?id="+a,400,220,350,250,0)}function viewComment(c,b){var a;if(b.length==0){a=c}else{a="/"+sitePath+"comment.asp?id="+c+"&page="+b}ajax.get(a,function(d){if(d.responseText=="err"){set($("comment_list"),"<font color='red'>\u53d1\u751f\u9519\u8bef</font>")}else{set($("comment_list"),d.responseText)}})}function submitComment(a){if($("m_author").value.length<1){alert("\u8bf7\u586b\u5199\u6635\u79f0");return false}if($("m_content").value.length<1){alert("\u8bf7\u586b\u5199\u5185\u5bb9");return false}ajax.postf($("f_comment"),function(b){if(b.responseText=="ok"){viewComment(a,1);alert("\u5c0f\u5f1f\u6211\u611f\u8c22\u60a8\u7684\u8bc4\u8bba!")}else{if(b.responseText=="havecomment"){alert("\u5c0f\u6837\u513f\u4f60\u624b\u4e5f\u592a\u5feb\u4e86\uff0c\u6b47\u4f1a\u513f\u518d\u6765\u8bc4\u8bba\u5427\uff01")}else{alert("\u53d1\u751f\u9519\u8bef")}}})}function diggVideo(b,a){ajax.get("/"+sitePath+"inc/ajax.asp?id="+b+"&action=digg",function(d){var c=Number(d.responseText);if(!isNaN(c)){set($(a),c);alert("(*^__^*) \u563b\u563b\u2026\u2026\uff0c\u9876\u5f97\u6211\u771f\u8212\u670d\uff01")}else{if(d.responseText=="err"){alert("\u9876\u5931\u8d25")}else{if(d.responseText=="havescore"){alert("(*^__^*) \u563b\u563b\u2026\u2026 \u8fd9\u4e48\u70ed\u5fc3\u554a\uff0c\u60a8\u5df2\u7ecf\u9876\u8fc7\u4e86\uff01")}}}})}function treadVideo(b,a){ajax.get("/"+sitePath+"inc/ajax.asp?id="+b+"&action=tread",function(d){var c=Number(d.responseText);if(!isNaN(c)){set($(a),c);alert("\u5c0f\u6837\u513f\uff0c\u5c45\u7136\u6562\u8e29\u6211\uff01")}else{if(d.responseText=="err"){alert("\u8e29\u5931\u8d25")}else{if(d.responseText=="havescore"){alert("\u6211\u6655\uff0c\u60a8\u5df2\u7ecf\u8e29\u8fc7\u4e86\uff0c\u60f3\u8e29\u6b7b\u6211\u554a\uff01")}}}})}function alertFrontWin(b,c,a,d,e){openWindow(b,c,a,d);set($("msgbody"),e)}function getAspParas(c){var b=location.href;var a=location.search;if(b.indexOf("?")>0){return a.substring(1,a.indexOf(c)).split("-")}else{return b.substring(b.lastIndexOf("/")+1,b.indexOf(c)).split("-")}}function getHtmlParas(b){var a=location.search;return a.substring(1,a.length).split("-")}function handleParas(l,h){var f,k,d,b,c,e,a,g;if(isNaN(l)||isNaN(h)){return false}k=VideoInfoList.split("$$$");d=k.length;if(h>d-1){h=d-1}for(f=0;f<d;f++){if(h==f){c=k[f].split("$$")[1].split("#");b=c.length;if(l>b-1){l=b-1}for(e=0;e<b;e++){if(l==e){a=c[e];g=a.split("$");return g}}}}}function regexpSplice(a,c,b){c.exec(a);return(RegExp.$1+b+RegExp.$2)}function getPageValue(e){var b,d,a,c;b=getElementsByName("input",e);a=b.length;for(d=0;d<a;d++){c=b[d].value;if(c.length>0){return c}}return""}function getPageGoUrl(a,c,d,e){var g,f;var b=location.href;pageNum=getPageValue(c);if(pageNum.length==0||isNaN(pageNum)){alert("\u8f93\u5165\u9875\u7801\u975e\u6cd5");return false}if(pageNum>a){pageNum=a}if(pageNum<1){pageNum=1}switch(d){case 1:g=(pageNum==1)?"":"-"+pageNum;f=regexpSplice(b,/(http:\/\/\S+\?\d+)[-]{0,1}\d*(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g);break;case 2:if(b.lastIndexOf("/")==(b.length-1)){b+=e}g=(pageNum==1)?"":pageNum;f=regexpSplice(b,/(http:\/\/\S+?)[\d]*(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g);break;case 3:g=(pageNum==1)?"":"_"+pageNum;f=(b.split("_").length<2)?regexpSplice(b,/(http:\/\/\S+\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g):regexpSplice(b,/(http:\/\/\S+\d+?)_\d+(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g);if(f.indexOf("http://")==-1){f=regexpSplice(b,/(http:\/\/\S+_\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g)}break;case 4:if(b.lastIndexOf("/")==(b.length-1)){b+=e}g=(pageNum==1)?"":"_"+pageNum;b=b.replace("_","");f=regexpSplice(b,/(http:\/\/\S+?)[\d]*(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g);break;case 5:g=(pageNum==1)?"":"-"+pageNum;f=(b.split("-").length<2)?regexpSplice(b,/(http:\/\/\S+\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g):regexpSplice(b,/(http:\/\/\S+\d+?)-\d+(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g);if(f.indexOf("http://")==-1){f=regexpSplice(b,/(http:\/\/\S+\d+?)(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g)}break;case 6:g=(pageNum==1)?"":"-"+pageNum;f=regexpSplice(b,/(http:\/\/\S+?)[-]{0,1}[\d]{0,1}(\.html|\.htm|\.shtml|\.shtm|\.asp)/,g);break}location.href=f}function goSearchPage(a,b,c,e){var d=getPageValue(b);if(d.length==0||isNaN(d)){alert("\u8f93\u5165\u9875\u7801\u975e\u6cd5");return false}if(d>a){d=a}if(d<1){d=1}location.href="?page="+d+"&searchword="+e+"&searchtype="+c}function leaveWord(){if($("m_author").value.length<1){alert("\u6635\u79f0\u5fc5\u987b\u586b\u5199");return false}if($("m_content").value.length<1){alert("\u5185\u5bb9\u5fc5\u987b\u586b\u5199");return false}ajax.postf($("f_leaveword"),function(a){if(a.responseText=="ok"){viewLeaveWordList(1);alert("\u7559\u8a00\u6210\u529f\uff0c\u591a\u8c22\u652f\u6301\uff01");$("m_content").value=""}else{if(a.responseText=="haveleave"){alert("\u5c0f\u6837\u513f\u4f60\u624b\u4e5f\u592a\u5feb\u4e86\uff0c\u6b47\u4f1a\u513f\u518d\u6765\u7559\u8a00\u5427\uff01")}else{alert("\u53d1\u751f\u9519\u8bef")}}})}function viewLeaveWordList(a){view("leavewordlist");ajax.get("/"+sitePath+"gbook.asp?action=list&page="+a,function(b){if(b.responseText=="err"){set($("leavewordlist"),"<font color='red'>\u53d1\u751f\u9519\u8bef2</font>")}else{set($("leavewordlist"),b.responseText)}})}function loginLeaveWord(){if($("m_username").value.length<1||$("m_pwd").value.length<1){alert("\u7528\u6237\u540d\u5bc6\u7801\u4e0d\u80fd\u4e3a\u7a7a");return false}ajax.postf($("f_loginleaveword"),function(a){if(a.responseText=="ok"){closeWin();alert("\u767b\u9646\u6210\u529f");setLoginState();viewLeaveWordList(1)}else{if(a.responseText=="no"){alert("\u7528\u6237\u540d\u6216\u5bc6\u7801\u4e0d\u6b63\u786e")}else{if(a.responseText=="err"){alert("\u53d1\u751f\u9519\u8bef")}else{setLoginState()}}}})}function setLoginState(){ajax.get("/"+sitePath+"gbook.asp?action=state",function(a){set($("adminleaveword"),a.responseText)})}function logOut(){ajax.get("/"+sitePath+"gbook.asp?action=logout",function(a){set($("adminleaveword"),"\u6210\u529f\u9000\u51fa")});setLoginState();viewLeaveWordList(1)}function delLeaveWord(c,b,a){ajax.get("/"+sitePath+"gbook.asp?action=del&id="+c+"&type="+a,function(d){if(d.responseText=="ok"){viewLeaveWordList(b)}else{if(d.responseText=="err"){alert("\u53d1\u751f\u9519\u8bef3")}else{viewLeaveWordList(b)}}})}function replyLeaveWord(b,a){alertFrontWin(101,400,160,50,"");set($("msgtitle"),"\u56de\u590d\u7559\u8a00");set($("msgbody"),"<form id='replyleaveword'  action='/"+sitePath+"gbook.asp?action=reply&id="+b+"' method='post'><div><textarea id='m_replycontent'  name='m_replycontent' rows=7 cols=50></textarea><br><input type='button' value='\u56de  \u590d' onclick='submitReply("+a+")' class='btn' /> &nbsp;<span style='background-color:#CCCCCC;cursor:pointer;' onclick=$('m_replycontent').value+='[URL][/URL]'><b>[URL]</b></span></div></form>")}function viewLoginState(){alertFrontWin(101,300,100,50,"");set($("msgtitle"),"\u767b\u9646\u7559\u8a00\u677f");set($("msgbody"),"<form id='f_loginleaveword'  action='/"+sitePath+"gbook.asp?action=login' method='post'  ><table><tr><td>\u7528\u6237\u540d\uff1a</td><td><input type='input'  name='m_username' id='m_username' size=10 value=''/></td></tr><tr><td><input type='hidden' value='ok' name='m_login' />\u5bc6\u7801\uff1a</td><td><input type='password' id='m_pwd' name='m_pwd' size=10 value=''/></td></tr><tr><td><input type='submit' value='\u767b  \u9646' class='btn'  onclick='loginLeaveWord();return false;'  /></td></tr></table></form>")}function submitReply(a){if($("m_replycontent").value.length<1){alert("\u56de\u590d\u4e0d\u80fd\u4e3a\u7a7a");return false}ajax.postf($("replyleaveword"),function(b){if(b.responseText=="ok"){closeWin();viewLeaveWordList(a)}else{if(b.responseText=="err"){alert("\u53d1\u751f\u9519\u8bef4")}else{viewLeaveWordList(a)}}})}function getVideoHit(a){ajax.get("/"+sitePath+"inc/ajax.asp?action=hit&id="+a,function(c){var b=c.responseText;if(b=="err"){set($("hit"),"\u53d1\u751f\u9519\u8bef")}else{set($("hit"),b)}})}function getNewsHit(a){ajax.get("/"+sitePath+"inc/ajax.asp?action=hitnews&id="+a,function(c){var b=c.responseText;if(b=="err"){set($("hit"),"\u53d1\u751f\u9519\u8bef")}else{set($("hit"),b)}})}function addFavorite(b,a){try{window.external.addFavorite(b,a)}catch(c){try{window.sidebar.addPanel(a,b,"")}catch(c){alert("\u52a0\u5165\u6536\u85cf\u5931\u8d25\uff0c\u8bf7\u4f7f\u7528Ctrl+D\u8fdb\u884c\u6dfb\u52a0")}}}function setHome(d,f,b){try{d.style.behavior="url(#default#homepage)";d.setHomePage(f);this.style.behavior="url(#default#homepage)";this.setHomePage(b)}catch(c){if(window.netscape){try{netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect")}catch(c){alert("\u6b64\u64cd\u4f5c\u88ab\u6d4f\u89c8\u5668\u62d2\u7edd\uff01\u8bf7\u624b\u52a8\u8bbe\u7f6e")}var a=Components.classes["@mozilla.org/preferences-service;1"].getService(Components.interfaces.nsIPrefBranch);a.setCharPref("browser.startup.homepage",f)}}}function addFace(a){$("m_content").value+="[ps:"+a+"]"}function openWin(c,a,d,f,e,b){window.open(c,"New_Win","toolbars=0, scrollbars=0, location=0, statusbars=0,menubars=0, resizable="+(b)+",width="+a+",height="+d+",left="+f+",top="+e)}function loadSlide(a,c){var b=1;document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,28,0" width="'+a+'" height="'+c+'"><param name="movie" value="/'+sitePath+'pic/slide/slide.swf" /><param name="quality" value="high"><param   name="wmode"   value="transparent"><param name="allowscriptaccess" value="always"><param name="allowfullscreen" value="true"><param name="flashvars" value="type='+b+"&domain=/"+sitePath+'pic/slide/"><embed src="/'+sitePath+'pic/slide/slide.swf" flashvars="type='+b+"&domain=/"+sitePath+'pic/slide/" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" allowfullscreen="true" width="'+a+'" height="'+c+'"></embed></object>')}function stringReplaceAll(d,b,c){var a=new RegExp(b,"g");return d.replace(a,c)}function autoCheckWrong(d,c,a,b){ajax.get("/"+sitePath+"inc/ajax.asp?action=autocheck&from="+c+"&id="+d.replace(/&/g,"%26")+"&vid="+a+"&err="+b,function(e){})}function autoSubmitErr(a,b){if(a[2]=="youku"||a[2]=="iask"||a[2]=="tudou"){autoCheckWrong(a[1],a[2],play_vid,"\u7b2c"+(parseInt(b)+1)+"\u7ec4\u6765\u6e90\u4e2d\u7684\u6570\u636e:"+a[0]+"$"+a[1].replace(/&/g,"%26")+"$"+a[2])}};
