function submit_vote_song(action, songname) { 
	xmlHttp=GetXmlHttpObject_tracking_referer();
	if (xmlHttp==null) {
		alert ("Browser does not support HTTP Request");
		return;
	} 
	var url="/v2/serverside/vote_song.php";
	url=url+"?a="+action;
	url=url+"&sn="+songname;
	url=url+"&sid="+Math.random();
	xmlHttp.open("GET",url,false);
	xmlHttp.send(null);
	if(xmlHttp.responseText == 'error') {
		alert('ขออภัย ยังไม่มีเพลงให้โหวต');
	} else if(xmlHttp.responseText == 'dup') {
		alert('ขออภัย คุณเคยโหวตให้คะแนนเพลงนี้แล้ว');
	} else {			
		alert('บันทึกคะแนนโหวตเรียบร้อยแล้ว ขอบคุณมากครับ');
		if(action == '1') {
			document.getElementById('vote_good').innerHTML = xmlHttp.responseText;
		} else if(action == '2') {
			document.getElementById('vote_bad').innerHTML = xmlHttp.responseText;
		}
	}

	//xmlHttp.onreadystatechange=stateChanged_songvote(action);
	//xmlHttp.open("GET",url,true);
	//xmlHttp.send(null);
}
function stateChanged_songvote(action) { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		if(xmlHttp.responseText == 'error') {
			alert('ขออภัย ยังไม่มีเพลงให้โหวต');
		} else if(xmlHttp.responseText == 'dup') {
			alert('ขออภัย คุณเคยโหวตให้คะแนนเพลงนี้แล้ว');
		} else {			
			alert('บันทึกคะแนนโหวตเรียบร้อยแล้ว ขอบคุณมากครับ');
			if(action == '1') {
				document.getElementById('vote_good').innerHTML = xmlHttp.responseText;
			} else if(action == '2') {
				document.getElementById('vote_bad').innerHTML = xmlHttp.responseText;
			}
		}
		return true;			
	} 
}
function GetXmlHttpObject_tracking_referer() { 
	var objXMLHttp=null;
	if (window.XMLHttpRequest) {
		objXMLHttp=new XMLHttpRequest();
	} else if (window.ActiveXObject) {
		objXMLHttp=new ActiveXObject("Microsoft.XMLHTTP");
	}
	return objXMLHttp;
}