window.addEvent('load', function()
{
	if ($('maincontainer'))
	{
		new capresize();
	}
	

});

var capresize = new Class(
{
	initialize: function()
	{
		this.changepos();
	},
	changepos: function()
	{

		//we get our current width resolution:
		var i_res_width = window.getSize().x.toInt();

		//we get our current element pos & set our right position:
		var i_el_size = $('maincontainer').getSize().x.toInt();

		var i_diff = i_res_width - i_el_size;

		//var i_diff = i_res_width - i_el_size;
		if (i_diff < 0)
			return;

		$('maincontainer').setStyle('left', i_diff / 2);
	}
});


