// JavaScript Document
//div显示与否的函数
function guanbi(exit){
	 $("#"+exit).fadeOut(2000);
}
function kaiqi(kaiqi){
	$("#"+kaiqi).fadeIn(2000);
}
//按钮不可点
function button(id1,id2,id){
	if(document.getElementById(id1).value==""||document.getElementById(id2).value==""){
		document.getElementById(id).disabled =true;
		document.getElementById(id).style.backgroundPosition = "0px -43px";
	}else{
		document.getElementById(id).disabled =false;
		document.getElementById(id).style.backgroundPosition = "0px 0px";
	}
}
//提交表单
function xianhua(id,xc){
	$.ajax
	(
		{
			type: "post",	//提交方式,推荐使用post 但是post不好测试
			url: "../aige/xianhua.asp",//提交到哪
			data: "id="+id+"&xc="+xc,
			success: function(msg){	//如果通讯成功,会自动调用这个函数
				//按照服务器返回的结果,进行js界面处理
				if(xc==0){
					$("#xianhua").html("+1");
					$("#xianhua").css({"background-color":"FFC"});
				}
				else{
					$("#choudan").html("+1");
					$("#choudan").css({"background-color":"FFC"});
				}
			},
			error:function(msg)	//如果失败了,会自动调用这个方法
			{
				alert(msg);
				alert("失败");
			}
		}
	);
}
//返回头部div的坐标
function fanhui(){
	var winHeight=window.innerHeight,winWidth=window.innerWidth;
	if(document.documentElement.clientHeight){
		winHeight=document.documentElement.clientHeight;
		winWidth=document.documentElement.clientWidth;
	}else{
		winHeight=document.body.clientHeight;
		winWidth=document.body.clientWidth;
	}
	var height=winHeight-150;
	var width=winWidth-100;
	var id = document.getElementById("xiangshang");
	id.style.left = width+"px";
	id.style.top = height+"px";
}
window.onscroll=function(){
	var id = document.getElementById("xiangshang");
	if(document.documentElement.scrollTop){
		id.style.display="block";
	}else if(document.body.scrollTop){
		id.style.display="block";
	}else{
		id.style.display="none";
	}
}
//动态返回顶部
function pageScroll(i) {
	window.scrollBy(0,-30);
	if(i<100){
		i++;
		scrolldelay = setTimeout('pageScroll('+i+')',1);
	}
}
//获取内容填写到文本框
function huifugaineirong(id,id2){
	var p_d = document.getElementById(id);
	var p_d2 = document.getElementById(id2);
	p_d.value = "回复:"+p_d2.innerHTML.toString()+"---";
	p_d.focus();
}
function shangfa(){
	var p_d = document.getElementById("fabu");
	p_d.style.backgroundPosition="70px 0px";
}
function dianfa(){
	var p_d = document.getElementById("fabu");
	p_d.style.backgroundPosition="70px 0px";
	var p_d2 = document.getElementById("neirong");
	p_d2.style.backgroundImage = "url(../image/success.gif)";
	p_d.style.backgroundPosition="140px 0px";
	p_d.disabled = true;
	setTimeout("huifu()",3000);
}
function huifu(){
	var p_d2 = document.getElementById("neirong");
	p_d2.style.backgroundImage = "url()";
	var p_d = document.getElementById("fabu");
	p_d.style.backgroundPosition="70px 0px";
	p_d.disabled = false;
}
function qubeijing(id){
	var p_d = document.getElementById(id);
	p_d.style.backgroundImage = "url()";
}
function huifu(id,url){
	var p_d = document.getElementById(id,url);
	if(p_d.value==""){
		p_d.style.backgroundImage = url;
	}
}