/*!
	Plugin d'alignement
	Romain CARRIER - Interactiv design
*/

(function($) {

	// Variables globales de la classe	
	
	/*
		Initialization
	*/

	$(function() {
	});


	/*
		API
	*/

	// Open Slimbox with the specified parameters
	$.align = function() {
		
	};
	
	$.fn.align = function(object) {
		
		$(this).addClass('align');
		
		object = object || 'img';
		
		var StageWidth = $(this).width();
		var StageHeight = $(this).height();
		
		$( object, $(this) ).each( function( intIndex ){
		
	    	var width = $(this).width();
	    	var height = $(this).height();
	    	
	    	var left = ( StageWidth-width )/2;
	    	var top = ( StageHeight-height )/2;
	    	
	    	$(this).parent().css( { 'margin-top':top, 'margin-left':left } );
	    	
	    });
	    
	    $(this).removeClass('align');
	};


	/*
		Internal functions
	*/


})(jQuery);
