var nobig;

window.addEvent('domready', function() {
	var cacheFlags = Array(16);
	for(var i=1;i<=16;i++){	cacheFlags[i] = new Image(); cacheFlags[i].src = URL+'gfx/flagi/jezyk'+i+'.gif'; }
	var fl = $$('.flaga');
	if (fl) fl.each(function(f){
		f.addEvent('mouseover', function(e) {
			if ( nobig != this.src ) {
				var big = new Element('img');
				big.src = this.src.substr(0,this.src.length-4) + '.gif';
				big.setStyles('z-index:100;cursor:pointer;position:absolute;left:'+this.getLeft()+'px;top:'+this.getTop()+'px;width:40px;height:25px;');
				big.injectInside(document.body);
				big.addEvent('mouseover', function(e) {
					this.effects().start({
					'height':[25,154],
					'width':[40,250],
					'top':[this.getTop(),this.getTop()-65],
					'left':[this.getLeft(),this.getLeft()-105]
					});
				});
				big.addEvent('mouseout', this.remove);
				big.addEvent('click', function() {
					nobig = this.src.substr(0,this.src.length-4) + '.png';
					this.remove();
				});
			}
		});
		f.addEvent('mouseout', function() {
			nobig = '';
		});
	});
});