(function($){
	$.fn.extend({
		resizer: function(options){
		
			var defaults = {
					flashContainer: "flashContainer",
					width: 1260,
					height: 675
			};
			
			var options = $.extend(defaults, options);
			
			return this.each(function(){
				
				var obj = $(this);
				
				$(window).resize(function(){
					
					var bodyWidth	= $('body').width();	
					var bodyHeight	= $('body').height();
					
					//height
					if (bodyHeight < options.height){
						$('#' + options.flashContainer).css('height', options.height + 'px');
					} else {
						$('#' + options.flashContainer).css('height', bodyHeight + 'px');
					}
		
					bodyWidth	= $('body').width();
					
					//width
					if (bodyWidth < options.width) {
						$('#' + options.flashContainer).css('width', options.width + 'px');
					} else {
						$('#' + options.flashContainer).css('width', bodyWidth + 'px');
					}			
				});
				
				//call the triger action on onload page
				$(window).trigger('resize');
				
			});
			
			
		}
	});
})(jQuery);
