function imagevote( id )
{
  jQuery('#votediv'+id)
    .width(jQuery('#votediv'+id).width())
    .height(jQuery('#votediv'+id).height());
  jQuery('#votebtn'+id).fadeOut(250);
  jQuery.getJSON( imagevote_url + '?imagevote_id=' + id,
    function( data )
    {
      jQuery('#votecount'+id).html(data.votes);
    }
  );
}

jQuery(document).ready( function(){
  jQuery("img").each(function(i) {
    var image_id = jQuery(this).attr('id');
    image_id = image_id.substr(3);
    if(image_id>0){
      var imgwidth = jQuery(this).width();
      var imgheight = jQuery(this).height();
      var imghspace = jQuery(this).attr('hspace');
      var imgvspace = jQuery(this).attr('vspace');
      var alignment = jQuery(this).attr('align');
      var imgclass = jQuery(this).attr('class');
      jQuery(this).attr({align:"", hspace:"", vspace:""});
      jQuery('#image-container'+image_id)
        .addClass( imgclass )
        .css('float', alignment)
        .width(imgwidth)
        //.css({"margin-top": imgvspace, "margin-left": imghspace, "margin-right": imghspace});
        .css({"margin-top": 0, "margin-bottom":0});
    }
  });
} );
