function $(id){return document.getElementById(id);}
function AdnComment(id,page){
	var ajax = new AJAXRequest();
	ajax.get(InstallDir+"Include/AdnCms.Comment.asp?id="+id+"&page="+page+"","adncomment");
}
function SubmitComment(id){
	var ajax = new AJAXRequest();
	if($("cm_username").value.length<1||$("cm_content").value.length<1){alert('请检查(访客名称/评论内容)是否填写完整!');return false;}
	ajax.postf(
		$("send_comment"),
		function(obj){if(obj.responseText=="ok"){AdnComment(id,1);}else if(obj.responseText=="wait"){alert('请等1分钟后再次评论');}else{$("cm_username").value="发生未知错误";}}
	);
}
function addFace(id) {
	$('cm_content').value += '[AdnFace:' + id +']';
}
function refreshimg(){
	document.all.checkcode.src='Include/AdnCms.Checkcode.asp?'+Math.random();
}
function AdnGbook(page){
	var ajax = new AJAXRequest();
	ajax.get("Include/AdnCms.Gbook.asp?page="+page+"","list");
}
function SubmitGbook(){
	var ajax = new AJAXRequest();
	if($("gbuser").value.length<1||$("textadd").value.length<1||$("gbcode").value.length<1){alert('请检查(访客名称/留言内容/验证码)是否填写完整!');return false;}
	if(isNaN($("gboicq").value)){alert('请填写数字');return false;}
	ajax.postf(
		$("send_gbook"),
		function(obj){if(obj.responseText=="ok"){AdnGbook(1);}else if(obj.responseText=="err1"){alert('验证码过期失效，请刷新');}else if(obj.responseText=="err2"){alert('您输入的验证码和系统产生的不一致，请重新输入。');}else if(obj.responseText=="wait"){alert('请不要连续提交多次留言');}else{$("cm_username").value="发生未知错误";}}
	);
}
function GbookList(id,page,type){
	var ajax = new AJAXRequest();
	ajax.get("Include/AdnCms.Gbook.asp?action="+type+"&gb_id="+id+"&page="+page+"",function(obj){if(obj.responseText=="ok"){AdnGbook(page);}});
}
function ReGbook(id,page){
	$("top").style.display = 'none';
	$("regb").style.display = 'block';
	$("gb_id").value = id;
	$("gb_page").value = page;
}
function SubmitReGbook(){
	$("top").style.display = 'block';
	$("regb").style.display = 'none';
	var ajax = new AJAXRequest();
	ajax.postf(
		$("send_regbook"),//"list"
		function(obj){if(obj.responseText=="ok"){AdnGbook($("gb_page").value);}else{$("regb").innerHTML="发生未知错误";}}
	);
}
function $AdnPlayer(url,width,height){
	var label = showModelessDialog(url,'window','dialogWidth:'+(width+20)+'px;dialogHeight:'+(height+20)+'px;dialogtop:100px;dialogleft:200px;help:0;scroll:0;status:0;resizable:1;');
	//window.open(url,'WindowPlay','fullscreen=0,toolbar=0,location=0,menubar=0,directories=0,status=0,menubar=0,scrollbars=0,resizable=1,width='+width+',height='+height+',top=200');
	//window.showModelessDialog
}
