
function vote(){
	reset_tooltip()
var qdata =getCookie('jbaron');
if(qdata == 1){
	
	//alert("Έχετε ήδη ψηφίσει");
	document.form1.rate.value=1;
		document.getElementById('data').innerHTML ="<font style='color:#ff0000;'>Έχετε ήδη ψηφίσει.</font><br /><br />Πατήστε <a href='javascript:showresults();' onmouseover='show_tooltip(20);' onmouseout='reset_tooltip();'>εδώ</a> για να δείτε τα αποτελέσματα μέχρι στιγμής <br /><br />Σας ευχαριστώ.";
	
}else{
	
VoteFunction(0);	
setCookie('jbaron', 1,1);
	//alert("ok");
}
	
	
}
	
function showresults(){
	reset_tooltip()
			VoteFunction(1);
}


	
function VoteFunction(hvalue){
	var hvalue;
	var ajaxans = checkajaxbrowsersupport();
		
if(ajaxans == true){
	if(hvalue==0){
		for (var i=0; i < document.form1.rate.length; i++)
   			{
   				if (document.form1.rate[i].checked)
      				var voteval = document.form1.rate[i].value;
      			
  			 }
  			}
	else if(hvalue==1){
 		var voteval = "good";
    					  		}
 	
 	
   
ajaxRequest.open("POST", "vote.php",true);
ajaxRequest.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
ajaxRequest.send("vote="+voteval+"&hval="+hvalue);

	ajaxRequest.onreadystatechange = function(){
		if(ajaxRequest.readyState == 4){
			document.getElementById('data').innerHTML = ajaxRequest.responseText;
		
		}
		
	}

}
else{

return;	
	
}

}

