function getRequestBody(oForm){
var aParams=new Array();
for(var i=0;i<oForm.elements.length;i++){
//for(var i=1;i<oForm.elements.length-1;i++){
var sParam=encodeURIComponent(oForm.elements[i].name);
sParam+="=";
sParam+=encodeURIComponent(oForm.elements[i].value);
aParams.push(sParam);
}
return aParams.join("&");
}


function sendRequest(mb,hf,hf2){
var oForm=document.getElementById("form1");
var sBody=getRequestBody(oForm);

try{var oXmlHttp = new ActiveXObject("Msxml2.XMLHTTP");
}catch(e){try{var oXmlHttp =new ActiveXObject("Microsoft.XMLHTTP");
}catch(e){var oXmlHttp = new XMLHttpRequest();}}

oXmlHttp.open("post",mb);
oXmlHttp.setRequestHeader("REFERER", location.href);
oXmlHttp.setRequestHeader("Content-Type","application/x-www-form-urlencoded");


oXmlHttp.onreadystatechange=function(){
//alert(oXmlHttp.responseText);
if(oXmlHttp.readyState==4 && oXmlHttp.status == 200){
var stt=oXmlHttp.responseText;	
//alert(stt);
var a=stt.indexOf("<head><title>");
stt=stt.substring(0,a);

var all=stt;
var b=stt.indexOf("==");
stt=stt.substring(0,b);

var a1=all.split("==")[1];
//alert("a1="+a1);
var arr=a1.split("|");
//alert(arr);
var a2=all.split("==")[2];
//alert("a2="+a2);

var a3=all.split("==")[3];
var arr3=a3.split("|");

//alert("a3="+a3);
if(stt.indexOf("成功")!=-1){

if(a2=="20"){for(var c=0;c<arr.length;c++){document.getElementById('p1'+arr[c]).src='img/reg1.gif';}}
if(a2=="21"){for(var c=0;c<arr.length;c++){document.getElementById('p1'+arr[c]).src='img/reg2.gif';}}
if(a2=="30"){for(var c=0;c<arr.length;c++){document.getElementById('p2'+arr[c]).src='img/reg1.gif';}}
if(a2=="31"){for(var c=0;c<arr.length;c++){document.getElementById('p2'+arr[c]).src='img/reg2.gif';}}
if(a2=="40"){for(var c=0;c<arr.length;c++){document.getElementById('p3'+arr[c]).src='img/reg1.gif';}}
if(a2=="41"){for(var c=0;c<arr.length;c++){document.getElementById('p3'+arr[c]).src='img/reg2.gif';}}
if(a2=="50"){for(var c=0;c<arr.length;c++){document.getElementById('p4'+arr[c]).src='img/reg1.gif';}}
if(a2=="51"){for(var c=0;c<arr.length;c++){document.getElementById('p4'+arr[c]).src='img/reg2.gif';}}
if(a2=="8"){for(var c=0;c<arr.length;c++){document.getElementById('sj'+arr[c]).innerHTML='<font color=green>上架</font>';}}
if(a2=="9"){for(var c=0;c<arr.length;c++){document.getElementById('sj'+arr[c]).innerHTML='<font color=red>暂不上架</font>';}}
if(a2=="x1"){for(var c=0;c<arr.length;c++){
document.getElementById('jt'+arr[c]).innerHTML='<font color=green>已生成Html</font>'+arr3[c];
}
}
if(a2=="82"){for(var c=0;c<arr.length;c++){document.getElementById('sh'+arr[c]).src='img/reg1.gif';}}
if(a2=="bakmb"){window.location=a3;}
if(a2=="92"){for(var c=0;c<arr.length;c++){document.getElementById('sh'+arr[c]).src='img/reg2.gif';}}
if(a2=="1"||a2=="11"){for(var c=0;c<arr.length;c++){document.getElementById('div'+arr[c]).style.display='none';}}
if(a2=="2"){for(var c=0;c<arr.length;c++){document.getElementById('sh'+arr[c]).src='img/reg1.gif';}}
if(a2=="3"){for(var c=0;c<arr.length;c++){document.getElementById('sh'+arr[c]).src='img/reg2.gif';}}
if(a2=="6"){for(var c=0;c<arr.length;c++){document.getElementById('qx'+arr[c]).innerHTML='<font color=red>禁止登陆用户</font>';
document.getElementById('k1qx'+arr[c]).style.display='';document.getElementById('k2qx'+arr[c]).style.display='none';}}
if(a2=="7"){for(var c=0;c<arr.length;c++){document.getElementById('qx'+arr[c]).innerHTML='<font color=green>普通用户</font>';
document.getElementById('k1qx'+arr[c]).style.display='none';document.getElementById('k2qx'+arr[c]).style.display='';}}

if(a2=="yh01"){
//alert(a3);
if(a3=="1"){
for(var c=0;c<arr.length;c++){document.getElementById('hmd'+arr[c]).innerHTML='<font color=red>系统黑名单</font>';
document.getElementById('m1qx'+arr[c]).style.display='';document.getElementById('m2qx'+arr[c]).style.display='none';}
}else
{
for(var c=0;c<arr.length;c++){document.getElementById('hmd'+arr[c]).innerHTML='';
document.getElementById('m1qx'+arr[c]).style.display='none';document.getElementById('m2qx'+arr[c]).style.display='';}
}
}


alert(stt);
if(hf){location=hf;}
if(hf2){parent.document.list.location=hf2;}
}
else if(stt!=""){
if(a2=="tp01"){
document.getElementById('zt'+a3).innerHTML='<font color=red>已屏蔽此图</font>';
document.getElementById('tpp'+a3).style.display='none';
document.getElementById('xpp'+a3).style.display='';
}
else if(a2=="tp02"){
document.getElementById('zt'+a3).innerHTML='状态正常';
document.getElementById('tpp'+a3).style.display='';
document.getElementById('xpp'+a3).style.display='none';
}
else if(a2=="tp03"){
document.getElementById('spp'+a3).style.display='none';
}
else{
alert(stt);
}
}
else{
if(a2=="px1"||a2=="px2"||a2=="101"){
window.location.reload();
//window.history.go(0);
}
else{alert("操作失败，请重试");}
}
}

}
oXmlHttp.send(sBody);

}
