
function chkUserName(code)
{var strangCode="abcdefghijklmnopqrstuvwxyz0123456789_";var temp;for(var i=0;i<code.length;i++)
{temp=code.substring(i,i+1);if(strangCode.indexOf(temp)==-1)
{return(false);}}}
function $dom(s){return document.getElementById(s);}
function chkPassWord(str)
{var strSource="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ`~!@#$%^&*()_-+=|\}{[]:;'?/>.,<";var ch;var i;var temp;for(i=0;i<=(str.length-1);i++)
{ch=str.charAt(i);temp=strSource.indexOf(ch);if(temp==-1)
{return 0;}}
if(strSource.indexOf(ch)==-1)
{return 0;}
else
{return 1;}}
function chkTelephone(Tel)
{var i,j,strTemp;strTemp="0123456789-+#()";if(Tel.length<7)
{return 0;}
for(i=0;i<Tel.length;i++)
{j=strTemp.indexOf(Tel.charAt(i));if(j==-1)
{return 0;}}
return 1;}
function chkEmail(a)
{var i=a.length;var temp=a.indexOf('@');var tempd=a.indexOf('.');if(tempd>0){tempd=(a.substring(temp)).indexOf('.');if(temp>1){if((i-temp)>7){if(tempd>2){if((i-temp-tempd)>2){return 1;}}}}}
return 0;}
function chkNumeric(NUM)
{var i,j,strTemp;var PointNum;PointNum=0
strTemp="0123456789.";if(NUM=="")return 0;for(i=0;i<NUM.length;i++)
{j=strTemp.indexOf(NUM.charAt(i));if(j==-1)
{return 0;}
if(j==10)
{PointNum=PointNum+1;}}
if(PointNum>1)
{return 0;}
return 1;}
function chkInteger(NUM)
{var i,j,strTemp;strTemp="0123456789";if(NUM=="")return 0;for(i=0;i<NUM.length;i++)
{j=strTemp.indexOf(NUM.charAt(i));if(j==-1)
{return 0;}}
return 1;}
function DrawImage(ImgD,x,y){var flag=false;var image=new Image();image.src=ImgD.src;if(image.width>0&&image.height>0){flag=true;if(image.width/image.height>=x/y){if(image.width>x){ImgD.width=x;ImgD.height=(image.height*x)/image.width;}else{ImgD.width=image.width;ImgD.height=image.height;}}
else{if(image.height>y){ImgD.height=y;ImgD.width=(image.width*y)/image.height;}else{ImgD.width=image.width;ImgD.height=image.height;}}}}
function chkImageSize(ImgD,x,y,s){var image=new Image();image.src=ImgD.value;if(image.width>x||image.height>y){alert("您当前"+s+"图片的尺寸为："+image.width+"*"+image.height+"像素;\n系统要求图片尺寸小于"+x+"*"+y+"像素.\n请重新选择图片。");return false;}
else
return true;}
function chkSafe(a)
{fibdn=new Array("'",'\\',"/");i=fibdn.length;j=a.length;for(ii=0;ii<i;ii++)
{for(jj=0;jj<j;jj++)
{temp1=a.charAt(jj);temp2=fibdn[ii];if(temp1==temp2)
{return 0;}}}
return 1;}
function chkSpc(a)
{var i=a.length;if(i==0)
{return 0;}
for(j=0;(j<i)&&(a.charAt(j)==' ');j++)
{}
if(i==j)
{return 0;}
else
{return 1;}}
function IsExt(url,opt){var sTemp;var b=false;if(url=="")
{return b;}
var s=opt.toUpperCase().split("|");for(var i=0;i<s.length;i++){sTemp=url.substr(url.length-s[i].length-1);sTemp=sTemp.toUpperCase();s[i]="."+s[i];if(s[i]==sTemp){b=true;break;}}
return b;}
function chkLength(strTemp)
{var i,sum;sum=0;for(i=0;i<strTemp.length;i++)
{if((strTemp.charCodeAt(i)>=0)&&(strTemp.charCodeAt(i)<=255))
sum=sum+1;else
sum=sum+2;}
return sum;}
function strangecode(code)
{var strangCode="~`!@#$%^&*()_+=-|\'/？,，。.<>";var temp;for(var i=0;i<code.length;i++)
{temp=code.substring(i,i+1);if(strangCode.indexOf(temp)!=-1)
{return(false);}}}
function jtrim(str)
{while((str.charAt(0)==" ")||(str.charAt(0)=="　"))
{str=str.substr(1);}
while(str.charAt(str.length-1)==" ")
{str=str.substr(0,str.length-1);}
return(str);}
function checkAll(obj)
{if(typeof(obj.length)=="undefined")
{if(typeof(obj)=="object")
obj.checked=!obj.checked;return;}
for(var i=0;i<obj.length;i++)
{obj[i].checked=!obj[i].checked;}}
function checkSub(theform,theid)
{var k=0;for(var i=0;i<theform.elements.length;i++)
{var e=theform.elements[i];if(e.name==theid)
{if(e.checked==true)
{k++;}}}
return k;}
function setCookie(name,value){document.cookie=name+"="+value+"; path=/;expires=Thursday,01-Jan-2099 00:00:00 GMT";}
function getCookie(name){var search;search=name+"=";offset=document.cookie.indexOf(search);if(offset!=-1){offset+=search.length;end=document.cookie.indexOf(";",offset);if(end==-1)
end=document.cookie.length;return unescape(document.cookie.substring(offset,end));}
else
return"";}
function deleteCookie(name){setCookie(name,"");}
function nohtml(s){var reTag=/<(?:.|\s)*?>/g;return s.replace(reTag,"");}
var $=function()
{for(var i=0,a=[];i<arguments.length;i++)
{var e=arguments[i];a[i]=null
if("object"==typeof(e)&&e.tagName&&e!=window)a[i]=e;if("string"==typeof(e)&&(e=document.getElementById(e)))a[i]=e;}
return a.length<2?a[0]:a;}
String.prototype.subByte=function(n)
{if(this.getByteLength()<=n)return this;for(var i=Math.floor((n=n-2)/2),l=this.length;i<l;i++)
if(this.substr(0,i).getByteLength()>=n)return this.substr(0,i)+"\u2026";return this;};String.prototype.getByteLength=function(){return this.replace(/[^\x00-\xff]/g,"mm").length;};String.prototype.trim=function(){return this.replace(/(^[\s\t\xa0\u3000]+)|([\u3000\xa0\s\t]+$)/g,"")};String.prototype.format=function()
{if(arguments.length==0)return this;for(var s=this,i=0;i<arguments.length;i++)
s=s.replace(new RegExp("\\{"+i+"\\}","g"),arguments[i]);return s;};String.format=function(str)
{if("string"!=typeof(str)||arguments.length<=1)return str;for(var i=1;i<arguments.length;i++)
str=str.replace(new RegExp("\\{"+(i-1)+"\\}","g"),arguments[i]);return str;};if(window.HTMLElement&&navigator.userAgent.toLowerCase().indexOf("opera")==-1){HTMLElement.prototype.contains=function(e){do if(e==this)return true;while(e=e.parentNode);return false;};HTMLElement.prototype.__defineGetter__("outerHTML",function()
{var a=this.attributes,str="<"+this.tagName,i=0;for(;i<a.length;i++)
if(a[i].specified)str+=" "+a[i].name+'="'+a[i].value+'"';if(!this.canHaveChildren)return str+" />";return str+">"+this.innerHTML+"</"+this.tagName+">";});HTMLElement.prototype.__defineSetter__("outerHTML",function(s)
{var r=this.ownerDocument.createRange();r.setStartBefore(this);r=r.createContextualFragment(s);this.parentNode.replaceChild(r,this);return s;});HTMLElement.prototype.__defineGetter__("canHaveChildren",function()
{switch(this.tagName.toLowerCase())
{case"area":case"base":case"basefont":case"col":case"frame":case"hr":case"img":case"br":case"input":case"link":case"meta":case"isindex":case"param":return false;}return true;});HTMLElement.prototype.__defineGetter__("currentStyle",function()
{return this.ownerDocument.defaultView.getComputedStyle(this,null);});HTMLElement.prototype.__defineGetter__("children",function()
{for(var a=[],j=0,n,i=0;i<this.childNodes.length;i++){n=this.childNodes[i];if(n.nodeType==1){a[j++]=n;if(n.name){if(!a[n.name])a[n.name]=[];a[n.name][a[n.name].length]=n;}
if(n.id)a[n.id]=n;}}return a;});HTMLElement.prototype.insertAdjacentHTML=function(where,html)
{var e=this.ownerDocument.createRange();e.setStartBefore(this);e=e.createContextualFragment(html);switch(where)
{case'beforeBegin':this.parentNode.insertBefore(e,this);break;case'afterBegin':this.insertBefore(e,this.firstChild);break;case'beforeEnd':this.appendChild(e);break;case'afterEnd':if(!this.nextSibling)this.parentNode.appendChild(e);else this.parentNode.insertBefore(e,this.nextSibling);break;}};HTMLElement.prototype.__defineGetter__("innerText",function(){var anyString="";var childS=this.childNodes;for(var i=0;i<childS.length;i++)
{if(childS[i].nodeType==1)
anyString+=childS[i].tagName=="BR"?'\r\n':childS[i].innerText;else if(childS[i].nodeType==3)
anyString+=childS[i].nodeValue.trim();}
return anyString;});}
if(!window.attachEvent&&window.addEventListener)
{window.attachEvent=HTMLElement.prototype.attachEvent=document.attachEvent=function(en,func,cancelBubble)
{var cb=cancelBubble?true:false;this.addEventListener(en.toLowerCase().substr(2),func,cb);};window.detachEvent=HTMLElement.prototype.detachEvent=document.detachEvent=function(en,func,cancelBubble)
{var cb=cancelBubble?true:false;this.removeEventListener(en.toLowerCase().substr(2),func,cb);};}
function getCookie(name)
{var arr,reg=new RegExp("(^| )"+name+"=([^;]*)(;|$)");if(arr=document.cookie.match(reg))return unescape(arr[2]);else return null;}
function GetScrollXY(){var x=0,y=0
if(document.documentElement.scrollTop){x=document.documentElement.scrollLeft;y=document.documentElement.scrollTop;}
else{x=document.body.scrollLeft;y=document.body.scrollTop;}
return{x:x,y:y}}
function getEventXY(e){var posx=0,posy=0;if(e==null)e=window.event;if(e.pageX||e.pageY)
{posx=e.pageX;posy=e.pageY;}
else if(e.clientX||e.clientY)
{posx=e.clientX+GetScrollXY().x;posy=e.clientY+GetScrollXY().y;}
return{"x":posx,"y":posy};}
function realOffset(o)
{if(!o)return null;var e=o,x=y=l=t=0;do{l+=e.offsetLeft||0;t+=e.offsetTop||0;e=e.offsetParent;}while(e);do{x+=o.scrollLeft||0;y+=o.scrollTop||0;o=o.parentNode;}while(o);var xy=GetScrollXY();return{"x":l-x+xy.x,"y":t-y+xy.y};};var menuOffX=0
var menuOffY=18
var vBobjects=new Array();var fo_shadows=new Array();var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers
function chkSearch(form)
{if(form.sKeyWord.value=="")
{alert("请输入搜索内容！");form.sKeyWord.focus();return false;}
form.submit();}
function orderChange(v)
{if(v!="")
document.orderForm.submit();}
function changeCssStyle(obj)
{var sCssType=obj.value;setCookie("STYLESHOW",sCssType);window.location.href='Forum.html';parent.left.document.location.reload();}
function swapForumNote(v)
{var n=document.getElementById("forumNote");var c=document.getElementById("chgForumNote");if(v)
{n.style.display='block';c.style.display='none';}
else
{n.style.display='none';c.style.display='block';}}
function initCountDownRedirector(){var x=document.getElementById("TimeCountNum");if(!x)return;var t=x.innerHTML;window.setTimeout("countDownRedirector()",1000);}
function countDownRedirector(){var x=document.getElementById("TimeCountNum");if(!x)return;var t=x.innerHTML;if(t>0){t--;x.innerHTML=t;window.setTimeout("countDownRedirector()",1000);}else{window.location=x.title;}}
function chkVote(theform){for(i=0;i<theform.v_item.length;i++)
{if(theform.v_item[i].checked)
{theform.submit();theform.bt_vote.disabled=false;return true;}}
alert("请最少选择一个投票项");return false;}
function copyTopicUrl(v){clipboardData.setData('Text',v);alert("复制成功!");}
function copyText(obj){ie=(document.all)?true:false
if(ie){var rng=document.remenu.createTextRange();rng.moveToElementText(obj);rng.scrollIntoView();rng.select();rng.execCommand("Copy");rng.collapse(false);}}
function gotoPage(){var newPage=document.getElementById('pageto').value;var f=document.forms['pageform'];if(!isNaN(newPage))
{if(f){f.elements['spage'].value=newPage;f.method="get";f.submit();}}}
function gotoPageDelegate(){try{var c=0;if(document.all){c=window.event.keyCode;}
if(c==13){gotoPage();return false;}}catch(e){}
return true;}
function MM_findObj(n,d){var p,i,x;if(!d)d=document;if((p=n.indexOf("?"))>0&&parent.frames.length){d=parent.frames[n.substring(p+1)].document;n=n.substring(0,p);}
if(!(x=d[n])&&d.all)x=d.all[n];for(i=0;!x&&i<d.forms.length;i++)x=d.forms[i][n];for(i=0;!x&&d.layers&&i<d.layers.length;i++)x=MM_findObj(n,d.layers[i].document);if(!x&&d.getElementById)x=d.getElementById(n);return x;}
function fetch_object(idname,forcefetch)
{if(typeof(vBobjects[idname])=="undefined")
{vBobjects[idname]=MM_findObj(idname);}
return vBobjects[idname];}
function showmenu(e,vmenu,vmenuobj,mod){if(!document.all&&!document.getElementById&&!document.layers)
return
var which=vmenu;if(vmenuobj)
{var MenuObj=fetch_object(vmenuobj);if(MenuObj)
{which=MenuObj.innerHTML;}}
if(!which)
{return}
clearhidemenu();ie_clearshadow();menuobj=ie4?document.all.popmenu:ns6?document.getElementById("popmenu"):ns4?document.popmenu:""
menuobj.thestyle=(ie4||ns6)?menuobj.style:menuobj
if(ie4||ns6)
menuobj.innerHTML=which
else{menuobj.document.write('<layer name=gui bgcolor="#E6E6E6" width="165" onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
menuobj.document.close()}
menuobj.contentwidth=(ie4||ns6)?menuobj.offsetWidth:menuobj.document.gui.document.width
menuobj.contentheight=(ie4||ns6)?menuobj.offsetHeight:menuobj.document.gui.document.height
eventX=ie4?event.clientX:ns6?e.clientX:e.x
eventY=ie4?event.clientY:ns6?e.clientY:e.y
var rightedge=ie4?document.body.clientWidth-eventX:window.innerWidth-eventX
var bottomedge=ie4?document.body.clientHeight-eventY:window.innerHeight-eventY
var getlength
if(rightedge<menuobj.contentwidth){getlength=ie4?document.body.scrollLeft+eventX-menuobj.contentwidth+menuOffX:ns6?window.pageXOffset+eventX-menuobj.contentwidth:eventX-menuobj.contentwidth}else{getlength=ie4?ie_x(event.srcElement)+menuOffX:ns6?window.pageXOffset+eventX:eventX}
menuobj.thestyle.left=getlength+'px'
if(bottomedge<menuobj.contentheight&&mod!=0){getlength=ie4?document.body.scrollTop+eventY-menuobj.contentheight-event.offsetY+menuOffY-23:ns6?window.pageYOffset+eventY-menuobj.contentheight-10:eventY-menuobj.contentheight}else{getlength=ie4?ie_y(event.srcElement)+menuOffY:ns6?window.pageYOffset+eventY+10:eventY}
menuobj.thestyle.top=getlength+'px'
menuobj.thestyle.visibility="visible"
ie_dropshadow(menuobj,"#999999",3)
return false}
function ie_y(e){var t=e.offsetTop;while(e=e.offsetParent){t+=e.offsetTop;}
return t;}
function ie_x(e){var l=e.offsetLeft;while(e=e.offsetParent){l+=e.offsetLeft;}
return l;}
function ie_dropshadow(el,color,size)
{var i;for(i=size;i>0;i--)
{var rect=document.createElement('div');var rs=rect.style
rs.position='absolute';rs.left=(el.style.posLeft+i)+'px';rs.top=(el.style.posTop+i)+'px';rs.width=el.offsetWidth+'px';rs.height=el.offsetHeight+'px';rs.zIndex=el.style.zIndex-i;rs.backgroundColor=color;var opacity=1-i/(i+1);rs.filter='alpha(opacity='+(100*opacity)+')';fo_shadows[fo_shadows.length]=rect;}}
function ie_clearshadow()
{for(var i=0;i<fo_shadows.length;i++)
{if(fo_shadows[i])
fo_shadows[i].style.display="none"}
fo_shadows=new Array();}
function contains_ns6(a,b){while(b.parentNode)
if((b=b.parentNode)==a)
return true;return false;}
function hidemenu(){if(window.menuobj)
menuobj.thestyle.visibility=(ie4||ns6)?"hidden":"hide"
ie_clearshadow()}
function dynamichide(e){e=fixE(e);if(ie4&&!menuobj.contains(e.toElement))
hidemenu()
else if(ns6&&e.currentTarget!=e.relatedTarget&&!contains_ns6(e.currentTarget,e.relatedTarget))
hidemenu()}
function delayhidemenu(){if(ie4||ns6||ns4)
delayhide=setTimeout("hidemenu()",500)}
function clearhidemenu(){if(window.delayhide)
clearTimeout(delayhide)}
function highlightmenu(e,state){if(document.all)
source_el=event.srcElement
else if(document.getElementById)
source_el=e.target
if(source_el.className=="menuitems"){source_el.id=(state=="on")?"mouseoverstyle":""}
else{while(source_el.id!="popmenu"){source_el=document.getElementById?source_el.parentNode:source_el.parentElement
if(source_el.className=="menuitems"){source_el.id=(state=="on")?"mouseoverstyle":""}}}}
function fixE(e){var e;e=e?e:(window.event?window.event:null);return e}
if(ie4||ns6)
document.onclick=hidemenu
function isArray(obj)
{if(!Array.prototype.push){Array.prototype.pop=function(){if(this.length!=0)this.length--;return this;}}
if(!Array.prototype.push){Array.prototype.push=function(){var startLength=this.length;for(var i=0;i<arguments.length;i++)
this[startLength+i]=arguments[i];return this.length;}}
try{obj.push(1);obj.pop();return true;}
catch(e)
{return false;}}
function filterArray(arr,str)
{if(!isArray(arr)){return false;}
for(var i=0;i<arr.length;i++)
{try{if(arr[i].toString()==str.toString()){return true}}catch(e){}}
return false;}
function getImgList(str)
{var re=/<img.+?>/ig;var arr=str.match(re);var i=0;var picArray=new Array();if(isArray(arr))
for(i=0;i<arr.length;i++)
{var re1=/http:\/\/.+?\.(jpg|gif|png)/ig;if(!filterArray(picArray,arr[i].match(re1)))
picArray[i]=arr[i].match(re1);}
return picArray;}
function showImgList(flag)
{var c=document.Gforms.Content;var out=document.getElementById('out_img_list');if(!c||!out){alert("找不到图片对象和列表！");return false;}
var list=getImgList(c.value);if(list.length<1){alert("内容中暂无图片");return false;}
if(!flag&&out.style.display=="inline")
{out.style.display="none";return;}
var out_html="";for(i=0;i<list.length;i++)
{if(list[i]!=""&&list[i]!='null'&&list[i]!=null)
out_html=out_html+"<li onclick=\"selImg('"+list[i]+"')\"><img src="+list[i]+" border=0  alt=\"选择当前图片请点击\" onload=\"DrawImage(this,100,100)\" ></li>";}
out.innerHTML=out_html;out.style.display="inline";}
function updateImgList(img)
{var out=document.getElementById('out_img_list');out.innerHTML=out.innerHTML+"<li onclick=\"selImg('"+img+"')\"><img src="+img+" border=0  alt=\"选择当前图片请点击\" onload=\"DrawImage(this,100,100)\" ></li>";}
function selImg(v)
{var obj=document.Gforms.bbsImg;obj.value=v;chooseImg(v);}
function openWin(url)
{if(url!="")window.open(url,'','height=100%, width=100%, top=0, left=0, toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no, status=no');}
function chooseImg(v)
{var out=document.getElementById('out_img_list');for(i=0;i<out.childNodes.length;i++)
{if(out.childNodes[i].childNodes[0].src.toString()==v)
{out.childNodes[i].className='choose';out.childNodes[i].childNodes[0].alt='当前推荐图片';}
else
out.childNodes[i].className='';}}

function getXMLHTTP()
{var xmlHttp=false;try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}catch(e){try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}catch(e2){xmlHttp=false;}}
if(!xmlHttp){if(typeof XMLHttpRequest!='undefined'){xmlHttp=new XMLHttpRequest();}else{xmlHttp=false;}}
return xmlHttp;}
function $$(s){return document.getElementById(s);}
function getAjaxText(Obj,_url,s1)
{$$(Obj).innerHTML="load...";var xmlHttp=getXMLHTTP();if(!xmlHttp)return;var Url=_url+"?Obj="+Obj+"&s1="+s1;xmlHttp.open("GET",Url,true);xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{if(xmlHttp.status==200)
{$$(Obj).innerHTML=xmlHttp.responseText;}}}
xmlHttp.send(null);}
function getAjaxValue(_url,s1)
{var xmlHttp=getXMLHTTP();if(!xmlHttp)return;var Url=_url+"?s1="+s1;xmlHttp.open("GET",Url,true);xmlHttp.onreadystatechange=function()
{if(xmlHttp.readyState==4)
{if(xmlHttp.status==200)
{return xmlHttp.responseText;}}}
xmlHttp.send(null);}

function doclick(n){for(var i=1;i<=3;i++){if(i==n){$dom("node"+i).className="SoItemActive";}
else{$dom("node"+i).className="SoItemLink";}}
if(n==1){$dom("soform").action="Search.asp?sItem=bytitle";$dom("top_so").style.display="";$dom("baidu_so").style.display="none";$dom("sKeyWord").value="请输入标题关键词！"}
else if(n==2){$dom("soform").action="Search.asp?sItem=byusername";$dom("top_so").style.display="";$dom("baidu_so").style.display="none";$dom("sKeyWord").value="请输入用户名！"}
else if(n==3){$dom("top_so").style.display="none";$dom("baidu_so").style.display="";}}
function checkform(theform)
{if(theform.sKeyWord.value.indexOf("请输入")>-1||theform.sKeyWord.value.length==0){alert("请输入要找的关键词!");return false;}
return;}
function showChangeCity(){document.getElementById("cityBox").style.display="block";}
function hiddenChangeCity(){document.getElementById("cityBox").style.display="none";}
function importJS(path){document.write("<"+"script   language=javascript   src=\""+path+"\"></"+"script>");}
function importCSS(path){document.write("<"+"link   href=\""+path+"\"rel=stylesheet   type=text/css>");}
(function(){var isReady=false;var readyList=[];var timer;ready=function(fn){if(isReady)
fn.call(document);else
readyList.push(function(){return fn.call(this);});return this;}
var onDOMReady=function(){for(var i=0;i<readyList.length;i++){readyList[i].apply(document);}
readyList=null;}
var bindReady=function(evt){if(isReady)return;isReady=true;onDOMReady.call(window);if(document.removeEventListener){document.removeEventListener("DOMContentLoaded",bindReady,false);}else if(document.attachEvent){document.detachEvent("onreadystatechange",bindReady);if(window==window.top){clearInterval(timer);timer=null;}}};if(document.addEventListener){document.addEventListener("DOMContentLoaded",bindReady,false);}else if(document.attachEvent){document.attachEvent("onreadystatechange",function(){if((/loaded|complete/).test(document.readyState)){bindReady();}});if(window==window.top){timer=setInterval(function(){try{isReady||document.documentElement.doScroll('left');}catch(e){return;}
bindReady();},5);}}})();