function insertFlash(elm, url, w, h) {
if (!document.getElementById(elm)) return;
var str = '';
str += '<object width="'+ w +'" height="'+ h +'" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0">';
str += '<param name="movie" value="'+ url +'">';
str += '<param name="wmode" value="transparent">';
str += '<param name="quality" value="autohigh">';
str += '<embed width="'+ w +'" height="'+ h +'" src="'+ url +'" quality="autohigh" wmode="opaque" type="application/x-shockwave-flash" plugspace="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash"></embed>';
str += '</object>';
document.getElementById(elm).innerHTML = str;
}
function butong_net(obj,name)
{
var p = obj.parentNode.getElementsByTagName("td");
var p1 = getNames(name,"f","div");
for(i=0;i<p1.length;i++)
{
if(obj==p[i])
{
p[i].className = "s";
p1[i].className = "dis";
}
else
{
p[i].className = "";
p1[i].className = "undis";
}
}
}
function getNames(obj,name,tij)
{	
var p = document.getElementById(obj);
var plist = p.getElementsByTagName(tij);
var rlist = new Array();
for(i=0;i<plist.length;i++)
{
if(plist[i].getAttribute("name") == name)
{
rlist[rlist.length] = plist[i];
}
}
return rlist;
}
function resizepic(o)
{
var maxwidth=760;
var maxheight=800;
var a=new Image();
a.src=o.src
if(a.width > maxwidth)
{
o.style.width=maxwidth;
}
if (a.height> maxheight)
{
o.style.height=maxheight;
}
}
function bbimg(o)
{
var zoom=parseInt(o.style.zoom, 10)||100;
zoom+=event.wheelDelta/12;
if (zoom>0) o.style.zoom=zoom+'%';
return false;
}

var xmlHttp = false;
try {
  xmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
  try {
    xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
  } catch (e2) {
    xmlHttp = false;
  }
}
if (!xmlHttp && typeof XMLHttpRequest != 'undefined') {
  xmlHttp = new XMLHttpRequest();
}
function callServer(showadd,id,canshu) {
		var o = document.getElementById(showadd);
		o.innerHTML="<center><img src=/images/loading.gif></center>";

  if ((id == null) || (id == "")) return;
  var url = "/kuaixun/indexcanshu.asp?id=" + escape(id)+"&canshu="+escape(canshu);
  xmlHttp.open("GET", url, true);
  xmlHttp.onreadystatechange = function(){updatePage(o)};
  xmlHttp.send(null);  
}

function updatePage(o) {
  if (xmlHttp.readyState == 4) {
    var response = xmlHttp.responseText;
	o.innerHTML=response;
  }
}

function showedit(){
	newslistright.style.display = "none";
	zhicibottom.style.display = "none";
	newslistrightedit.style.display = "";
	callServer("newslistrightedit",1,0);
}
function pinglun(){
	newslistright.style.display = "none";
	zhicibottom.style.display = "none";
	newslistrightedit.style.display = "";
	callServer("newslistrightedit",2,0);
	writeFace('ubbf',18)
}
function noedit(){
	newslistright.style.display = "";
	zhicibottom.style.display = "";
	newslistrightedit.style.display = "none";
}

function changeindex(){
	newslistright.style.display = "none";
	zhicibottom.style.display = "none";
	newslistrightedit.style.display = "";
 var x =document.formx.indexzi.value;
	callServer("newslistrightedit",3,x);

}

function sendUbbCode()
{
	if (this && this.id && document && document.getElementById)
	{
		var tarea=document.getElementById('content');
		if (!tarea) tarea=document.getElementById('rcontent');
		if (!tarea) tarea=document.getElementById('econtent');
		if (!tarea) tarea=document.getElementById('abulletin');
		if (tarea)
		{
			if (tarea.selRange && typeof(tarea.selRange.text).toLowerCase()=='string')
				{
					tarea.selRange.text=this.id;
					if (tarea.selRange.scrollIntoView) tarea.selRange.scrollIntoView();
				}
			else
				{if (typeof(tarea.value).toLowerCase()=='string') tarea.value+=this.id;}
				
			if (tarea.focus) tarea.focus();
			if (tarea.form && tarea.form.ubb1 && (typeof(tarea.form.ubb1.checked)).toLowerCase()=='boolean')
			{
				if (!tarea.form.ubb1.checked) tarea.form.ubb1.checked=true;
			}
			else if (tarea.form && tarea.form.ubb2 && (typeof(tarea.form.ubb2.checked)).toLowerCase()=='boolean')
			{
				if (!tarea.form.ubb2.checked) tarea.form.ubb2.checked=true;
			}
				
		}
	}
}
function floatButton()
{
	if (this && this.style && typeof(this.style.borderColor).toLowerCase()=='string' && typeof(this.style.backgroundColor).toLowerCase()=='string')
	{
		this.style.borderColor='#FF0000';
		this.style.backgroundColor='#00FF00';
	}
}
function flatButton()
{
	if (this && this.style && typeof(this.style.borderColor).toLowerCase()=='string' && typeof(this.style.backgroundColor).toLowerCase()=='string')
	{
		this.style.borderColor='#00FF00';
		this.style.backgroundColor='';
	}
}
function biaoqing(){
callServer("ubbtoolbar",4,0)
}

function writeFace(divname,z)
{
	var o = document.getElementById(divname)
o.innerHTML = "<center><img src=/images/loading.gif></center>";

var x = '' ;
   	for(i = 1; i <= z; i++){
        x = x + '<img name="ubbface" id="[face'+i+']" alt="[face'+i+']" src="../images/smallface/'+i+'.gif" class="smallface"  />';
    }

//document.write (x);

o.innerHTML = x
runok();
}
function runok(){
if (document && document.getElementsByName)
{
	var faces=document.getElementsByName('ubbface');
	if (faces && faces.length && faces.length>0)
	{
		for(i=0;i<=faces.length-1;i++)
		{
			faces[i].onmouseover=floatButton;
			faces[i].onmouseout=flatButton;
			faces[i].onclick=sendUbbCode;
		}
	}

}
}

function adlogin(){
 var x =document.form1x.login_name.value;
 var y =document.form1x.password.value;
 var z =document.form1x.yanzheng.value;
callServer('adminlogin',6,x+'#'+y+'#'+z);

}
function FontZoom(size) 
{ 
var obj; 
obj=document.getElementById("neirong"); 
obj.style.fontSize=size; 
//obj.style.color="#ff0000"; 
} 
