function page_name() {
	var fname = window.location.pathname;
	fname = fname.substring(fname.lastIndexOf("/")+1);
	return fname.substring(0,fname.indexOf("."));
}

function down() {
	this.style.top = '13px';
	this.src = this.src.replace( /\.jpg$/, "_p.jpg");
}

function up() {
	this.style.top = '3px';
	this.src = this.src.replace( /_p\.jpg$/, ".jpg");
}

function goto() {
	window.location = '/cz/' + this.id + '.html';
}

function init_menu() {
	$A($("menu").getElementsByTagName('img')).each(
		function(e) {											   
			e.onmousedown = down;
		 	e.onmouseup = goto;
			e.onmouseout = up;
		}
	);
}

function deactivate_item(id) {
	var item = $(id);
	if (item == null) return;
	item.onmousedown();
	item.onmousedown = null;
	item.onmouseout = null;
	item.onmouseup = null;
}

function init() {
       init_menu();
       deactivate_item(page_name());
//       init_animation('animovany_text');
}

function init_animation(id) {
 var elem = $(id);
 var sz = elem.getSize().x;
 elem.setStyle('left','0px');
 elem.setStyle('width', sz + 'px');
 animate.periodical(20,elem);
}

function animate() {
 if ( this.getStyle('left').toInt() >
this.getParent().getStyle('width').toInt() ) {
   this.setStyle('left','-' + this.getStyle('width'));
 }
 this.setStyle('left', (this.getStyle('left').toInt() + 1) + 'px');
}