/**
 *	Set the width of the white bar in the corner top left
 **/


setSize = {
	
	min: 1005,
	max: 1115,
	size: 0,
		
	page: function() {
		
		var imprint = $$("div.imprint")[0];
		var left = $("logo").getLeft();
		
		left = parseInt(left) - 40;
		if (left < 0) left = 0;
		
		imprint.setStyle("margin-left", left + "px");
		
		if (this.size >= this.max) {
			margin = 92;
			set = this.max;
		} else if (this.size <= this.min) {
			margin = 0;
			set = this.min;
		} else {
			margin = 0;	
			set = this.min + Math.round(this.size - this.min);	
		}
		
		$("links").setStyle('paddingLeft', margin + 'px');
		$("page").setStyle("width", set + "px");
	},
	
	bar: function() {
		var win = window.getSize().size.x;
		
		if (win <= this.max+10) {
			$("bar").setStyle('display', 'none');	
		} else {
			var size = Math.round(((win - this.max) / 2) - 10);	
			$("bar").setStyle('width', size + 'px');
		}
	}
}

function execSizer() {
	try {
	setSize.size = window.getWidth();
	setSize.page();
	setSize.bar();
	} catch(err) { }
	//alert($('page').getSize().size.x);
}

window.addEvent("domready", function() { 
	$("bar").setStyle("opacity", 0.1); 
	execSizer();
	window.addEvent('resize', execSizer);
});

