var subjectid = 0 ;
function doUsefulVotes(sid) {
	subjectid = sid ;
	document.getElementById("iframe_proxy").src = "http://comment.xunlei.com/proxy.html?"+(Math.floor(Math.random()*99999)+1) ;
}
function xlAjax(url, pars, successFun) {
	var doc = document.getElementById('iframe_proxy').contentWindow;
	return doc.pxlAjax(url,pars,successFun);
}
function showUsefulVotes(response) {
	var ReturnStr = response.responseText ;
	var tmp = ReturnStr.split("_") ;
	var nums = tmp[1] ;
	var sid = tmp[0] ;
	if (nums > 0 ) {
		document.getElementById("movie_subject_"+sid).innerHTML = nums ;
	}
	else if (nums == '-1') {
		alert("不存在短评主题!");
	}
	else if (nums == '-2') {
		alert("您已经对该短评投票过了!");
	}
	else {
		alert("投票出错!") ;
	}
}
function __init__(sid) {
	if (sid) {
		var ajax = xlAjax("http://comment.xunlei.com/do_usefulvotes.php?sid="+sid+"&rnd="+(Math.floor(Math.random()*99999)+1),"",showUsefulVotes);
		ajax.get();
	}
	
}