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("aspnetForm");
var sBody=getRequestBody(oForm);
//alert(sBody);

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;	
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);
var arr=a1.split("|");

var a2=all.split("==")[2];
var a3=all.split("==")[3];
var arr3=a3.split("|");
//alert("a2="+a2);
//alert("a3="+a3);
//alert("arr[0]="+arr[0]);
//alert("arr[1]="+arr[1]);

if(stt.indexOf("成功")!=-1){
if(a2=="61"||a2=="62"||a2=="63"||a2=="64"){
document.getElementById('spzw').innerHTML=stt;
}else{
xs(stt);
}
if(a2=="90"){for(var c=0;c<arr.length;c++){document.getElementById('wl'+arr[c]).innerHTML='<font color=green>已收货</font>';document.getElementById('qd'+arr[c]).style.display='none';}}
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=="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=="82"){for(var c=0;c<arr.length;c++){document.getElementById('sh'+arr[c]).src='img/reg1.gif';}}
if(a2=="92"){for(var c=0;c<arr.length;c++){document.getElementById('sh'+arr[c]).src='img/reg2.gif';}}
if(a2=="1"){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-1;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=="53"){
for(var c=0;c<arr.length;c++){document.getElementById('h'+arr[c]).style.display='none';}
document.getElementById('xh').innerHTML=parseInt(document.getElementById('xh').innerHTML)-1;
if(document.getElementById('xh').innerHTML=="0"){document.getElementById('gwczw').style.display='';}
document.getElementById('zlzj').innerHTML=arr3[0];document.getElementById('spzj').innerHTML=arr3[1];document.getElementById('spzj2').innerHTML=arr3[1];
}
if(a2=="56"){document.getElementById('ctl00_ContentPlaceHolder1_ddan').style.display='none';document.getElementById('gwczw').style.display='';
document.getElementById('zlzj').innerHTML='0.00';document.getElementById('spzj').innerHTML='0.00';document.getElementById('spzj2').innerHTML='0.00';document.getElementById('xh').innerHTML='0';
document.getElementById('qjs').style.display='none';
}
if(a2=="52"){document.getElementById('xh').innerHTML=parseInt(document.getElementById('xh').innerHTML)+1;
document.getElementById('spzj').innerHTML=arr3[1];
}
if(a2=="57"){document.getElementById('ctl00_ContentPlaceHolder1_llll_zjln').style.display='none';}
if(a2=="58"){window.location=a3;}
if(a2=="59"){document.getElementById('zc1').style.display="none";document.getElementById('zc2').style.display="";}

if(a2=="44"){document.getElementById('rz'+arr[0]).style.display="none";}

//if(a2=="202"){window.location="mzf.aspx";}

if(hf){location=hf;}
if(hf2){parent.document.list.location=hf2;}
}
else if(stt!=""){
if(a2=="61"||a2=="62"||a2=="63"||a2=="64"){
document.getElementById('spzw').innerHTML=stt;
}
else if(a2=="121"){
//xs(stt);
document.getElementById('nr0').innerHTML=stt;
document.getElementById('sp_nr0').value=stt;
//var n=document.getElementById('ggjg').innerHTML;
//n=n.replace(/<.*?>/g,"");
//document.getElementById('nrrr').value=n;
}
else{
xs(stt);
}
}
else{
//------------------------
if(a2=="54"){for(var c=0;c<arr.length;c++){document.getElementById('sl'+arr[c]).innerHTML=document.getElementById('sl'+arr[c]).innerHTML-1;document.getElementById('xj'+arr[c]).innerHTML=arr3[2];}
document.getElementById('zlzj').innerHTML=arr3[0];document.getElementById('spzj').innerHTML=arr3[1];document.getElementById('spzj2').innerHTML=arr3[1];
}
else if(a2=="55"){
for(var c=0;c<arr.length;c++){document.getElementById('sl'+arr[c]).innerHTML=parseInt(document.getElementById('sl'+arr[c]).innerHTML)+1;document.getElementById('xj'+arr[c]).innerHTML=arr3[2];}
document.getElementById('zlzj').innerHTML=arr3[0];document.getElementById('spzj').innerHTML=arr3[1];document.getElementById('spzj2').innerHTML=arr3[1];
}
else{
//xs("操作失败，请重试");
}
//------------------------
}
}

}
oXmlHttp.send(sBody);

}

