function getShoutcast() {
	sendHTTPrequest("request_name=shoutcast&", "shoutcastRes", "POST");
}
function shoutcastRes() {
	if(http.responseText != "") {
		document.getElementById("shoutcast_value").innerHTML = http.responseText;
	}
	//alert("reloaded");
	setTimeout("getShoutcast()",120000);
}
function ajax_vote(id,type){
	var idata = {'voteit': id};
	var tab = (type==0)?'voteTable':'suggestTable';
	$.ajax({url:  window.location.protocol +'//'+ window.location.host +"/ajax/charts_ajax.php",
		type: 'post',
		dataType: 'jsonp',
		data: idata,
		async: true,
		success: function(data) {
			if(data.button ===0){
				alert('Vielen Dank für Deine Stimme!');
				$('#'+tab).find('input').each(function(){
					$(this).attr('disabled', 'disabled');
				});
			}else{
				$('#'+tab).find('input').each(function(){
					$(this).attr('disabled', 'disabled');
				});
				alert('Du hast schon gevotet, bitte etwas Geduld!');
			}
		}
	});
}
function ajax_suggest(){
	var inter = $('#interpret').val();
	var titel = $('#titel').val();
	var idata = {'vorschlag': 1, 'interpret':inter, 'titel': titel};
	$.ajax({url:  window.location.protocol +'//'+ window.location.host +"/ajax/charts_ajax.php",
		type: 'post',
		dataType: 'jsonp',
		data: idata,
		async: true,
		success: function(data) {
			if(data.status === 0){
				alert('Vielen Dank für Deinen Vorschlag!');
				$('#interpret').val('Interpret');
				var titel = $('#titel').val('Titel');
			}else{
				alert('Bitte trage Deinen Vorschlag ein!');
			}
		}
	});
}