function $u(_id, _url, _pars, _form) {
	var pars = '';
	if(_form) pars = $(_form).toQueryString();
	if(_pars) pars = pars+'&'+_pars;
	
	new Ajax( _url+'.php',
			  { method: 'post',
				update: $(_id),
				data: pars,
				onFailure: reportError,
				evalScripts: true } ).request();
}

function reportError() {
	alert('Ajax request error.');	
}

var menu = {
	init: function() {
		var normal = 110;
		var open = 160;
		var items = 8;
		var closed = ((items * normal) - open) / (items - 1);
		
		var menu = $$('#item .item');
		var fx = new Fx.Elements(menu, {wait: false, duration: 200, transition: Fx.Transitions.linear});
		menu.each(function(item, i) {
			item.addEvent('mouseenter', function(e) {
				var obj = {}
				obj[i] = {
					'width': [item.getStyle('width').toInt(), open]
				}
				menu.each(function(other, j){
					if (other != item){
						var w = other.getStyle('width').toInt();
						if (w != closed) obj[j] = {'width': [w, closed]};
					}
				})
				fx.start(obj);
			})
		})
		
		$('item').addEvent('mouseleave', function(e) {
			var obj = {}
			menu.each(function(other, j) {
				obj[j] = {'width': [other.getStyle('width').toInt(), normal]};
			})
			fx.start(obj);
		})
	}
}

function getWindowHeight() {
	myHeight = 0;
	if(typeof(window.innerWidth) == 'number') {
		//Non-IE
		myHeight = window.innerHeight;
	} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		//IE 6+ in 'standards compliant mode'
		myHeight = document.documentElement.clientHeight;
	} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
		//IE 4 compatible
		myHeight = document.body.clientHeight;
	}
	return myHeight;
}

function getWindowWidth() {
	var myWidth = 0;
	if(typeof( window.innerWidth) == 'number') {
		//Non-IE
		myWidth = window.innerWidth;
	} else if(document.documentElement && (document.documentElement.clientWidth || document.documentElement.clientHeight)) {
		//IE 6+ in 'standards compliant mode'
		myWidth = document.documentElement.clientWidth;
	} else if(document.body && (document.body.clientWidth || document.body.clientHeight)) {
		//IE 4 compatible
		myWidth = document.body.clientWidth;
	}
	return myWidth;
}