jQuery(document).ready(function($) {
	
	jQuery.fn.addImageVoteWrap = function(votes, voted) {
		$(this).each(function() {
				if(!$(this).hasClass('vote-image-false')) {
				  var html = "";
				  html += "<div class='image-vote' id='"+$(this).attr('src')+"' style='width:"+$(this).width()+"px'>";
				  html += "<p class='vote-total'><span class='vote-count'>"+votes+"</span>";
				  if(votes == 1) { html += "vote"; }else { html += "votes"; }
				  html += "</p>";
				  if(voted) {
					  html += "<p class='vote-confirm'>voted as favorite</p>";
				  }else {
					  html += "<p class='vote-button'><a href='#' class='image-vote-button'>vote as favorite</a></p>";
				  }
				  html += "</div>";
				  //add image vote
				  $(this).after(html);
				}
		});
	}
				
});