var iseditor="" //未加载模板在线编辑器

function showimg(src,alt,width){
	document.write("<img src=\""+src+"\" alt=\""+alt+"\"");
	if(width.length>0){document.write(" width=\""+width+"\"");}
	document.write(" onload=\"rsimg(this,"+width+")\"");
	document.write(" />");
}
function rsimg(o,w){
	if(o.width>w){
		o.resized=true;
		o.width=w;
		o.height=(w/o.width)*o.height;
	}
}
function bbimg(o){
	var zoom=parseInt(o.style.zoom, 10)||100;zoom+=event.wheelDelta/12;if (zoom>0) o.style.zoom=zoom+'%';
	return false;
}

function getsize(size) {
    if (size==null) return false;
    size = (size / 1024);
	size = Math.round(size);
	if(size==0){size=1}
    document.write(size+"k");
}

/*用户登录后,自动跳转页面*/
function MM_goToURL() {
	var I, args=MM_goToURL.arguments; document.MM_returnValue = false;
	for (I=0; I<(args.length-1); I+=2) eval(args[I]+".location='"+args[I+1]+"'");
}	
function chkdiv(divid){
	var chkid=document.getElementById(divid);
	if(chkid != null){return true; }
	else {return false; }
}  
//转换提交action,用于中文后台操作,change submit
function Csubmit(obj,saction,sconfirm)	{
		if (sconfirm==""){
			getobj(obj).action=saction;
			getobj(obj).submit();
		}
		else {
			if (Cconfirm(sconfirm)==true) {
				getobj(obj).action=saction;
				getobj(obj).submit();
			}
		}
}
//other submit
function osubmit(obj,thisaction,confirmstr){
		if (confirmstr==""){
			getobj(obj).action=thisaction;
			getobj(obj).submit();
		}
		else {
			if (Cconfirm(confirmstr)==true) {
				getobj(obj).action=thisaction;
				getobj(obj).submit();
			}
		}
}
//发表评论
function newpost(obj,width,height)	{
    var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
	newWindow = window.open ('','newpost','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=1,resizable=0');
	newWindow.focus();
	getobj(obj).submit();
}

function Cconfirm (str){
	if (str != "") {
		if (confirm(str)) {
			return true;
		}
		else {
		return false;
		}
	}
	else {
		return true;
	}	
} 
//前台提交,确认/
function Dosubmit(saction,sconfirm)	{
		if (Doconfirm(sconfirm)==true) {
			document.myform.action=saction;
			document.myform.submit();
		}
}

function Doconfirm (str){
	if (str != "") {
		if (confirm(str)) {
			return true;
		}
		else {
		return false;
		}
	}
	else {
		return true;
	}	
}

//下拉菜单
function showsubmenu(id){
	var obj = document.getElementById(id)
	if (obj.style.display == "none"|obj.style.display==''){
		obj.style.display = "block";
	}
	else{
		obj.style.display="none";
	}
}

//控制字体大小
//size=12 14 或16
//str=obj
function doZoom(size,str){if (chkdiv(str)) {document.getElementById(str).style.fontSize=size+'px';}}

function CheckSel(Voption,Value)
{
	var obj = document.getElementById(Voption);
	for (i=0;i<obj.length;i++){
		if (obj.options[i].value==Value){
		obj.options[i].selected = true;
		break;
		}
	}
}
//只有一个选项的复选框
function CheckBox(Voption,Value){
	var obj = document.getElementById(Voption);
		if (obj.value==Value){
		obj.checked = true;
		}
}  
function CheckInput(Voption,Value)
{
	if (chkdiv(Voption))
	{
	getobj(Voption).value=Value;
	}
}
//单选表单选取 Obj 表单名，VAL所选的值
function chkradio(obj)
{
	if (chkdiv(obj))
	{
		getobj(obj).checked=true;
	}
}

function lethtml(obj,value){
	if (document.getElementById(obj) != null){
		getobj(obj).innerHTML=value;
	}	
}
function CheckAll(form) {  
	for (var i=0;i<form.elements.length;i++)  {  
		var e = form.elements[i];  
		if (e.name != 'chkall')  
		e.checked = true // form.chkall.checked;  
	}  
} 
function unselectall(thisform){
	if(thisform.chkAll.checked){
		thisform.chkAll.checked = thisform.chkAll.checked&0;
	}   
 }
//反选
function ContraSel(form) {
	for (var i=0;i<form.elements.length;i++){
		var e = form.elements[i];
		if (e.name != 'chkall')
		e.checked=!e.checked;
	}
}

function doPreview(objname){
	var obj=document.getElementById(objname);
	if(obj.length==0) return false;
	var url=obj.value; 

	if (url){
		var sExt=url.substr(url.lastIndexOf(".")+1);
		sExt=sExt.toUpperCase();
		var sHTML;
		switch(sExt){
		case "GIF":
		case "JPG":
		case "BMP":
		case "PNG":
			//tdPreview.innerHTML = "<img border=0 src='" + url + "' width='170' height='140'>";
		document.getElementById("tdPreview").innerHTML="<img border=0 src='" + url + "' onclick='javascript:window.open(this.src);' style='CURSOR: pointer' onload='rsimg(this,180 )'>";
		//if (chkdiv("thisimgurl")) {document.getElementById("thisimgurl").value = url}
			break;
		default:
			document.getElementById("tdPreview").innerHTML = "";
			break;
		}
		//tdPreview.innerHTML = sHTML;
	}else{
		document.getElementById("tdPreview").innerHTML = "";
	}
	if (chkdiv("thisimgurl")) {document.getElementById("thisimgurl").value = url}
}

function hoverview(str){
	if (str){
		var sExt=str.substr(str.lastIndexOf(".")+1);
		sExt=sExt.toUpperCase();
		var sHTML;
		switch(sExt){
		case "GIF":
		case "JPG":
		case "BMP":
		case "PNG":
		case "JPEG":
		document.write("<span><img src='"+str+"' width='120' height='88' alt='"+str+"' /></span>");
		break;
		default:
			break;
		}
}
}

//自动返回网页
function backurl()
	{
	MM_goToURL('self',document.getElementById('backurl').href);
	return document.MM_returnValue
}

function ToValue(type,objname,strvalue)
{ 
	var obj=document.getElementById(objname)
	if (type=="add"){
		var stemp=obj.value.replace(strvalue,'')
		obj.value=stemp+strvalue;
		}
	else if (type=="+"){obj.value=parseInt(obj.value)+parseInt(strvalue);}
	else{obj.value=strvalue;}
	obj.focus(); 
 return; 
}

//点击后自动复制
function copyText(txt){       
     if(window.clipboardData)
     {
        window.clipboardData.clearData();
        window.clipboardData.setData("Text", txt);
        //alert("复制成功！")
     }
     else if(navigator.userAgent.indexOf("Opera") != -1)
     {
		 alert("opera浏览器不支持复制到剪贴板");
        //window.location = txt;
     }
     else if (window.netscape)
     {
       try
       {
          netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
       }
       catch (e)
       {
          alert("被浏览器拒绝！\n请在浏览器地址栏输入'about:config'并回车\n然后将'signed.applets.codebase_principal_support'设置为'true'");
       }
        var clip = Components.classes['@mozilla.org/widget/clipboard;1'].createInstance(Components.interfaces.nsIClipboard);
        if (!clip)
               return;
        var trans = Components.classes['@mozilla.org/widget/transferable;1'].createInstance(Components.interfaces.nsITransferable);
        if (!trans)
               return;
        trans.addDataFlavor('text/unicode');
        var str = new Object();
        var len = new Object();
        var str = Components.classes["@mozilla.org/supports-string;1"].createInstance(Components.interfaces.nsISupportsString);
        var copytext = txt;
        str.data = copytext;
        trans.setTransferData("text/unicode",str,copytext.length*2);
        var clipid = Components.interfaces.nsIClipboard;
        if (!clip)
               return false;     
        clip.setData(trans,null,clipid.kGlobalClipboard);
        //alert("复制成功！")
     }
}  


//跟据ID得到元素对象
function getobj(id){
	return document.getElementById(id);
}



//判断用户是否设置了单选按钮
function ischeckedradio(formid,radioname){
	var f=getobj(formid);
	for (var i=0;i<f.elements.length;i++){
		if(f.elements[i].name==radioname&&f.elements[i].checked) return true;
	}
	return false;
}

/*Textarea限制输入最大字符数*/
function isNotMax(obj,num){
	return getobj(obj).value.length!=num;
}

//加载在线编辑器,num=css数
function wedonetedit(obj,num){
	var thisvalue="";
	var css = webdir + "css/wedonet_all.css";
	if(chkdiv(obj+"value")){
		thisvalue = getobj(obj+"value").value ;
	}

	var oFCKeditor = new FCKeditor(obj) ;

	if (isNaN(num)==false) 	{css+="," + webdir + "css/wedonet" + num + ".css";}
	if (istruemaster!=null)
	{
		if(istruemaster==true) {
		oFCKeditor.Config['LinkBrowser'] = true;
		oFCKeditor.Config['ImageBrowser'] = true;
		oFCKeditor.Config['FlashBrowser'] = true;
		oFCKeditor.Config['LinkUpload'] = true;
		oFCKeditor.Config['ImageUpload'] = true;
		oFCKeditor.Config['FlashUpload'] = true; 
	}
	}

	oFCKeditor.Config['EditorAreaCSS']	= css;
	oFCKeditor.Value					= thisvalue ;

	oFCKeditor.Create();
}
//模板在线编辑器
function SoonhostEdit(obj,num)
	{
	var oFCKeditor = new FCKeditor(obj) ;
	var css
	css									= webdir + "css/wedonet_all.css";
	if (isNaN(num)==false) 	{css+="," + webdir + "css/wedonet_" + num + ".css";}
	iseditor							= true; //为后面的提交确认位置,为空则从在线编辑器提取值
	oFCKeditor.Config['EditorAreaCSS']	= css;
	if (istruemaster!=null)
	{
		if(istruemaster==true) {
		oFCKeditor.Config['LinkBrowser'] = true;
		oFCKeditor.Config['ImageBrowser'] = true;
		oFCKeditor.Config['FlashBrowser'] = true;
		oFCKeditor.Config['LinkUpload'] = true;
		oFCKeditor.Config['ImageUpload'] = true;
		oFCKeditor.Config['FlashUpload'] = true; 
	}
	}

	oFCKeditor.ReplaceTextarea();
	}

function showinnew(obj,width,height) {
    URL=obj.href;
    var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
    window.open(URL,'','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=1,resizable=0');
    return false;
}

function readvote(str,width,height){
    var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
    window.open('voteread.asp?classid='+str,'','width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=1,resizable=0');
    return false;	
}

//提交到新窗口执行
function postnewwin(obj,width,height){
	var left = ( screen.width - width ) / 2;
    var top = ( screen.height - height ) / 2;
	window.open("","postnewwin",'width='+width+',height='+height+',top='+top+',left='+left+',scrollbars=1,resizable=0');
	obj.target="postnewwin";
} 

function tohref(obj,str){
	if (document.getElementById(obj)!=null){document.getElementById(obj).href=str;}
}

//=====================================输入检测
//空值检测,inputtitle=ID inputname=文本框注释
function chkempty(inputtitle,inputname){
	var obj = document.getElementById(inputtitle);
	if (obj.value=="" ){
		alert(inputname);
		obj.focus();
		return false;
	}
	return true;
}

//正在执行操作提示,要求把需要变为提示的地方用<span id="prosing">括起
function probar(){
	var obj=document.getElementById("prosing")
	obj.innerHTML= "处理中...";
}
function getcode(){
	if (document.getElementById("verifycodeimgid"))
	{
	document.getElementById("verifycodeimgid").innerHTML='<img src="'+webdir+'getcode.asp?t='+Math.random()+'" width="50" height="12" alt="验证码" title="验证码,看不清楚?请点击刷新验证码" style="cursor:pointer; vertical-align:middle;height:12px;" onclick="refreshstrcode(this)" />';
	}
}
function refreshstrcode(obj){
	obj.src= webdir + "getcode.asp?t=" + Math.random();
}

//问题状态
function isover(num){
	switch (num){
		case 0 :
			document.write("等待回复");
			break;
		case 1 :
			document.write("正在处理");
			break;
		case 2 :
			document.write("已经回复");
			break;
	}
}


//编辑有问必答
function editask(num){
	var obj=document.getElementById("content"+num);
	var content=obj.innerHTML
	obj.innerHTML="<form name='myform'"+num+" method='post' action='?act=saveeditrep&id="+num+"'><textarea id='content"+num+"' name='content'>"+content+"</textarea><br /><div id='operate'><input type='submit' name='submit' value='保存' /></div></form>"
	SoonhostEdit("content"+num);
}
function editasktitle(num){
	var obj=document.getElementById("title"+num);
	var title=obj.innerHTML
	obj.innerHTML="<form name='myform'"+num+" method='post' action='?act=savetitle&id="+num+"'><input type='text' name='title' id='title"+num+"' value='"+title+"' size='50'/>&nbsp;<input type='submit' name='submit' value='修改' /></form>"
}

  function   showimgbutton(num)  
  {  
      getobj("img"+num).style.display="inline"; 
	  getobj("imgstate"+num).style.display="none"; 
  } 
function GetInnerHTML(obj)
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance(obj) ;

	return oEditor.EditorDocument.body.innerHTML;
}

//向在线编辑器插入值
function InsertHTML(str)
{
	// Get the editor instance that we want to interact with.
	var oEditor = FCKeditorAPI.GetInstance("content") ;

	// Check the active editing mode.
	if ( oEditor.EditMode == FCK_EDITMODE_WYSIWYG )
	{
		// Insert the desired HTML.
		oEditor.InsertHtml(str) ;
	}
}
//str 图片obj
function docoutengimg(obj,str){
{
	if (str.lenth==0){return false;}
	if (obj.length==0)	{return false;}

	// Get the editor instance that we want to interact with.
	var oEditor = window.parent.FCKeditorAPI.GetInstance(obj) ;
	//var oEditor = window.parent.InnerDialogLoaded().FCK;

	// Check the active editing mode.
	if ( oEditor.EditMode == window.parent.FCK_EDITMODE_WYSIWYG )
	{
		// Insert the desired HTML.
		oEditor.InsertHtml("<img src=\""+getobj(str).value+"\" alt=''>") ;
	}
}
}

//user_blog提交用户部分模板
function upusertemplate(num){ 
	var browser = navigator.appName; 
	if(browser == "Microsoft Internet Explorer"){ 
		var objAjax = new ActiveXObject("Microsoft.XMLHTTP"); 
		}
	else{ 
		var objAjax = new XMLHttpRequest(); 
		} 
	if(objAjax){
		//msgbox.style.display="block";
		objAjax.onreadystatechange=function(){
			if(objAjax.readyState==4){
				if(objAjax.status==200){
					getobj("imgstate"+num).style.display="inline"
					getobj("img"+num).style.display="none"
					setTimeout("showimgbutton("+num+")",2000);

					getobj("msgsubmit").innerHTML=objAjax.responseText;
				}
				else{getobj("msgsubmit").innerHTML=objAjax.responseText;}
			}
		//else{imgbutton.innerHTML="Loading..."}
		}

  objAjax.open('POST','user_blog.asp?act=savepart&arrid='+num,true);
  objAjax.setRequestHeader('Content-Type','application/x-www-form-urlencoded');

  var SendData = 'templatestr='+escape(getobj("t"+num).value) ; 
  objAjax.send(SendData);
 }
 else{
 imgbutton.innerHTML='不支持XMLHttpRequest' ;
 }
}

//插入flash
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}else{this.addParam("wmode","transparent");}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;
//插入跑马灯
eval(function(p,a,c,k,e,r){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)r[e(c)]=k[c]||e(c);k=[function(e){return r[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('k={1Y:{2f:"25 1X",1O:1.5,24:"22 1W (1U://1N.1J)",2d:"2c 27 26"},m:[],t:{19:17,1z:1V,z:\'1S\',Z:0,1d:0},1r:D(){v a=29.1D(\'1C\'),i;M(i=0;i<a.F;i++){v b=a[i].V.S(\' \'),q=18;l(k.C(b,k.t.z+\'B\')){q=\'B\'}E l(k.C(b,k.t.z+\'T\')){q=\'T\'}E l(k.C(b,k.t.z+\'r\')){q=\'r\'}E l(k.C(b,k.t.z+\'Q\')){q=\'Q\'}l(q){k.1w(a[i],q)}}l(!k.19){l(k.m.F>0){k.Y();l(k.t.Z){M(i=0;i<k.m.F;i++){l(k.m[i][11]>0){K.1L("k.Z("+k.m[i][11]+",0)",k.m[i][11])}}}l(k.t.1d===0){k.N(K,\'1K\',k.1f);k.N(K,\'1I\',k.Y);k.N(K,\'1H\',k.Y);k.N(K,\'1G\',k.Y)}}}},1w:D(a,b){v i,1c=17;l(a&&b){l(k.m.F>0){M(i=0;i<k.m.F;i++){l(k.m[i][2]===a){k.m[i][8]=b;1c=1F}}}}E{1c=1F}l(!1c){v c=0,p=1,U=0,x=0,X=0,o=a,O=o.V.S(\' \'),y=a.1m,w=18,1l=18,1b=18,1k=D(e){k.1j(e,0)},1i=D(e){k.1j(e,1)};l(y.V.1a(\'23\')>=0){y=y.1m}l(y){y.n.1h=\'21\';y.n.20=\'1Z\';v d=y.1D(\'1C\');M(i=0;i<d.F;i++){v f=d[i].V.S(\' \');l(k.C(f,k.t.z+b+\'1B\')){w=d[i]}}l(o){o.n.1h=\'1A\';o.n.R=o.n.r=0;W(b){s"B":o.n.R=(o.L*-1)+y.L+\'u\';A;s"Q":o.n.r=(o.I*-1)+y.I+\'u\';A}W(b){s"B":s"T":o.n.1y=y.I+\'u\';A;s"Q":s"r":o.n.1x=y.L+\'u\';A}l(w){w.n.1h=\'1A\';1l=w.I;1b=w.L;W(b){s"B":w.n.R=1b*-1+\'u\';A;s"T":w.n.R=o.L+\'u\';A;s"r":w.n.r=o.I+\'u\';A;s"Q":w.n.r=o.I*-1+\'u\';A}W(b){s"B":s"T":w.n.r=0;w.n.1y=y.I+\'u\';A;s"r":s"Q":w.n.R=0;w.n.1x=y.L+\'u\';A}}}l(k.C(O,k.t.z+\'p-\',1)){p=14(k.C(O,k.t.z+\'p-\',1)||10)/10;l(K.1e&&p<1){p=1}}l(k.C(O,k.t.z+\'1T\')){k.t.1d=1}l(k.C(O,k.t.z+\'x\')){x=1}l(k.C(O,k.t.z+\'X\')){X=1}l(k.C(O,k.t.z+\'16-\',1)){U=1;k.t.Z=1;c=k.C(O,k.t.z+\'16-\',1)*1R}l(k.C(O,k.t.z+\'1v\')){k.N(o,\'1u\',1i);k.N(o,\'1t\',1k);l(w){k.N(w,\'1u\',1i);k.N(w,\'1t\',1k)}}k.m.1M([y.L,y.I,o,o.L,o.I,w,1b,1l,b,p,U,c,x,X])}}},1P:D(a){l(a){M(v i=0;i<k.m.F;i++){l(k.m[i][2]===a){k.m.1Q(i,1)}}l(k.m.F<=0){k.1f()}}},1s:D(){M(v i=0;i<k.m.F;i++){v a=k.m[i][0],H=k.m[i][1],o=k.m[i][2],G=k.m[i][3],J=k.m[i][4],P=k.m[i][5],1o=k.m[i][6],1g=k.m[i][7],q=k.m[i][8],p=k.m[i][9],U=k.m[i][10],16=k.m[i][11],x=k.m[i][12],X=k.m[i][13];l(!U&&!16){l(X){G=k.m[i][3]=o.L;J=k.m[i][4]=o.I;l(P){1o=k.m[i][6]=P.L;1g=k.m[i][7]=P.I}}W(q){s\'B\':s\'T\':v b=14(o.n.R.S(\'u\')[0]);b=(x===2)?((q===\'B\')?b-p:b+p):((q===\'B\')?b+p:b-p);l(P&&!x){b=k.1q(q,\'R\',b,P,G,a,1o,p,x)}E{l(x){l(x===((q===\'B\')?1:2)&&((G>a&&b+p>0)||(G<a&&b+G+p>a))){k.m[i][12]=((q===\'B\')?2:1)}l(x===((q===\'B\')?2:1)&&((G>a&&b+G<a+p)||(G<a&&b<0))){k.m[i][12]=((q===\'B\')?1:2)}}E{l(q===\'B\'){l(b>H){b=(G)*-1}}E{l(b<G*-1){b=a}}}}o.n.R=b+\'u\';A;s\'r\':s\'Q\':v c=14(o.n.r.S(\'u\')[0]);c=(x===2)?((q===\'r\')?c+p:c-p):(q===\'r\')?c-p:c+p;l(P&&!x){c=k.1q(q,\'r\',c,P,J,H,1g,p,x)}E{l(x){l(x===((q===\'r\')?2:1)&&((J>H&&c+p>0)||(J<H&&c+J+p>H))){k.m[i][12]=((q===\'r\')?1:2)}l(x===((q===\'r\')?1:2)&&((J>H&&c+J<H+p)||(J<H&&c-p<0))){k.m[i][12]=((q===\'r\')?2:1)}}E{l(q===\'r\'){l(c<J*-1){c=H}}E{l(c>H){c=(J)*-1}}}}o.n.r=c+\'u\';A}}}},1q:D(a,b,c,d,e,f,g,h,i){v j;W(a){s\'B\':s\'Q\':j=14(d.n[b].S(\'u\')[0])+h;l(c>0&&c<=f){d.n[b]=c-g+\'u\'}l(j+g>=f&&j<=f+h){d.n[b]=j+\'u\';c=j+e*-1}1p c;s\'T\':s\'r\':j=14(d.n[b].S(\'u\')[0])-h;l(c+e<=f){d.n[b]=c+e+\'u\'}l(j+g<=f&&j+g+h>=0){d.n[b]=j+\'u\';c=j+g}1p c}},Y:D(e){l(!k.15){k.19=k.15=K.2b(k.1s,k.t.1z)}},1f:D(e){l(k.15){K.2a(k.15);k.19=k.15=17}},1j:D(e,a){l(e.1n||e.1E){v b=e.1n?e.1n:e.1E;M(v i=0;i<5;i++){l(b.V.1a(k.t.z+\'1v\')<0&&b.V.1a(\'1B\')<0){b=b.1m}E{A}}k.U(b,a)}},Z:D(a){l(a>0){M(v i=0;i<k.m.F;i++){l(a===k.m[i][11]){k.m[i][10]=k.m[i][11]=0}}}},U:D(a,b){l(a&&b>=0){M(v i=0;i<k.m.F;i++){l(a===k.m[i][2]||a===k.m[i][5]){k.m[i][10]=b}}}},C:D(a,b,c){v d=\'\';l(a&&b){M(v i=0;i<a.F;i++){l(c&&a[i].1a(b)>=0){d=a[i].S(b)[1];A}E l(a[i]===b){d=a[i];A}}}1p d},N:D(a,b,c){l(a&&b&&c){l(K.1e){a.1e("28"+b,c)}E{a.2e(b,c,17)}}}};k.N(K,\'2g\',k.1r);',62,141,'||||||||||||||||||||ByRei_jScroller2|if|obj|style|child_div|speed|direction|left|case|cache|px|var|child_endless|alternate|parent_div|prefix|break|down|check_array|function|else|length|child_div_height|parent_div_width|clientWidth|child_div_width|window|clientHeight|for|set_eventListener|child_div_classNames|endless_div|right|top|split|up|pause|className|switch|dynamic|start|delayer|||||parseFloat|timer|delay|false|null|active|indexOf|child_endless_Height|error|ileave|attachEvent|stop|endless_div_width|position|func_stop|start_stop|func_start|child_endless_Width|parentNode|target|endless_div_height|return|check_endless|init|scroller|mouseout|mouseover|mousemove|add|height|width|refreshtime|absolute|_endless|div|getElementsByTagName|srcElement|true|scroll|resize|focus|de|blur|setTimeout|push|markusbordihn|Version|remove|splice|1000|jscroller2_|ignoreleave|http|150|Bordihn|jScroller2|info|hidden|overflow|relative|Markus|jscroller2|Author|ByRei|Autoscroller|Generation|on|document|clearInterval|setInterval|Next|Description|addEventListener|Name|load'.split('|'),0,{}))

function format_time(str,num){
	var str = str.split(" ");
	var myday = str[0];
	var mytime= str[1];
	switch (num)
	{
	case 1:
		document.write(myday);
	}
}
//格式化货币
function format_currency(num){
	if (isNaN(num)) {
		document.write ("￥0.00元");	
	}
	else {
		document.write ("￥" + num.toFixed(2)+"元");
	}
}

function todiv(obj,str){
	if (chkdiv(obj))
	{
		getobj(obj).innerHTML=str;
	}
}


/*生成数字option*/
function selectnum(beginnum,endnum,stepnum){
	for(var i=beginnum;i<endnum;i+=stepnum){
		document.write("<option value="+i+">"+i+"</option>");
	}
}

function dopreimg(str){
	if (str.lenth==0){return false;}
	var obj=parent.document.getElementById("preimg");
	if(obj != null){obj.value=getobj(str).value}
}
/*插入下载*/
function domyrul(str){
	if (str.lenth==0){return false;}
	var obj=parent.document.getElementById("myurl");
	if(obj != null){

		var thisgap="\n"
		if(obj.value.length==0){
			obj.value="下载地址|"+getobj(str).value;
		}
		else{
			obj.value+=thisgap+"下载地址|"+getobj(str).value;
		}	
	}
}
/*在网页中间显示编辑框*/
function edit(obj,width,height){
	getobj(obj).style.width=width+"px";
	getobj(obj).style.height=height+"px";
	getobj(obj).style.display="block";
	getobj(obj).style.marginLeft="-"+width/2+"px";
	getobj(obj).style.marginTop="-"+height/2+"px";
	getobj("bg").style.display="block";
}
function closediv(obj){
	if (document.getElementById("bg")!=null){
		getobj("bg").style.display="none";
		showsubmenu(obj);
	}
}
function showoperate(num){
	getobj("operate"+num).style.display="block";
}
function hiddenoperate(num){
	getobj("operate"+num).style.display="none";
}
//编辑版主评价
function editadcomman(num,thisclassid,thistopicid,obj,width,height){
	edit(obj,width,height);
	getobj("adcomman").value=getobj("adcomman"+num).innerHTML;
	getobj("adcommanaction").action+=""+num+"&classid="+thisclassid+"&topicid="+thistopicid;
}

function mustfill(num){
	num=0+num;
	if (num==1) {document.write("<cite>*</cite>");}
}

//用户添加文章,提交后把分类和id附加到u后面
function userpostarticle(){
	getobj("myform").action+="w"+getobj("classid").value;
	getobj("myform").action+="w"+getobj("id").value;
	getobj("myform").action+="t"+getobj("topicid").value;
}

//mondy模块
//要求先传入字符串operatetype
function showoperatetype(num){
	document.write(operatetype.split("|")[num]);
}

/*拆分tags*/
/*num=b*/
function gettags(num,str){
	str+="";
	if (str.length==0)
	{
		document.write("");		
	}
	else{
		str = str.split(",");
		for (i=0;i<str.length;i++)
		{
			document.write("<a href=\"?b="+num+"&amp;myfield=tags&amp;keyword="+str[i]+"\">"+str[i]+"</a> ");
		}

	}
}
function articletags(thiscid,str){
	str+="";
	if (str.length==0)
	{
		document.write("");		
	}
	else{
		str = str.split(",");
		for (i=0;i<str.length;i++)
		{
			document.write("<a href=\"search.asp?act=searching&amp;thiscid="+thiscid+"&amp;myfield=tags&amp;keyword="+str[i]+"\">"+str[i]+"</a> ");
		}

	}
}
function cutstring(str,start,len)
/**
* 截取指定长度的字符串（中英文混合）
* @author xwl
* @param String str 要截取的字符串
* @param Int start 起始位置
* @param Int length 截取长度
* @return String 截取以后字符串
**/ 
{

  var ilen = start + len;
  var reStr = "";

  if(str.length<=ilen){
    return str;
  }
  
  for(i=0; i<ilen; i++)
  {
    if(escape(str.substr(i,1))>0xa0)
    {
      reStr += str.substr(i,2);
      i++;
    }
    else{
      reStr += str.substr(i,1);
    }
  }
  return reStr + "...";
}


function adjustFrameSize(obj)
  {

            var frm = document.getElementById(obj);
            var subWeb = document.frames ? document.frames[obj].document : frm.contentDocument;
           if(frm != null && subWeb != null)
          { 
                   frm.style.height="0px";//初始化一下,否则会保留大页面高度
                   frm.style.height = subWeb.documentElement.scrollHeight+"px"; 
                   frm.style.width = subWeb.documentElement.scrollWidth+"px"; 
                   subWeb.body.style.overflowX="auto";
                   subWeb.body.style.overflowY="auto";

    } }

function iframe(url,w,h,obj){
	obj=obj+"";
	if (obj.length==0)
	{
		obj="wedonet_form"
	}
	document.write("<iframe name=\""+obj+"\" id=\""+obj+"\" frameborder=\"0\" width=\""+w+"\" height=\""+h+"\" scrolling=\"no\" src=\""+url+"\" onload=\"adjustFrameSize('"+obj+"');\"></iframe>");
	}
/*投票所占百分比*/
/*num1=票数,num2=id,num3=最大宽度*/
function prevote(num1,num2,num3){
	if(allcount==0){allcount=1}
	document.write(Math.round(num1/allcount*100)+"%");
	getobj("votewidth"+num2).width=Math.round(num1/maxcount*num3);
}

function mygender(num){
	if (num==1)
	{
		document.write("男");
	}
	else
	{
		document.write("女");
	}
}


/*生成操作平台*/
function makeos(){
	var obj=getobj("f_myos");
	var myos;
	myos="";
	for (i=0;i<obj.length;i++){
		if (obj.options[i].selected==true){
			myos = myos + "," + obj.options[i].value;
		}
	}
	if(myos.slice(0,1)==","){myos=myos.slice(1,myos.length)}
	getobj("myos").value=myos;
	closediv("selectos");

}

function makeaccredit(){
	var obj=getobj("f_accredit");
	getobj("accredit").value=obj.value;
	closediv("selectaccredit");
}

/*下接菜单*/
function showmultimenu(){
	var thetarget;
	var isselected;
	document.write("<ul class='menuchannel'>");
	for (var i=0;i<multimenu.length;i++){
		multimenu[i]=multimenu[i].split("|");
	}
	for (var i=0;i<multimenu.length;i++){
		if (multimenu[i][0]=="0")
		{
			if(multimenu[i][4]=="1")
				{thetarget=" target='_blank'"}
			else{
				thetarget=""
			}
			if (multimenu[i][1]==cid)
			{
				isselected=" class=\"selected\"";
			}
			else 
			{	
				isselected="";
			}
			document.write("<li onmouseover=\"openchannel("+multimenu[i][1]+");\" onmouseout=\"closechannel("+multimenu[i][1]+");\" "+isselected+">");
			document.write("<a href='"+multimenu[i][2]+"'"+thetarget+">"+multimenu[i][3]+"</a>");
			showmenuclass0(multimenu[i][1]);
			document.write("</li>")
		}
	}
	document.write("</ul>");
}
/*num=父id*/
function showmenuclass0(num){
	var j=0;
	
	for (var i=0;i<multimenu.length;i++){
		if ((multimenu[i][0]==num) && (multimenu[i][5]=='0'))
		{
			if(j==0){document.write("<ul class='class0' id='channelmenu_"+num+"'>");j=1;}
			document.write("<li  onmouseover=\"openclass("+multimenu[i][1]+");\" onmouseout=\"closeclass("+multimenu[i][1]+");\">");
			document.write("<a href='"+multimenu[i][2]+"'>"+multimenu[i][3]+"</a>");
			showmenuclass1(multimenu[i][1]);
			document.write("</li>");
			
		}
	}
	if(j==1){document.write("</ul>");}
}
function showmenuclass1(num){
	var j=0;
	for (var i=0;i<multimenu.length;i++){
		if ((multimenu[i][0]==num) && (multimenu[i][5]==1))
		{
			if(j==0){document.write("<ul class='class1' id='classmenu_"+num+"'>");j=1;}
			document.write("<li><a href='"+multimenu[i][2]+"'>"+multimenu[i][3]+"</a></li>");
		}
	}
	if(j==1){document.write("</ul>");}
}
function openchannel(num){
	if (getobj("channelmenu_"+num)!=null){
	getobj("channelmenu_"+num).style.display="block";
	}
}
function closechannel(num){
	if (getobj("channelmenu_"+num)!=null){
	getobj("channelmenu_"+num).style.display="none";
	}
	}

function openclass(num){
	if (getobj("classmenu_"+num)!=null){
	getobj("classmenu_"+num).style.display="block";
	}
}
function closeclass(num){
	if (getobj("classmenu_"+num)!=null){
	getobj("classmenu_"+num).style.display="none";
	}
	}


function showmyurl(obj){
	var str=getobj(obj).value;
	str = str.replace(/\n/g,"#");
	str = str.replace(/\r/g,"");
	str=str.split("#");
	document.write("<ul>");
	for (var i=0;i<str.length;i++)
	{
		document.write("<li><a href='down.asp?"+window.location.href.split("?")[1]+"&amp;urlid="+i+"'>"+str[i].split("|")[0]+"</a></li>");
	}
	document.write("</ul>");
}
/*定单是否更新过*/
function isupdate(num){
	num=num+0;
	if (num==1)
	{
		document.write("<cite>(已修改)</cite>");
	}
}
function payorder(){
	probar();
	getobj('payform').submit();
}
/*收藏夹*/
function setBookmark(url,str){if(str=='')str=url;if(document.all)window.external.AddFavorite(url,str);else alert('同时按下Ctrl和D添加到收藏夹:\n"'+url+'".');}

/*标题样式*/
function getcolor(str){
	getobj("titlestyle").style.color=str;
}
function getweight(str){
	getobj("titlestyle").style.fontWeight=str;
}
function getdecoraction(str){
	getobj("titlestyle").style.textDecoration=str;
}
function itemorder(formname,obj,saction,sconfirm){
	CheckAll(formname);
	Csubmit(obj,saction,sconfirm);
}