$(document).ready(function(){
	$("a.contest-vote").click(function(){
		var t3 = $(this).href();
		alter_message("alter","提示信息","请稍后...",300,100);
		$.ajax({
			url: t3,
			type: "POST",
			data: "uid=1",
			success: function(msg) {
				//alert(parseInt(msg));
				if(msg == '1') {
					var num = parseInt($("#total_vote").html());
					//alter_message("alter","提示信息","投票成功",300,100);
					$("#alter_content").html("投票成功");
					$("#total_vote").html(num+1);
				}
				else {
					//alter_message("alter","提示信息",msg,300,100);
					$("#alter_content").html(msg);
					return false;
				}
			}
		});
		return false;
	});
	$("a.contest-vote-login").click(function(){
		var t = this.title || $(this).text() || this.href;
		pwin("pwin", t,this.href,200,370);
		return false;
	});
	$("a.bring-pub").click(function(){
		var t = this.title || $(this).text() || this.href;
		pwin("pwin", t,this.href,200,370);
		return false;
	});
});

function bring_vote(nid,id,width,height) {
	var t3 = '/bring/vote/'+nid;
	alter_message("alter","提示信息","请稍后...",width,height);
	$.ajax({
		url: t3,
		type: "POST",
		data: "uid=1",
		success: function(msg) {
			//alert(parseInt(msg));
			if(msg == '1') {
				var num = parseInt($("#"+id).html());
				//alter_message("alter","提示信息","投票成功",300,100);
				$("#alter_content").html("投票成功");
				$("#"+id).html(num+1);
				setTimeout("contest_summer();",5000);
			}
			else {
				$("#alter_content").html(msg);
				//setTimeout("contest_summer();",12000);
				return false; 
			}
			
		}
	});
	return false;
}

function contest_summer() {
	alter_hide();
}