function loadinit()
{
	load_upload(0);
	load_user(0);
	load_info();
	load_topic(page);
	}
function copyadd(){
	var lohref=location.href ;
	clipboardData.setData('Text', lohref);
	show_info("已复制本群组链接到剪贴板，您可以通过粘贴到<br>QQ、Email等地方推荐给你的朋友 !",'200','100');
	setTimeout("dis_play()",10000);
}
function post(){
	var url="/my/usergroup.asp?action=newpost&sortid="+escape(sortid);
	window.open (url);
	//document.location.href="/my/usergroup.asp?action=newpost&sortid="+escape(sortid);
}
function up_load(s){
	var url="/my/usergroup.asp?action=upload&type="+escape(s)+"&sortid="+escape(sortid);
	window.open (url);
}
function apply(){
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/group.asp?action=apply&sortid="+escape(sortid);
	ajaxobj.callback=function(xmlobj) {
	var response = xmlobj.responseText;
	show_info(response,'200','100');
}
	ajaxobj.send(); 
	setTimeout("dis_play()",10000);
	}
function load_topic(page)
{
document.getElementById("list").innerHTML =template;
var ajaxobj=new AJAXRequest;
ajaxobj.method="POST"; 
ajaxobj.url="/httpreq/group.asp?action=topic&maxpage=25&maxtop=0&Order=0&skin=0&desc=0&page="+escape(page)+"&sortid="+escape(sortid);
//order:order by
ajaxobj.callback=function(xmlobj) {
var response = xmlobj.responseText.split("$$");
if (response[0]!='0'){
document.getElementById("list").innerHTML =response[0];
if (response[2]!=0){
	var pagediv=PageList(page,splitn,response[1],response[2],'load_topic');
	document.getElementById("list_page").innerHTML =pagediv;
	}
}else{document.getElementById("list").innerHTML =response[1];}
}
ajaxobj.send();
}

function load_info(){
	var url="/httpreq/group.asp?action=info&sortid="+escape(sortid);
	Http_req=getXmlhttp();
	Http_req.open("POST", url, true);
	Http_req.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	Http_req.onreadystatechange = updateinfo;
	Http_req.send(null);
	//var ajaxobj=new AJAXRequest;
	//ajaxobj.method="POST"; 
	//ajaxobj.url="/httpreq/group.asp?action=info&sortid="+escape(sortid);
	//ajaxobj.callback=function(xmlobj) {
	//var response = xmlobj.responseText.split("$$");
	
//}
	//ajaxobj.send(); 
}
function updateinfo(){
	if(Http_req.readyState==4) {
				if(Http_req.status==200) {
	var response = Http_req.responseText.split("$$");
	my_getbyid("face").innerHTML ="<img src='/html/"+response[0]+"'>"
	my_getbyid("member").innerHTML =response[1];
	my_getbyid("topic").innerHTML =response[2];
	my_getbyid("album").innerHTML =response[3];
	my_getbyid("source").innerHTML =response[4];
	my_getbyid("wealth").innerHTML =response[5];
	my_getbyid("hits").innerHTML =response[6];
	var apply=response[8].split(",");
	if (apply[13]=='1'){my_getbyid("apply").innerHTML ="<a href='javascript:apply();'>申请</a>";}
	my_getbyid("admin").innerHTML =response[9];
	if (response[10]!='0'){
		my_getbyid("manage").style.display ='';
		}
	
				}
	}
}
function dis_play(){
	setDisplay("load_div",'1');
	}

function join_in(){
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/group.asp?action=join_in&sortid="+escape(sortid);
	ajaxobj.callback=function(xmlobj) {
	var response = xmlobj.responseText;
	show_info(response,'200','100');
}
	ajaxobj.send(); 
	setTimeout("dis_play()",10000);
}

function load_user(s)
{
document.getElementById("list_us").innerHTML =template;
var ajaxobj=new AJAXRequest;
ajaxobj.method="POST"; 
ajaxobj.url="/httpreq/group.asp?action=user&maxpage=25&maxtop=5&Order="+escape(s)+"&desc=0&sortid="+escape(sortid);
//order:order by
ajaxobj.callback=function(xmlobj) {
var response = xmlobj.responseText;
document.getElementById("list_us").innerHTML =response;
}
ajaxobj.send();
}

function load_upload(s)
{var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/group.asp?action=upload&maxpage=25&maxtop=5&Order=0&desc=0&page=1&typeid="+escape(s)+"&sortid="+escape(sortid);
	//Att:0公开,1推荐
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText;
		document.getElementById("up_list").innerHTML =response;
		if (s==1){
			document.getElementById("up_url").innerHTML ="<a href='/other/group/sourc.html?sortid="+escape(sortid)+"' target=_blank>>>更多</a>";
			}
		}
	ajaxobj.send();
	}
	
function slink(s)
{
	var Str;
	Str="<div class='gp_link'><form name='link'>";
	Str+="<ul><li><h1>申请友情链接</h1></li>";
	Str+="<li>链接名称：<input name='linkname' id='linkname' size='30' type='text'></li>";
	Str+="<li>链接地址：<input name='linkurl' id='linkurl' size='30' type='text'></li>";
	Str+="<li><h1><input name='submit' type='button' onclick='link_sub();' value='提交'> <input name='botton' type='button' onclick='slink(1);' value='关闭'></h1></li>";
	Str+="<li id='up_msg'>建立友情链接，提高知名度！</li>";
	Str+="</ul></form></div>";
	if (s==0){
		show_info(Str,'400','200');
		}
	else{
		setDisplay("load_div",'1');
		}
}
function link_sub(){
	var linkname=document.getElementById("linkname").value;
	var linkurl=document.getElementById("linkurl").value;
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/group.asp?action=link_s&linkname="+escape(linkname)+"&linkurl="+escape(linkurl)+"&SortID="+escape(sortid);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText;
		document.getElementById("up_msg").innerHTML =response;
		}
	ajaxobj.send();
	setTimeout("dis_play()",5000);
}

function attorn(s)
{
	var Str;
	Str="<div class='gp_link'><form name='gp_att'>";
	Str+="<ul><li><h1>转让群组</h1></li>";
	Str+="<li>对方　ID：<input name='Userid' id='Userid' size='10' type='text'> 正确用户ID</li>";
	Str+="<li>转让说明：<input name='Title' id='title' size='30' type='text' maxlength='250'>简要说明，长度250字符。</li>";
	Str+="<li><h1><input name='submit' type='button' onclick='att_sub();' value='提交'> <input name='botton' type='button' onclick='attorn(1);' value='关闭'></h1></li>";
	Str+="<li id='up_msg'>群主可以转让群组给其它成员！</li>";
	Str+="</ul></form></div>";
	if (s==0){
		show_info(Str,'400','200');
		}
	else{
		setDisplay("load_div",'1');
		}
}
function att_sub(){
	var Userid=document.getElementById("Userid").value;
	var Title=document.getElementById("Title").value;
	var ajaxobj=new AJAXRequest;
	ajaxobj.method="POST"; 
	ajaxobj.url="/httpreq/group.asp?action=att_s&Userid="+escape(Userid)+"&Title="+escape(Title)+"&SortID="+escape(sortid);
	ajaxobj.callback=function(xmlobj) {
		var response = xmlobj.responseText;
		document.getElementById("up_msg").innerHTML =response;
		}
	ajaxobj.send();
	setTimeout("dis_play()",5000);
}