
var div;
function onlinevot() {
	var url = "process.do?method=getVoteTitle"; 
	div = document.getElementById("onlinevoting");  
	//ajaxRequest(url, document.getElementById("onlinevoting"));
	ajaxRequest(url, show1);
}
function show1() {
	if (xmlHttp.readyState == 4 || xmlHttp.readyState == "complete") {
		if (xmlHttp.responseText != null) {
			div.innerHTML = xmlHttp.responseText;
		}
	}
}
function votingcontent(refid,type) {
	var url = "process.do?method=getVoteItem&refid=" + refid + "&type="+type;
	//ajaxRequest(url, document.getElementById("votingcontent"));
	div = document.getElementById("votingcontent");
	ajaxRequest(url, show1);
}
function votingcontent_gqtp(refid) {
	var url = "process.do?method=getVoteItem&refid=" + refid + "&type=gqtp";
	div = document.getElementById("votingcontent");
	ajaxRequest(url, show1);
}
function votenddate(enddate) {
	var url = "process.do?method=getVoteTitle&enddate=" + enddate + "";
	div = document.getElementById("onlinevoting");
	ajaxRequest(url, show1);
}
function submitvote(refid) { 
	var onlinedate = document.getElementById("onlinedate"+refid);  
	if (onlinedate.value == "") {
		onlinedate.value = refid;
	} else {
		alert("您已经投过票了!");
		return false;
	}
	 
	var myElement;
	var numberOfControls = document.formvote.length;
	var compspec = [];
	for (var i = 0; i < numberOfControls; i++) {
		myElement = document.formvote[i];
		if (myElement.checked == true) {
			compspec = compspec.concat(myElement.value);
		}
	}
	if(compspec==""){
		alert("请选择投票内容");
	}
	var url = "process.do?method=saveVoteItem&refid=" + refid + "&compspec=" + compspec + "";
	div = document.getElementById("votingcontent");
	ajaxRequest(url, show1);
}
function votepie(refid, tptype) {
	var url = "process.do?method=getVoteItem_pie&refid=" + refid + "&tptype=" + tptype + "";
	div = document.getElementById("votepie");
	ajaxRequest(url, show1);
}
function votepie_colse(refid, tptype) {
	var url = "process.do?method=getVoteItem_pie_colse&refid=" + refid + "&tptype=" + tptype + "";
	div = document.getElementById("votepie");
	ajaxRequest(url, show1);
}
var intTimeStep = 20;
var isIe = (window.ActiveXObject) ? true : false;
var intAlphaStep = (isIe) ? 5 : 0.05;
var curSObj = null;
var curOpacity = null;
var stopTime = 0;
function startObjMessage(objId) {
	curSObj = document.getElementById(objId);
	if (isIe) {
		curSObj.style.cssText = "DISPLAY: none; Z-INDEX: 1; FILTER: alpha(opacity=0); POSITION: absolute; left: 550px; top: 500px;";
	}
	setMessage();
}
function setMessage() {
	if (isIe) {
		curSObj.filters.alpha.opacity = 0;
	} else {
		curOpacity = 0;
		curSObj.style.opacity = 0;
	}
	curSObj.style.display = "";
	setMessageShow();
}
function setMessageShow() {
	if (isIe) {
		curSObj.filters.alpha.opacity += intAlphaStep;
		if (curSObj.filters.alpha.opacity < 100) {
			setTimeout("setMessageShow()", intTimeStep);
		} else {
			stopTime += 10;
			if (stopTime < 500) {
				setTimeout("setMessageShow()", intTimeStep);
			} else {
				stopTime = 0;
				setMessageClose();
			}
		}
	} else {
		curOpacity += intAlphaStep;
		curSObj.style.opacity = curOpacity;
		if (curOpacity < 1) {
			setTimeout("setMessageShow()", intTimeStep);
		} else {
			stopTime += 10;
			if (stopTime < 200) {
				setTimeout("setMessageShow()", intTimeStep);
			} else {
				stopTime = 0;
				setMessageClose();
			}
		}
	}
}
function setMessageClose() {
	if (isIe) {
		curSObj.filters.alpha.opacity -= intAlphaStep;
		if (curSObj.filters.alpha.opacity > 0) {
			setTimeout("setMessageClose()", intTimeStep);
		} else {
			curSObj.style.display = "none";
		}
	} else {
		curOpacity -= intAlphaStep;
		if (curOpacity > 0) {
			curSObj.style.opacity = curOpacity;
			setTimeout("setMessageClose()", intTimeStep);
		} else {
			curSObj.style.display = "none";
		}
	}
}

