var index_Req=false;
var $ = function(i){ return document.getElementById(i); }
var PATH=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/"));
if(PATH.indexOf(".")==-1)
{
	PATH="";
}
function createindex_Request(){
	if(window.index_Request){ //Mozilla 
		index_Req=new index_Request();
	} else if(window.ActiveXObject){
		try{
			index_Req=new ActiveXObject("Msxml2.XMLHTTP");
		}catch(e){
			try{
				index_Req=new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){}
		}
	}
}
var isjump="1";
function sendballot(pid,type,jump)
{
	isjump=jump;
	$(pid+type).innerText=parseInt($(pid+type).innerText)+1;
	createindex_Request();
	index_Req.onreadystatechange = sendballot_return;
	var sql = PATH+"/info.do?logic=sendballot&pid="+pid+"&type="+type+"&s="+Math.random();
	index_Req.open('GET',sql,false);
	index_Req.send(null);
}
function sendballot_return()
{
	if(index_Req.readyState == 4)
	{
		if(index_Req.status == 200)
		{
			if(isjump=="1")
			{
				window.open(PATH+"/star/star.do?logic=starpk");
			}
			else
			{
				alert("Í¶Æ±³É¹¦");
				window.location.reload();
			}
		}
	}
}