window.addEvent('domready', function () {
	
	$$('a').each(function(item) {
		item.addEvent('focus', function () {
			this.blur();
		})
	})
	
	// (1) Podswietlane loga
	var loga = $('loga');
	
	if ($chk(loga)){
		loga.getElements('div a').each(function (item){
			item.getLast('img').addEvents ({
				'mouseout': function () {
					this.fade('in');
				},
				'mouseover': function () {
					this.fade('out');
				}
			})
		})
	}
	
	
	// (2) Podswietlane flagi
	var loga = $('lang');
	
	if ($chk(loga)){
		loga.getElements('div[class!=lang_txt] a').each(function (item){
		
			if (item.getElements('img').length > 1) {
				item.getLast('img').addEvents({
					'mouseout': function(){
						this.fade('in');
					},
					'mouseover': function(){
						this.fade('out');
					}
				})
			}
		})
	}	
	
	// (3) Wysokosc menu lewego zalezna od wysokosci tresci (background-image)
	var right =  $('center').getFirst('.right_body');
	if ($chk(right)) {
		var h = right.getStyle('height').toInt();
		var left = $('center').getFirst('.left_submenu');
		if ($chk(left)) {
			var h2 = left.getStyle('height').toInt();
			if (h > h2) {
				left.setStyle('height', h);
			}				
		}
		
	}
	
})

function send_search_form(host){
	
	var search_form = $('search')

	if ($chk(search_form)) {
		var word = search_form.getFirst('input[name=word]');
		
		if ($chk(word)) {
			host += "/" + encodeURIComponent(encodeURIComponent(word.value));
			
			//search_form.submit();
			location.href = host
		}
	}
}

