function confirmSubmit(msg, url, urlreturn)
{ 
   if (confirm(msg))
   {
      document.location.href=url+"&urlreturn="+escape(urlreturn);
   }
}

function open_window(myurl,largeur,hauteur) {
	window.open(myurl,"","toolbar=0,location=0,directories=0,menuBar=0,scrollbars=0,resizable=0,width="+largeur+",height="+hauteur+",left=50,top=50");
}


function open_window_with_scrollbar(myurl,largeur,hauteur) {
	window.open(myurl,"","toolbar=0,location=0,scrollbars=1,resizable=1,directories=0,menuBar=0,width="+largeur+",height="+hauteur+",left=50,top=50");
}

$(function() {
      $('.voteSite').hover(
	    		function() {
	    			if ($(this).parent().data("voted")==null) {
	    				var note = $(this).attr("data");
	    				$(this).parent().children().slice(0, note).removeClass("voteDarkStar").addClass("voteStar");
	    			} else {
	    			}
	    		},
	    		function() {
	    			if ($(this).parent().data("voted")==null) {
	    				$(this).parent().children().slice(0, 5).removeClass("voteStar").addClass("voteDarkStar");
	    			} else {
	    				
	    				
	    			}
	    		}
	    );
	    
	    $('.voteSite').click(
	            function() {
			    			var note = $(this).attr("data");
			    			var siteitemid = $(this).parent().attr("data");
			    			$('#NoteForm').hide("blind");
			    			$('#voteimg'+siteitemid).hide("blind");
			    			$('#LinkLoad').show("blind");
			    			
                var DATA = 'note='+note+'&siteitemid=' + siteitemid;
                
                    $.ajax({
			  	              type: "POST",
			  	              url: "vote.php",
			  	              data: DATA,
			  	              cache: false,
			  	              success: function(data){
			  	                if (data=="0")
			  	                    $('#votetks'+siteitemid).text("Vous avez deja vote...");
			  	                $('#votetks'+siteitemid).show("blind");
			  	                $('#LinkLoad').hide();
  			  	            }
                    });
			  	    }
			  );
	    			
	    
	    
	    
	    
	    
	    
	    
	    
	    });

