/*!
 * jQuery JavaScript Library v1.4.2
 * http://jquery.com/
 *
 * Copyright 2010, Guilherme Cândido e Cruz
 * http://www.guilhermecruz.com
 * contato@guilhermecruz.com
 *
 *
 * Date: Wes Jun 11 21:25:28 2010 
 * usage :
 * $().resizebody({
		multioptions: 'Something'
		
	});
 */
(function($){
		$.fn.extend ({
			resizebody: function(seetings){
				var defaults = { horizontalResize: true, verticalResize: false};
				var seetings = $.extend(defaults, seetings);
				
				return this.each(function(){
					var horizontalResize = seetings.horizontaResize;
					var verticalResize = seetings.verticalResize;
					
					if(verticalResize == true) {
						var elHeight = $('#site').height();
						var bodyHeight = $('body').height();
						var mathCount = bodyHeight - elHeight ;
						$('#site').css('position','relative');
						$('#site').css('top',mathCount/2);
						//$('#site').animate({top: mathCount/2},500)
						
						$(window).resize(function(){
							var elHeight = $('#site').height();
							var bodyHeight = $('body').height();
							var mathCount = bodyHeight - elHeight ;
							$('#site').css('position','relative');
							//$('#site').css('top',mathCount/2);
							$('#site').animate({top: mathCount/2},500)
						});
					}
					
					if  (horizontalResize == true) {
						var elWidth	= $('#site').width();
						var bodyWidth	= $('body').width();
						var mathCount = bodyWidth - elWidth;
						$('#site').css('position','relative');
						$('#site').animate({left: mathCount/2},500)
						
						$(window).resize(function(){
							var elWidth	= $('#site').width();
							var bodyWidth	= $('body').width();
							var mathCount = bodyWidth - elWidth;
							$('#site').css('position','relative');
							$('#site').animate({left: mathCount/2},500)
							//$('#site').css('left',mathCount/2);						
						});
												  
					}
										  
				 });
				
				
			}
		}) 
})(jQuery);
