function displayWindow(url, width, height) {

    var Win = window.open(url,"displayWindow",'width=' + width + ',height=' + height + ',resizable=0, scrollbars=yes, menubar=no' );

}





function okienko(url,width,height,sb,top,left){ 

	window.open(url,'okienko','align=center,location=0,toolbar=0,status=0,location=0,directories=0,resizable=0,scrollbars='+sb+',width='+width+',height='+height+',top='+top+',left='+left+',menubar=no')

}


/* main menu functionality. requires prototype.js 1.6+ */
Event.observe(window, 'load',
		function() {
				var main_menu = $('main_menu'), items = main_menu.childElements();
				for (var i=0, l=items.length; i<l; i++) {                                
						if (items[i].down('.mm_submenu')){
								var parent = items[i];
								parent.observe('mouseover', function(event){ 
										var elem = $(Event.findElement(event, 'li'));
										$(this).down('.mm_submenu').style.display = 'block';
										$(this).down('a').addClassName('hover');
								});
								parent.observe('mouseout', function(event){
										var elem = $(Event.findElement(event, 'li'));
										$(this).down('.mm_submenu').style.display = 'none';
										$(this).down('a').removeClassName('hover');
								});
						}
				}
				
				// oferty szkolenia
				var offers = $$('.offer');
				for (var i=0, l=offers.length; i<l; i++) {
					var offer = offers[i];
					var btn = offer.down().down('.show_hide');
					Event.observe(btn, 'click', function(e){

						e.preventDefault();
						var offer = $(this).up(1), 
							open = offer.hasClassName('offer_open'),
							cnt = offer.down('.offer_bd');
						if (open) {
							cnt.hide();
							open = false;
							offer.removeClassName('offer_open');
						}
						else {
							offer.addClassName('offer_open');
							cnt.show();
							open = true;							
						}
					});
				}
		}
);
var Slideshow = {
	curItem: 0,
	show_photo: function(elem, item){
		var cnt = $(elem).up(3);
		var photos = cnt.down('.slideshow_cnt').down();
		var width = 240;
		var curItem = this.curItem;
		var total = photos.childElements().length - 1;
		if (typeof(item) == 'number') {
			$(photos).style.left = (-width * item)+'px';
		}
		else {
			if (item == 'prev') {
				item = (curItem - 1) < 0 ? total : curItem - 1;
				$(photos).style.left = (-width * item)+'px';
			}
			else {
				item = (curItem - 1) < 0 ? total : curItem - 1;
				$(photos).style.left = (-width * item)+'px';
			}
		}
		this.curItem = item;
	}	
}

