/*
	Class:    	MostWanted
	Author:   	Jan Moekestorm - Most Wanted Company
	Website:    http://www.mostwantedcompany.nl
	Version:  	1.0.0
	Date:     	05/05/2011
	Built For:  jQuery 1.2.6
*/




/*

$("img").resize(200);

*/


$.fn.resize = function(max_size) {
  m = Math.ceil;
  if (max_size == undefined) {
    max_size = 200;
  }
  h=w= max_size;
  $(this).each(function() {
    image_h = $(this).height();
    image_w = $(this).width();
    if (image_h > image_w) {
      w = m(image_w / image_h * max_size);
    } else {
      h = m(image_h / image_w * max_size);
    }
    $(this).css({height:h, width:w});
  })
};

/*
$.fn.resizexy = function(max_size_x, max_size_y) {
  m = Math.ceil;
  if (max_size_x == undefined) {
    max_size_x = 160;
  }
  if (max_size_y == undefined) {
    max_size_y = 80;
  }
  h= max_size_y;
  w= max_size_x;
  $(this).each(function() {
    image_h = $(this).height();
    image_w = $(this).width();
	
	fact_x= image_w/w;
	fact_y= image_h/h;
	fact_x= w/image_w;
	fact_y= h/image_h;
	
	if (fact_x > fact_y ){
		fact=fact_x;
	} else {fact = fact_y;} 
	

	w = m(image_w / fact);
    h = m(image_h / fact);

    //$(this).css({height:h,width:w});
	$(this).height(20);
	$(this).width(20);	
  })
};
*/
