window.onerror=new Function("return true");
function $(ID)
{
    if(document.getElementById&&document.getElementById(ID))
	{
		return document.getElementById(ID);
	}
	else if (document.all&&document.all(ID)) 
	{
		return document.all(ID);
	}
	else if (document.layers&&document.layers[ID])
	{
		return document.layers[ID];
	}
    else
    {
		return false;
	}
}
function Display(ID){
	if ($(ID).style.display == "none"){
		$(ID).style.display="";
	}else{
	    $(ID).style.display="none";
	}
}
function ToTop()
{
	for (var i=$("toTop").offsetTop; i>1; i-=Math.ceil(i/6))
	{
		window.scrollTo(0,i);
	}
	window.scroll(0,0);return false;
}
function Print(Str)
{
return document.write(Str);
}
function Flash(Path,Width,Height)
{
var Tmp
	Tmp='<object classid="clsid:D27CDB6E-AE6D-11CF-96B8-444553540000" id="FlashH" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0" border="0" width="'+Width+'" height="'+Height+'">'
	Tmp+='<param name="movie" value="'+Path+'"/>'
	Tmp+='<param name="quality" value="High"/>'
	Tmp+='<param name="scale" value="ExactFit"/>'
	Tmp+=' <param name="wmode" value="transparent"/>';
	Tmp+='<embed wmode="transparent" src="'+Path+'" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" name="FlashH" width="'+Width+'" height="'+Height+'" scale="ExactFit"/>'
	Tmp+='</object>'
Print(Tmp);
}

function PageBox(U,NowPage,PageCount,DataCount,PageSize)
{
var i;i=Math.max(1,NowPage-1);
document.write("<table width='100%'><tr><td width='50%'>　页次:"+NowPage+"/"+PageCount+"页 共"+DataCount+"条记录 "+PageSize+"条/每页<\/td>");
document.write("<td>");
document.write("<ul class='pagebox'>");
document.write("<li class='PageBoxLi'><a href='"+U+"1' title='首页'><span>&laquo;<\/span><\/a><\/li>");
document.write("<li class='PageBoxLi'><a href=\""+U+i+"\" title='上一页(第 "+i+" 页)'><</a><\/li>");
for(i=Math.max(1,NowPage-5);i<NowPage;i++)
	{
document.write("<li class='PageBoxLi'><a href='"+U+i+"' title='第"+i+"页'><span>"+i+"<\/span><\/a><\/li>");
	}
document.write("<li class='PageBoxLi'><a href='"+U+i+"' title='第"+i+"页'><span>"+NowPage+"<\/span></a><\/li>");
for(i=NowPage+1;i<=Math.min(PageCount,NowPage+5);i++)
	{
document.write("<li class='PageBoxLi'><a href='"+U+i+"' title='第"+i+"页'><span>"+i+"<\/span><\/a></li>");
	}
i=Math.min(PageCount,NowPage+1);
document.write("<li class='PageBoxLi'><a href=\""+U+i+ "\" title='下一页(第 "+i+"页)'>></a><\/li>");
document.write("<li class='PageBoxLi'><a href='"+U+PageCount+"' title='尾页'><span>&raquo;<\/span><\/a></li>");
document.write("<\/ul>");
document.write("<div style='clear:left;'><\/div>");
document.write("<\/td><\/tr><\/table>");
}

var MediaTemp=new Array();
function DjShow(strType,strID,strURL,intWidth,intHeight){var tmpstr;if (MediaTemp[strID]==undefined) MediaTemp[strID]=false; else MediaTemp[strID]=!MediaTemp[strID];if(MediaTemp[strID]){if(document.all){document.getElementById(strID).outerHTML = '<div id="'+strID+'"></div>';}else
{document.getElementById(strID).innerHTML='';}document.getElementById(strID+"_text").innerHTML="在线播放"}else{document.getElementById(strID+"_text").innerHTML="关闭在线播放"
switch(strType){case "swf":tmpstr='<div style="height:6px;overflow:hidden"></div><object codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+intWidth+'" height="'+intHeight+'"><param name="movie" value="'+strURL+'" /><param name="quality" value="high" /><param name="AllowScriptAccess" value="never" /><embed src="'+strURL+'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+intWidth+'" height="'+intHeight+'" /></object>';break;case "wma":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="CLSID:22d6f312-b0f6-11d0-94ab-0080c74c7e95"  id="MediaPlayer" width="450" height="70"><param name=""howStatusBar" value="-1"><param name="AutoStart" value="False"><param name="Filename" value="'+strURL+'"></object>';break;case "wmv":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,0,02,902" type="application/x-oleobject" standby="Loading..." width="'+intWidth+'" height="'+intHeight+'"><param name="FileName" VALUE="'+strURL+'" /><param name="ShowStatusBar" value="-1" /><param name="AutoStart" value="true" /><embed type="application/x-mplayer2" pluginspage="http://www.microsoft.com/Windows/MediaPlayer/" src="'+strURL+'" autostart="true" width="'+intWidth+'" height="'+intHeight+'" /></object>';break;case "rm":tmpstr='<div style="height:6px;overflow:hidden"></div><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="'+intHeight+'"><param name="SRC" value="'+strURL+'" /><param name="CONTROLS" VALUE="ImageWindow" /><param name="CONSOLE" value="one" /><param name="AUTOSTART" value="true" /><embed src="'+strURL+'" nojava="true" controls="ImageWindow" console="one" width="'+intWidth+'" height="'+intHeight+'"></object><br/><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="32" /><param name="CONTROLS" value="StatusBar" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+strURL+'" nojava="true" controls="StatusBar" console="one" width="'+intWidth+'" height="24" /></object>'+'<br /><object classid="clsid:CFCDAA03-8BE4-11cf-B84B-0020AFBBCCFA" width="'+intWidth+'" height="32" /><param name="CONTROLS" value="ControlPanel" /><param name="AUTOSTART" value="true" /><param name="CONSOLE" value="one" /><embed src="'+strURL+'" nojava="true" controls="ControlPanel" console="one" width="'+intWidth+'" height="24" autostart="true" loop="false" /></object>';break;case "qt":tmpstr='<div style="height:6px;overflow:hidden"></div><embed src="'+strURL+'" autoplay="true" loop="false" controller="true" playeveryframe="false" cache="false" scale="TOFIT" bgcolor="#000000" kioskmode="false" targetcache="false" pluginspage="http://www.apple.com/quicktime/" />';break;}document.getElementById(strID).innerHTML=tmpstr;}document.getElementById(strID+"_href").blur();}
function display(ID){if (document.getElementById(ID).style.display == "none") {document.getElementById(ID).style.display = "";}else{document.getElementById(ID).style.display = "none";}}

function toTop(){var sr=document.getElementById("toTop").offsetTop;for (var i=sr; i>1; i-=Math.ceil(i/6)){window.scrollTo(0,i);}window.scroll(0,0);return false;}
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 ContentSize(size){var obj=document.getElementById("size");obj.style.fontSize=size+"px";}
function savecode(obj){var o=window.open('',obj,'');o.document.open("text/html", "replace");o.document.write(obj.value);o.document.execCommand('saveas','','code.htm');o.close();}
function runcode(ID){var code=document.getElementById(ID).value;if (code!=""){var o=window.open('','','');o.opener=null;o.document.write(code);o.document.close();}}
function copycode(ID){if(document.all){textRange=document.getElementById(ID).createTextRange();textRange.execCommand("Copy"); }else{alert("此功能只能在IE上有效");}}

function resizepic(thispic){if(thispic.width>700) thispic.width=700;}

function AddUrl2(){var thisurl='地址名称('+(document.myform.URL.length+1)+')|http://';var url=prompt('请输入地址名称和链接，中间用“|”隔开：',thisurl);if(url!=null&&url!=''){document.myform.URL.options[document.myform.URL.length]=new Option(url,url);}}
function ModifyUrl(){if(document.myform.URL.length==0) return false;var thisurl=document.myform.URL.value; if (thisurl=='') {alert('请先选择一个地址，再点修改按钮！');return false;}var url=prompt('请输入地址名称和链接，中间用“|”隔开：',thisurl);if(url!=thisurl&&url!=null&&url!=''){document.myform.URL.options[document.myform.URL.selectedIndex]=new Option(url,url);}}
function DelUrl(){if(document.myform.URL.length==0) return false;var thisurl=document.myform.URL.value;if (thisurl=='') {alert('请先选择一个地址，再点删除按钮！');return false;}if(document.myform.URL.selectedIndex==0){alert('不能删除第一个地址！');return false;}document.myform.URL.options[document.myform.URL.selectedIndex]=null;}
function AddItem(strFileName){document.myform.IncludePic.checked=true;document.myform.IndexPicUrl.value=strFileName;document.myform.DefaultPicList.options[document.myform.DefaultPicList.length]=new Option(strFileName,strFileName);document.myform.DefaultPicList.selectedIndex+=1;}
function ChkSelected(Obj,ChkObj){if (Obj){for (var i=0;i<Obj.length;i++){Obj.options[i].selected=true;}}}

function AJAX()
{
var $HTTP=false;var $Me=this;
try{$HTTP=new XMLHttpRequest;}
	catch(e){
try{$HTTP=new ActiveXObject("MSXML2.XMLHTTP");}
	catch(e2){
try{$HTTP=new ActiveXObject("Microsoft.XMLHTTP");}
	catch(e3){$HTTP=false;}}}
if (!$HTTP){return false;}

	this.method="POST";
	this.URL;
	this.ASYNC=true;
	this.content="";
	this.callback=function(obj) {return obj;}
	this.send=function()
	{
	if(!this.method||!this.URL||!this.ASYNC){return false;}
	$HTTP.open (this.method,this.URL+"&Time="+new Date().getTime(), this.ASYNC);
	if(this.method=="POST"){$HTTP.setRequestHeader("Content-Type","application/x-www-form-URLencoded");}
	$HTTP.onreadystatechange=function(){$Me.callback($HTTP);}
	if(this.method=="POST"){$HTTP.send(this.content);}else{$HTTP.send(null);}
	}
}

function RequestCheckID()
{
var RegUserID=encodeURI($("RegUserID").value)
if (RegUserID=='')
{
	alert("请您填写用户名！");
	return false;
}else{
var Ajax=new AJAX();
    Ajax.method="GET";
    Ajax.URL="User.asp?To=CheckUserID&UserID="+RegUserID;
    Ajax.callback=function($HTTP)
	{
		if ($HTTP.readyState==4)
		{
			$("span").innerHTML=$HTTP.responseText;
			}else{
			$("span").innerHTML="loading…";
		}
	}
    Ajax.send();
}
}
function AddNews()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="User.asp?To=AddNews";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("UserAdd").innerHTML=$HTTP.responseText;
			}else{
			$("UserAdd").innerHTML="loading…";
		}
	}
	Ajax.send();
}

function AddArticle()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="User.asp?To=AddArticle";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("UserAdd").innerHTML=$HTTP.responseText;
			}else{
			$("UserAdd").innerHTML="loading…";
		}
	}
	Ajax.send();
}

function AddPhoto()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="User.asp?To=AddPhoto";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("UserAdd").innerHTML=$HTTP.responseText;
			}else{
			$("UserAdd").innerHTML="loading…";
		}
	}
	Ajax.send();
}

function AddDj()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="User.asp?To=AddDj";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("UserAdd").innerHTML=$HTTP.responseText;
			}else{
			$("UserAdd").innerHTML="loading…";
		}
	}
	Ajax.send();
}

function AddDownload()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="User.asp?To=AddDownload";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("UserAdd").innerHTML=$HTTP.responseText;
			}else{
			$("UserAdd").innerHTML="loading…";
		}
	}
	Ajax.send();
}

function Login()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="Ajax.asp?To=Login";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("Login").innerHTML=$HTTP.responseText;
			}else{
			$("Login").innerHTML="loading…";
		}
	}
	Ajax.send();
}
function Total()
{
var Ajax=new AJAX();
    Ajax.method="GET";
	Ajax.URL="Ajax.asp?To=Total";
    Ajax.callback=function($HTTP){if ($HTTP.readyState==4){
			$("Total").innerHTML=$HTTP.responseText;
			}else{
			$("Total").innerHTML="loading…";
		}
	}
	Ajax.send();
}