function skins(s){
	var Str=null;
	Str=Str+"<option value=1 selected='selected'>默认模板</option>";
	document.write (Str);
	}
// 修改编辑栏高度
function admin_Size(num,objname)
{
	var obj=document.getElementById(objname)
	if (parseInt(obj.rows)+num>=3) {
		obj.rows = parseInt(obj.rows) + num;	
	}
	if (num>0)
	{
		obj.width="90%";
	}
}

function help(n,top){
	show_info(n.value,'400',top);
	setTimeout("dis_play()",10000);
}
function dis_play(){
	setDisplay("load_div",'1');
	}

var ColorImg;
var ColorValue;
function hideColourPallete() {
	document.getElementById("colourPalette").style.visibility="hidden";
}
function Getcolor(img_val,input_val){
	var obj = document.getElementById("colourPalette");
	ColorImg = img_val;
	ColorValue = document.getElementById(input_val);
	if (obj){
	obj.style.left = getOffsetLeft(ColorImg) + "px";
	obj.style.top = (getOffsetTop(ColorImg) + ColorImg.offsetHeight) + "px";
	if (obj.style.visibility=="hidden")
	{
	obj.style.visibility="visible";
	}else {
	obj.style.visibility="hidden";
	}
	}
}
//Colour pallete top offset
function getOffsetTop(elm) {
	var mOffsetTop = elm.offsetTop;
	var mOffsetParent = elm.offsetParent;
	while(mOffsetParent){
		mOffsetTop += mOffsetParent.offsetTop;
		mOffsetParent = mOffsetParent.offsetParent;
	}
	return mOffsetTop;
}

//Colour pallete left offset
function getOffsetLeft(elm) {
	var mOffsetLeft = elm.offsetLeft;
	var mOffsetParent = elm.offsetParent;
	while(mOffsetParent) {
		mOffsetLeft += mOffsetParent.offsetLeft;
		mOffsetParent = mOffsetParent.offsetParent;
	}
	return mOffsetLeft;
}
function setColor(color)
{
	if (ColorValue){ColorValue.value = color;}
	if (ColorImg){ColorImg.style.backgroundColor = color;}
	document.getElementById("colourPalette").style.visibility="hidden";
}

//SELECT表单选取
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 chkradio(Obj,Val)
{
	if (Obj)
	{
	for (i=0;i<Obj.length;i++){
		if (Obj[i].value==Val){
		Obj[i].checked=true;
		break;
		}
	}
	}
}
//用户组批量更新按钮 <input type="button" value="选择用户组" onclick="getGroup('Select_Group');">
//记录 更新ID的表单 <input name="groupid" type="hidden" value="<%=Request("groupid")%>">
function getGroup(Did)
{
var SGroup = my_getbyid(Did);
	if (SGroup){
		if (SGroup.style.display=='none'){
		SGroup.style.top = (document.body.scrollTop+((document.body.clientHeight-300)/2))+"px";
		SGroup.style.left = (document.body.scrollLeft+((document.body.clientWidth-480)/2))+"px";
		SGroup.style.display = '';
		}
		else{
			var SelGroupid = my_getbyid("SelGroupid");
			var groupid = my_getbyid("groupid");
			var Val="";
			SGroup.style.display='none';
			if (SelGroupid){
				for (var i=0;i<SelGroupid.length;i++){
					if (SelGroupid.options[i].selected){
						Val += SelGroupid.options[i].value;
						Val += ",";
					}
				}
				groupid.value = Val.substr(0,Val.lastIndexOf(","));
			}
		}
	}
}

//复选表单全选事件 form：表单名
function CheckAll(form)  {
	for (var i=0;i<form.elements.length;i++)
	{
		var e = form.elements[i];
		if (e.name != 'chkall'&&e.type=="checkbox")
		{
			e.checked = form.chkall.checked;
		}
	}
}
function sysgroupname(value){
	var ArrStr=new Array("编辑默认组>>","系统用户组 >> ","特殊用户组 >> ","注册用户组(等级) >> "," >> ","VIP用户组 >> ");
	document.write(ArrStr[value]);
}
function selLoveStas(value)
{
	var Str='';
	var ArrStr = new Array("任意","正在进行中","正在约会中","找到意中人","我们结婚了");
	for (var i=0; i<=4;i++){
		if (value==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
}
function seluserFind(value)
{
	var Str='';
	var ArrStr = new Array("任意","约会交友","婚姻恋爱","亲密关系","同性之间");
	for (var i=0; i<=4;i++){
		if (value==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
}
function uaction(value,s){
	var urlStr;
	if (s==1){urlStr="user.asp?action=setfix&Userid="+escape(value);}
	if (s==2){urlStr="lockip.asp?action=lockip&ip="+value;}
	if (s==3){urlStr="user.asp?action=overvip&userid="+escape(value);}
	if (s==4){urlStr="user.asp?action=overtop&userid="+escape(value);}
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url=urlStr;
	ajaxobj.callback=function(xmlobj) {
	var response = xmlobj.responseText.split("$$");
	show_info(response[1],'200','250');
	}
	ajaxobj.send(); 
	setTimeout("dis_play()",8000);
}
function dis_play(){
	setDisplay("load_div",'1');
	}
function cl(s){
	my_getbyid("show"+s).style.display='none';
	my_getbyid("u"+s).innerHTML='<a href="javascript:op('+s+')">展开</a>';
}
function op(s){
	my_getbyid("show"+s).style.display='';
	my_getbyid("u"+s).innerHTML='<a href="javascript:cl('+s+')">收起</a>';
}
function op_order(s){
	if (s!='0'){
	my_getbyid("show").style.display='';
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="order.asp?action=getorder&ID="+escape(s);
	ajaxobj.callback=function(xmlobj) {
	var response = xmlobj.responseText.split("|||");
	my_getbyid("user").innerHTML=response[2];
	my_getbyid("mobile").innerHTML=response[3];
	if (response[4]==0){my_getbyid("type").innerHTML="点券商品";}else if(response[4]==1){my_getbyid("type").innerHTML="VIP商品";}
	else{my_getbyid("type").innerHTML="首页推荐";}
	my_getbyid("title").innerHTML=response[5];
	my_getbyid("money").innerHTML=response[6];
	my_getbyid("scalar").innerHTML=response[7];
	my_getbyid("sttime").innerHTML=response[8];
	my_getbyid("code").innerHTML=response[9];
	if (response[10]==0){
	my_getbyid("ispay").innerHTML="未支付";
	}else{my_getbyid("ispay").innerHTML="支付成功";}
	my_getbyid("email").innerHTML=response[12];
	my_getbyid("gross").innerHTML=response[13];
	if (response[14]==0){
	my_getbyid("flag").innerHTML="未操作";
	}else{my_getbyid("flag").innerHTML="已操作";}
	my_getbyid("adtime").innerHTML=response[15];
	my_getbyid("patime").innerHTML=response[16];
	my_getbyid("cont").innerHTML=response[11];
	}
	ajaxobj.send(); 
	}else{my_getbyid("show").style.display='none';}
}
function vipType(value,s){
	var Str='';
	var ArrStr = new Array("","1个月","2个月","3个月","4个月","5个月","6个月","7个月","8个月");
if (s==0){
	for (var i=1; i<=8;i++){
		if (value==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
}else{document.write(ArrStr[value]);}
}
function order_ty(s){
	if (s==0){
		document.write("<font color=blue>点券商品</font>");
		}
	else if(s==1){
		document.write("<font color=red>VIP商品</font>");}
	else{document.write("<font color=green>首页推荐</font>");}
}
function order_stas(s){
	if (s=='0'){
		document.write("<font color=blue>未支付</a>");
		}
	else{
		document.write("<font color=red>支付成功</a>");
		}
}
function op_iden(s){
	if (s!=0){
		my_getbyid("show").style.display='';
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="identity.asp?action=getview&ID="+escape(s);
	ajaxobj.callback=function(xmlobj) {
	var response = xmlobj.responseText.split("|||");
		my_getbyid("Img").innerHTML="<img src='/html/"+response[1]+"'>";
		my_getbyid("cont").innerHTML=response[2];
		}
	ajaxobj.send(); 
	}else{my_getbyid("show").style.display='none';}
}
function skinlang(value,s){
	var Str='';
	var ArrStr = new Array("","简体中文","繁体中文","日文","英文");
if (s==0){
	for (var i=1; i<=4;i++){
		if (value==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
}else{document.write(ArrStr[value]);}
}
function skintype(value,s){
	var Str='';
	var ArrStr = new Array("","个人主页","日记本","日记页","相册模板","","聚会模板","群组模板");
if (s==0){
	for (var i=1; i<=7;i++){
		if (value==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
}else{document.write(ArrStr[value]);}
}
function albumpic(s){
	if (s!=0){
		my_getbyid("show").style.display='';
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="album.asp?action=getview&ID="+escape(s);
	ajaxobj.callback=function(xmlobj) {
	var response = xmlobj.responseText.split("|||");
		my_getbyid("Img").innerHTML="<img src='/html/"+response[1]+"'>";
		my_getbyid("cont").innerHTML=response[2];
		}
	ajaxobj.send(); 
	}else{my_getbyid("show").style.display='none';}
}
function add_gptype(s,t){
	var Str;
	if (s!='-1'){
		if(t=='0'){
	Str="<FORM><input name='ParentID' id='ParentID' type='hidden' value="+s+"><input name='ID' id='ID' type='hidden' value=0>类别名称：<input name='SortName'  id='SortName' type='text' size=30> ";
	Str=Str+"<input name='submit' type='button' value='提交' onclick='add_type();'> <input name='abc' type='button' value='关闭' onclick='add_gptype(-1,0);' /> </form>";
	show_info(Str,'200','250');
		}else{
			var ajaxobj=new AJAXRequest;
			ajaxobj.method="POST"; 
			ajaxobj.url="cohort.asp?action=getsort&ID="+escape(t);
			ajaxobj.callback=function(xmlobj) {
				var response = xmlobj.responseText.split("$$");
				Str="<FORM><input name='ParentID' id='ParentID' type='hidden' value="+s+"><input name='ID' id='ID' type='hidden' value="+t+">类别名称：<input name='SortName' id='SortName' type='text' size=30 value="+response[1]+"> ";
				Str=Str+"<input name='submit' type='button' value='修改' onclick='add_type();'> <input name='abc' type='button' value='关闭' onclick='add_gptype(-1,0);' /> </form>";
				show_info(Str,'200','250');
			}
			ajaxobj.send(); 
		}
	}else{dis_play();}
	}
function add_type(){
	var ParentID=my_getbyid("ParentID").value;
	var ID=my_getbyid("ID").value;
	var SortName=my_getbyid("SortName").value;
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="cohort.asp?action=type_save&ID="+escape(ID)+"&ParentID="+escape(ParentID)+"&SortName="+escape(SortName);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		show_info(response[1],'200','250');
		
	}
			ajaxobj.send(); 
			setTimeout("dis_play()",3000);
			setTimeout("location.reload();",3000);
}
function del_type(s){
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="cohort.asp?action=del_type&ID="+escape(s);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		show_info(response[1],'200','250');
		
	}
			ajaxobj.send(); 
			setTimeout("location.reload();",3000);
	}
	

function add_adtype(s,t){
	var Str;
	if (s!='-1'){
		if(t=='0'){
	Str="<FORM><input name='ParentID' id='ParentID' type='hidden' value="+s+"><input name='ID' id='ID' type='hidden' value=0>类别名称：<input name='SortName'  id='SortName' type='text' size=30> ";
	Str=Str+"<input name='submit' type='button' value='提交' onclick='add_potype();'> <input name='abc' type='button' value='关闭' onclick='add_adtype(-1,0);' /> </form>";
	show_info(Str,'200','50');
		}else{
			var ajaxobj=new AJAXRequest;
			ajaxobj.method="POST"; 
			ajaxobj.url="address.asp?action=getsort&ID="+escape(t);
			ajaxobj.callback=function(xmlobj) {
				var response = xmlobj.responseText.split("$$");
				Str="<FORM><input name='ParentID' id='ParentID' type='hidden' value="+s+"><input name='ID' id='ID' type='hidden' value="+t+">类别名称：<input name='SortName' id='SortName' type='text' size=30 value="+response[1]+"> ";
				Str=Str+"<input name='submit' type='button' value='修改' onclick='add_potype();'> <input name='abc' type='button' value='关闭' onclick='add_adtype(-1,0);' /> </form>";
				show_info(Str,'200','50');
			}
			ajaxobj.send(); 
		}
	}else{dis_play();}
	}
function add_potype(){
	var ParentID=my_getbyid("ParentID").value;
	var ID=my_getbyid("ID").value;
	var SortName=my_getbyid("SortName").value;
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="address.asp?action=type_save&ID="+escape(ID)+"&ParentID="+escape(ParentID)+"&SortName="+escape(SortName);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		show_info(response[1],'200','50');
		
	}
			ajaxobj.send(); 
			setTimeout("dis_play()",6000);
			setTimeout("location.reload()",8000);
}
function del_adtype(s){
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="address.asp?action=del_type&ID="+escape(s);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		show_info(response[1],'200','50');
		
	}
			ajaxobj.send(); 
			location.reload();
	}
function showfile(s){
	if (s!='0'){
	 if (s.indexOf(".jpg")!=-1 || s.indexOf(".gif")!=-1 || s.indexOf(".bmp")!=-1){
	show_info("<img src=/html/"+s+"></br><input name='abc' type='button' value='关闭' onclick='showfile(0);' />",'100','50');}
	else{alert("非图片格式文件（jpg/gif/bmp）");}
	}else{dis_play();}
}
function helpType(s,t){
	var Str='';
	var ArrStr=new Array("无归纳类别","个人资料完善与管理","沟通与交流","注册与登录","诚信会员与认证","搜索与排行","参加交友活动","成功故事","VIP高级会员","首页推荐");
	if (t!=1){
	for (var i=0; i<=9;i++){
		if (s==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
	}else{document.write(ArrStr[s]);}
}
function getComtype(s){
	var ArrStr=new Array("与实际情况不符","用户信息不实","页面存在广告行为","页面存在恶意/病毒代码","页面有色情/黄色信息","其它问题");
	document.write(ArrStr[s]);
}
function show_com(value){
	if (value!=0){
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="complain.asp?action=showcom&ID="+escape(value);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText.split("$$");
		my_getbyid("show").style.display='';
		my_getbyid("title").innerHTML="标题："+response[1];
		my_getbyid("cont").innerHTML="内容："+response[2];
		my_getbyid("page").innerHTML="网址："+response[3];
	}
	}else{my_getbyid("show").style.display='none';}
ajaxobj.send(); 
}
function getselStep(s){
	var Str='';
	var ArrStr=new Array("用户提取","管理员结算","发往银行处理","银行到用户","处理完成");
	for (var i=0; i<=4;i++){
		if (s==i){Str+="<option value="+i+" selected>"+ArrStr[i]+"</option>"}
		else{Str+="<option value="+i+">"+ArrStr[i]+"</option>"}
	}
	document.write(Str);
}
function GetResult(pid,selectid,selected)
{
var ajaxobj=new AJAXRequest;
ajaxobj.method="POST"; 
ajaxobj.url="/reg.asp?action=getpost&pid="+pid+"&elementID="+selectid;
ajaxobj.callback=function(xmlobj) {
var returntxt=unescape(xmlobj.responseText);
var elementID=returntxt.split("$$")[1];
var gettxt=returntxt.split("$$")[0];
BuildSel(gettxt,document.getElementById(elementID),selected);
}
ajaxobj.send();
}
function BuildSel(str,sel,seled)
{
//先清空原来的数据.
sel.options.length=0;
var arrstr = new Array();
arrstr = str.split(",");
sel.options.add(new Option( "-----请选择-----","")); 
if(str.length>0) 
{
for(var i=0;i<arrstr.length;i++)
{
//分割字符串
var subarrstr=new Array;
var myEle = document.createElement("OPTION") ;
subarrstr=arrstr[i].split("|");
//生成下级菜单
myEle.value = subarrstr[0];
myEle.text = subarrstr[1];
sel.options.add(myEle); 
}
sel.options[seled].selected=true;
}
}