function addEvent(obj, evType, fn){
	if (obj.addEventListener){
		obj.addEventListener(evType, fn, false);
	return true;
	}
	else if (obj.attachEvent){
		var r = obj.attachEvent("on"+evType, fn);
		return r;
	}
	else{
   		return false;
 	}
}

(function(){
 /*Use Object Detection to detect IE6*/
	var  m = document.uniqueID /*IE*/
	&& document.compatMode  /*>=IE6*/
	&& !window.XMLHttpRequest /*<=IE6*/
	&& document.execCommand;
	try{
		if(!!m){
			m("BackgroundImageCache", false, true) /* = IE6 only */ 
		}
	}
	catch(oh){};
})();

function jsemail(email) {
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
}

function jsemaillink(email, link, classname) {
	document.write('<a href="'+link+'"'+(classname!=undefined&&classname!='' ? ' class="'+classname+'"' : '')+'>');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('</a>');
}

function jsmailto(email, cim, classname) {
	document.write('<a href="');
	for(i=email.length-1; i>=0; i--)
		document.write(email.charAt(i));
	document.write('"'+(classname!=undefined&&classname!='' ? ' class="'+classname+'"' : '')+'>'+cim+'</a>');
}

function chr(c) {
	var h = c.toString(16);
	if (h.length==1)
		h = '0'+h;
	h = unescape('%'+h);
	return h;
}

function overflowautoinit(){
	var tags=document.getElementsByTagName("div");
	for (i=0; i<tags.length; i++) {
		tag=tags[i];
		if(tag.className=="overflowautox") {
			tag.style.height=(tag.offsetHeight+tag.offsetHeight-tag.clientHeight)+'px';
		} else if (tag.className=="overflowautoy") {
			tag.style.width=(tag.offsetWidth+tag.offsetWidth-tag.clientWidth)+'px';
		}
	}
}
addEvent(window, 'load', overflowautoinit);
// javascript gallery 1.0
// Copyright (c) 2007 IRQ Internet Kft. All rights reserved.
GalleryViewer={win:window,border:7,bezar_margin:7,frame_border:1,margin:4,nav_margin:32,indicator_width:70,indicator_height:10,nyil_width:74,nyil_height:32,nyil_margin:7,min_width:100,min_height:100,view_delay:10,view_steps:10,pos_on_frame:false,pos_on_nav:true,speed_num:5,slideshow_def_speed:3,panel_width:501,panel_height:45,nav_width:501,nav_height:45,speed_left:262,speed_top:22,pos_width:70,pos_left:255,pos_top:8,pos_color:'#000',kepek:new Array(),leirasok:new Array(),open:false,slideshow_wait:0,getWinWidth:function(){var w=this.win.innerWidth;if(w==undefined||w===0||isNaN(w))w=this.win.document.documentElement.clientWidth;if(w==undefined||w===0||isNaN(w))w=this.win.document.body.clientWidth;return w;},getWinHeight:function(){var h=this.win.innerHeight;if(h==undefined||h===0||isNaN(h))h=this.win.document.documentElement.clientHeight;if(h==undefined||h===0||isNaN(h))h=this.win.document.body.clientHeight;return h;},getScrollLeft:function(){var l=this.win.pageXOffset;if(l==undefined||l===0)l=this.win.document.documentElement.scrollLeft;if(l==undefined||l===0)l=this.win.document.body.scrollLeft;return l;},getScrollTop:function(){var t=this.win.pageYOffset;if(t==undefined||t==0)t=this.win.document.documentElement.scrollTop;if(t==undefined||t===0)t=this.win.document.body.scrollTop;return t;},getDocWidth:function(){var w=this.win.document.body.offsetWidth;if(w==undefined||w==0)w=this.win.document.documentElement.offsetWidth;if(w==undefined||w==0)w=this.win.document.body.scrollWidth;if(w==undefined||w==0)w=this.win.document.documentElement.scrollWidth;return w;},getDocHeight:function(){var h=this.win.document.body.offsetHeight;if(h==undefined||h==0)h=this.win.document.documentElement.offsetHeight;if(h==undefined||h==0)h=this.win.document.body.scrollHeight;if(h==undefined||h==0)h=this.win.document.documentElement.scrollHeight;return h;},panel_poz:function(){if(this.panel!=undefined){this.panel.style.left=Math.round(this.getWinWidth()/2-parseInt(this.panel.style.width)/2)+this.getScrollLeft()+'px';this.panel.style.top=this.getWinHeight()-parseInt(this.panel.style.height)-this.nav_margin+this.getScrollTop()+'px';}},viewer_poz:function(){if(!this.open)return;var descheight=0;var width=this.getWinWidth()-this.border*2-this.frame_border*2-this.margin*2;var fullheight=this.getWinHeight()-this.border*2-this.frame_border*2-(this.panel!=undefined?parseInt(this.panel.style.height)+this.nav_margin:0)-this.margin*2-this.border;var height,nwidth=this.kep_width,nheight=this.kep_height,loop;if(width<this.min_width)width=this.min_width;do{height=fullheight-descheight;if(height<this.min_height)height=this.min_height;if(nwidth>width){nheight=nheight*width/nwidth;nwidth=width;};if(nheight>height){nwidth=nwidth*height/nheight;nheight=height;};this.view.style.width=Math.round(nwidth+this.border*2)+'px';this.view.style.height=Math.round(nheight+this.border*2+this.leiras_y)+'px';if(descheight<this.desc.offsetHeight){descheight+=1;loop=true;}else loop=false;if(nwidth<this.min_width||nheight<this.min_height||descheight>nheight)loop=false;}while(loop);if(this.iframe!=undefined){this.iframe.style.width=parseInt(this.view.style.width)+this.frame_border*2+'px';this.iframe.style.height=parseInt(this.view.style.height)+this.frame_border*2+'px';};this.kep.width=Math.round(nwidth);this.kep.height=Math.round(nheight);this.kep.style.left=this.border+'px';this.kep.style.top=this.border+'px';this.view.style.left=Math.round(width/2-this.kep.width/2)+this.margin+this.getScrollLeft()+'px';this.view.style.top=Math.round(height/2-this.kep.height/2)+this.margin+this.getScrollTop()+'px';if(this.iframe!=undefined){this.iframe.style.left=this.view.style.left;this.iframe.style.top=this.view.style.top;};this.desc.style.marginTop=parseInt(this.kep.style.top)+this.kep.height+'px';this.elozo.style.left=this.nyil_margin+'px';this.elozo.style.top=Math.round(parseInt(this.view.style.height)/2-this.nyil_height/2)+'px';this.kovetkezo.style.left=parseInt(this.view.style.width)-this.nyil_margin-this.nyil_width+'px';this.kovetkezo.style.top=this.elozo.style.top;this.bezar.style.left=parseInt(this.view.style.width)-this.bezar.width-this.bezar_margin+'px';this.bezar.style.top=this.bezar_margin+'px';},getEventTarget:function(event){if(event==undefined)return undefined;if(event.srcElement!=undefined)return event.srcElement;else return event.target;},getEvent:function(event){return(event!=undefined?event:window.event);},blurElement:function(event){var target=GalleryViewer.getEventTarget(GalleryViewer.getEvent(event));if(target!=undefined&&target.blur)target.blur();},addEvent:function(obj,evType,fn){if(obj.addEventListener){obj.addEventListener(evType,fn,false);return true;}else if(obj.attachEvent){var r=obj.attachEvent("on"+evType,fn);return r;}else{return false;}},removeEvent:function(obj,evType,fn){if(obj.removeEventListener){obj.removeEventListener(evType,fn,false);return true;}else if(obj.detachEvent){var r=obj.detachEvent("on"+evType,fn);return r;}else{return false;}},myHandleKey:function(event){if(!GalleryViewer.open)return;event=GalleryViewer.getEvent(event);if(event.ctrlKey||event.altKey)return true;var keyCode=event.keyCode;switch(keyCode){case 37:GalleryViewer.previous();break;case 39:GalleryViewer.next();break;case 32:case 13:GalleryViewer.slideshow();break;case 27:GalleryViewer.close();break;default:return true;};return false;},myResize:function(event){if(!GalleryViewer.open)return;event=GalleryViewer.getEvent(event);GalleryViewer.panel_poz();GalleryViewer.viewer_poz();GalleryViewer.back.style.width=GalleryViewer.getDocWidth()+'px';GalleryViewer.back.style.height=GalleryViewer.getDocHeight()+'px';},myScroll:function(event){if(!GalleryViewer.open)return;event=GalleryViewer.getEvent(event);GalleryViewer.panel_poz();GalleryViewer.viewer_poz();},mouseOffsetX:function(event){if(event&&event.offsetX!=undefined)return event.offsetX;else if(event&&event.layerX)return event.layerX;else return -1;},mouseOffsetY:function(event){if(event&&event.offsetX&&event.offsetX!=undefined)return event.offsetX;else if(event&&event.layerX)return event.layerX;else return -1;},setOpacity:function(a,o){if(a.style.opacity!=undefined)a.style.opacity=o;else a.style.filter='Alpha(Opacity='+(o*100)+', Style=0)';},create:function(pos){this.flash_hidden();this.slideshow_on=false;this.loading=false;this.kep=undefined;this.elozokep=undefined;this.leiras_y=0;this.timeout=undefined;this.monnyil=false;this.tonnyil=undefined;this.pos=pos==undefined?0:pos;this.back=document.createElement('div');this.back.style.position='absolute';this.back.style.left='0px';this.back.style.top='0px';this.back.style.width=this.getDocWidth()+'px';this.back.style.height=this.getDocHeight()+'px';this.back.style.backgroundColor='#000';this.back.onclick=function(){GalleryViewer.close();};this.back.onmouseover=function(){if(GalleryViewer.bezar&&GalleryViewer.bezar.style.visibility=='visible')GalleryViewer.bezar.style.visibility='hidden';if(GalleryViewer.elozo&&GalleryViewer.elozo.style.visibility=='visible')GalleryViewer.elozo.style.visibility='hidden';if(GalleryViewer.kovetkezo&&GalleryViewer.kovetkezo.style.visibility=='visible')GalleryViewer.kovetkezo.style.visibility='hidden';};this.setOpacity(this.back,0.5);this.back.style.zIndex=10000;document.body.appendChild(this.back);if(navigator.userAgent.indexOf('Opera')!=-1&&parseFloat(navigator.appVersion)<=4){this.iframe=undefined;}else{this.iframe=document.createElement('iframe');this.iframe.style.position='absolute';this.iframe.style.background='#fff';this.iframe.style.border='none';this.iframe.frameBorder=0;this.iframe.style.visibility='hidden';this.iframe.style.zIndex=10001;document.body.appendChild(this.iframe);};this.view=document.createElement('div');this.view.style.position='absolute';this.view.style.background='#fff';this.view.style.textAlign='left';this.view.style.border=this.frame_border+'px solid #000';this.view.style.overflow='hidden';this.view.style.visibility='hidden';this.view.style.zIndex=10002;document.body.appendChild(this.view);if(this.kepek.length>1){this.panel=document.createElement('div');this.panel.style.position='absolute';this.panel.style.width=this.panel_width+'px';this.panel.style.height=this.panel_height+'px';this.panel_poz();this.panel.style.textAlign='center';this.panel.style.zIndex=10002;document.body.appendChild(this.panel);this.nav=document.createElement('img');this.nav.style.width=this.nav_width+'px';this.nav.style.height=this.nav_height+'px';this.update_navbar();this.nav.useMap="#gallery_viewer_navbar";this.nav.style.border="none";this.panel.appendChild(this.nav);var areas=[];areas.push(["GalleryViewer.first()","rectangle","9, 8, 34, 34","Első kép"]);areas.push(["GalleryViewer.previous()","rectangle","49, 8, 74, 34","Előző kép"]);areas.push(["GalleryViewer.slideshow()","rectangle","90, 4, 126, 39","Diavetítés"]);areas.push(["GalleryViewer.next()","rectangle","141, 8, 166, 34","Következő kép"]);areas.push(["GalleryViewer.last()","rectangle","180, 8, 205, 34","Utolsó kép"]);areas.push(["GalleryViewer.mailto()","rectangle","376, 8, 402, 34","Kép linkjének küldése e-mailben"]);areas.push(["GalleryViewer.link()","rectangle","417, 8, 442, 34","Megnyitás új ablakban"]);areas.push(["GalleryViewer.close()","rectangle","456, 9, 482, 34","Bezárás"]);this.map=document.createElement("map");this.map.name="gallery_viewer_navbar";this.map.id="gallery_viewer_navbar";var i;this.area=new Array();this.area_length=areas.length;for(i=0;i<areas.length;i++){this.area[i]=document.createElement("area");this.area[i].href="javascript:void("+areas[i][0]+")";this.area[i].shape=areas[i][1];this.area[i].coords=areas[i][2];this.area[i].alt=this.area[i].title=areas[i][3];this.area[i].onclick=this.blurElement;this.map.appendChild(this.area[i]);};this.panel.appendChild(this.map);this.speed=document.createElement('img');this.speed.style.position='absolute';this.speed.style.left=this.speed_left+'px';this.speed.style.top=this.speed_top+'px';this.speed.style.cursor='pointer';this.speed.alt=this.speed.title='Diavetítés sebessége';this.speed.onclick=function(event){event=GalleryViewer.getEvent(event);GalleryViewer.slideshow_def_speed=Math.floor(GalleryViewer.mouseOffsetX(event)/this.width*GalleryViewer.speed_num)+1;GalleryViewer.setSpeed(GalleryViewer.slideshow_def_speed);};this.setSpeed(this.slideshow_def_speed);this.panel.appendChild(this.speed);if(this.pos_on_nav){this.pos_nav=document.createElement('div');this.pos_nav.style.position='absolute';this.pos_nav.style.width=this.pos_width+'px';this.pos_nav.style.left=this.pos_left+'px';this.pos_nav.style.top=this.pos_top+'px';this.pos_nav.style.textAlign='center';this.pos_nav.style.fontFamily='verdana';this.pos_nav.style.fontSize='10px';this.pos_nav.style.fontWeight='normal';this.pos_nav.style.color=this.pos_color;this.pos_nav.innerHTML='';this.panel.appendChild(this.pos_nav);}}else{this.panel=undefined;this.nav=undefined;this.map=undefined;this.area_length=0;this.pos_nav=undefined;this.speed=undefined;};this.desc=document.createElement('div');this.desc.style.marginLeft=this.border+'px';this.desc.style.marginRight=this.border+'px';this.desc.style.paddingLeft='0px';this.desc.style.paddingRight='0px';this.desc.style.paddingTop=this.border+'px';this.desc.style.paddingBottom='0px';this.desc.style.fontFamily='verdana';this.desc.style.fontSize='10px';this.desc.style.fontWeight='bold';this.desc.style.color='#777';this.desc.style.visibility='hidden';this.desc.innerHTML='';this.view.appendChild(this.desc);this.elozo=document.createElement('img');this.elozo.style.width=this.nyil_width+'px';this.elozo.style.height=this.nyil_height+'px';this.elozo.style.position='absolute';this.elozo.style.visibility='hidden';this.elozo.style.cursor='pointer';this.elozo.style.zIndex=1000;this.elozo.alt=this.elozo.title='Előző kép';this.elozo.src='art/gallery/prev.gif';this.elozo.onmousemove=function(){GalleryViewer.monnyil=true;};this.elozo.onclick=function(){if(this.style.visibility=='visible')GalleryViewer.previous();};this.view.appendChild(this.elozo);this.kovetkezo=document.createElement('img');this.kovetkezo.style.width=this.nyil_width+'px';this.kovetkezo.style.height=this.nyil_height+'px';this.kovetkezo.style.position='absolute';this.kovetkezo.style.visibility='hidden';this.kovetkezo.style.cursor='pointer';this.kovetkezo.style.zIndex=1000;this.kovetkezo.alt=this.kovetkezo.title='Következő kép';this.kovetkezo.src='art/gallery/next.gif';this.kovetkezo.onmousemove=function(){GalleryViewer.monnyil=true;};this.kovetkezo.onclick=function(){if(this.style.visibility=='visible')GalleryViewer.next();};this.view.appendChild(this.kovetkezo);this.bezar=document.createElement('img');this.bezar.src='art/gallery/exit.gif';this.bezar.style.position='absolute';this.bezar.style.zIndex=1000;this.bezar.alt=this.bezar.title='Bezárás';this.bezar.style.cursor='pointer';this.bezar.style.visibility='hidden';this.bezar.onmousemove=function(){GalleryViewer.monnyil=true;if(GalleryViewer.kovetkezo.style.visibility=='visible')GalleryViewer.kovetkezo.style.visibility='hidden';if(GalleryViewer.elozo.style.visibility=='visible')GalleryViewer.elozo.style.visibility='hidden';};this.bezar.onmouseover=function(){this.src='art/gallery/exit2.gif';};this.bezar.onmouseout=function(){this.src='art/gallery/exit.gif';};this.bezar.onclick=function(){if(this.style.visibility=='visible')GalleryViewer.close();};this.view.appendChild(this.bezar);this.indicator=document.createElement('img');this.indicator.src='art/gallery/indicator.gif';this.indicator.style.position='absolute';this.indicator.style.visibility='hidden';this.indicator.width=this.indicator_width;this.indicator.height=this.indicator_height;this.indicator.old_scrollTop=this.getScrollTop();this.indicator.old_scrollLeft=this.getScrollLeft();this.indicator.style.left=Math.round(this.getWinWidth()/2-this.indicator.width/2)+'px';this.indicator.style.top=Math.round((this.getWinHeight()-(this.panel!=undefined?parseInt(this.panel.style.height):0))/2-this.indicator.height/2)+'px';this.indicator.style.zIndex=10003;document.body.appendChild(this.indicator);this.go();this.addEvent(this.win,"resize",this.myResize);this.addEvent(this.win,"scroll",this.myScroll);this.addEvent(this.win.document,"keydown",this.myHandleKey);this.open=true;},go:function(){if(this.loading){if(this.elozokep){this.elozokep.onclick=null;this.elozokep.onmousemove=null;this.elozokep.onmouseout=null;this.view.removeChild(this.elozokep);delete(this.elozokep);this.elozokep=undefined;};this.kep.onload=function(){};};this.elozo.style.visibility='hidden';this.kovetkezo.style.visibility='hidden';this.loading=true;if(this.kep){this.panel_poz();this.viewer_poz();};this.indicator.src=this.indicator.src;this.indicator.style.left=parseInt(this.indicator.style.left)+this.indicator.old_scrollLeft-this.getScrollLeft()+'px';this.indicator.style.top=parseInt(this.indicator.style.top)+this.indicator.old_scrollTop-this.getScrollTop()+'px';setTimeout("if (GalleryViewer.loading) GalleryViewer.indicator.style.visibility='visible';",250);this.elozokep=this.kep;this.kep=document.createElement('img');this.kep.style.visibility='hidden';this.kep.style.position='absolute';this.kep.main=this;this.kep.onload=this.loaded;this.kep.src=this.kepek[this.pos];this.view.appendChild(this.kep);this.update_navbar();},loaded:function(){this.main.desc.innerHTML=(this.main.pos_on_frame&&this.main.kepek.length>1?'<span style="float: right; font-weight: normal;">&nbsp;'+(this.main.pos+1)+'/'+this.main.kepek.length+'</span>':'')+(this.main.leirasok[this.main.pos]!=''?this.main.leirasok[this.main.pos]+'<br style="clear: both;" />':'');if(this.main.pos_nav!=undefined&&this.main.pos_on_nav)this.main.pos_nav.innerHTML=(this.main.pos+1)+'/'+this.main.kepek.length;this.main.kep_width=this.width;this.main.kep_height=this.height;if(this.main.elozokep!=undefined)this.main.elozokep.style.visibility='hidden';this.main.view.style.visibility='hidden';if(this.main.iframe!=undefined)this.main.iframe.style.visibility='hidden';this.main.desc.style.visibility='hidden';this.style.visibility='hidden';this.main.leiras_y=0;this.main.viewer_poz();this.main.panel_poz();this.main.setOpacity(this,0);this.main.desc.style.visibility='visible';this.style.visibility='visible';if(this.main.iframe!=undefined)this.main.iframe.style.visibility='visible';this.main.view.style.visibility='visible';this.main.loading=false;this.main.indicator.style.visibility='hidden';this.main.indicator.style.left=parseInt(this.main.view.style.left)+Math.round(parseInt(this.main.view.style.width)/2-this.main.indicator.width/2)+'px';this.main.indicator.style.top=parseInt(this.main.view.style.top)+Math.round(parseInt(this.main.view.style.height)/2-this.main.indicator.height/2)+'px';this.main.indicator.old_scrollLeft=this.main.getScrollLeft();this.main.indicator.old_scrollTop=this.main.getScrollTop();this.onclick=function(event,e){event=GalleryViewer.getEvent(event);var x=this.main.mouseOffsetX(event);if(x>0)if(x<this.width/2){this.main.previous();}else{this.main.next();}};this.onmousemove=function(event){if(this.main.tonnyil!=undefined){clearTimeout(this.main.tonnyil);this.main.tonnyil=undefined;};this.main.monnyil=false;var elozo=this.main.elozo.style.visibility;var kovetkezo=this.main.kovetkezo.style.visibility;var cursor=this.style.cursor;if(this.main.loading){elozo='hidden';kovetkezo='hidden';cursor='default';}else{event=GalleryViewer.getEvent(event);var x=this.main.mouseOffsetX(event);if(x>0)if(x<this.width/2){elozo=this.main.pos>0?'visible':'hidden';kovetkezo='hidden';cursor=elozo=='visible'?'pointer':'default';}else{elozo='hidden';kovetkezo=this.main.pos+1<this.main.kepek.length?'visible':'hidden';cursor=kovetkezo=='visible'?'pointer':'default';}};if(this.main.elozo.style.visibility!=elozo)this.main.elozo.style.visibility=elozo;if(this.main.kovetkezo.style.visibility!=kovetkezo)this.main.kovetkezo.style.visibility=kovetkezo;if(this.style.cursor!=cursor)this.style.cursor=cursor;if(this.main.bezar.style.visibility!='visible')this.main.bezar.style.visibility='visible';};this.onmouseout=function(event){this.main.tonnyil=setTimeout("if (!GalleryViewer.monnyil) { GalleryViewer.elozo.style.visibility = 'hidden'; GalleryViewer.kovetkezo.style.visibility = 'hidden'; GalleryViewer.bezar.style.visibility = 'hidden'; GalleryViewer.tonnyil = undefined; };",100);};if(this.main.elozokep!=undefined){this.main.elozokep.onclick=null;this.main.elozokep.onmousemove=null;this.main.elozokep.onmouseout=null;this.main.view.removeChild(this.main.elozokep);delete(this.main.elozokep);this.main.elozokep=undefined;};if(this.main.slideshow_on){if(this.main.timeout!=undefined)this.main.win.clearTimeout(this.main.timeout);if(this.main.pos+1<this.main.kepek.length)this.main.timeout=this.main.win.setTimeout("GalleryViewer.timer()",this.main.slideshow_wait);else{this.main.slideshow_stop();}};setTimeout("GalleryViewer.leiras_poz(1)",this.main.view_delay);},leiras_poz:function(step){if(this.open&&!this.loading&&this.leiras_y<this.desc.offsetHeight){if(this.desc.innerHTML!=''){this.leiras_y=Math.round(this.desc.offsetHeight*step/this.view_steps);this.view.style.height=this.kep.height+this.border*2+this.leiras_y+'px';this.desc.style.marginTop=parseInt(this.kep.style.top)+this.kep.height+this.desc.offsetHeight-this.leiras_y+'px';};if(step<this.view_steps){this.setOpacity(this.kep,Math.round(step/ this.view_steps* 100)/ 100);setTimeout("GalleryViewer.leiras_poz("+(step+1)+")",this.view_delay);}else{if(this.iframe!=undefined)this.iframe.style.height=this.kep.height+this.border*2+this.leiras_y+'px';this.setOpacity(this.kep,0.99);}}},update_navbar:function(){if(this.panel==undefined)return;var s=this.slideshow_on?'s':'';var p;if(this.kepek.length<=1){p='0';s='';}else if(this.pos==0)p='1';else if(this.pos+1==this.kepek.length){p='3';s='';}else p='2';var src='art/gallery/toolbar'+p+s+'.png';if(this.nav.src!=src)this.nav.src=src;},setSpeed:function(i){this.speed.src='art/gallery/speed'+i+'.gif';switch(i){case 1:this.slideshow_wait=1000;break;case 2:this.slideshow_wait=2000;break;case 3:this.slideshow_wait=3000;break;case 4:this.slideshow_wait=5000;break;case 5:this.slideshow_wait=7500;break;};if(this.timeout!=undefined){clearTimeout(this.timeout);this.timeout=this.win.setTimeout("GalleryViewer.timer()",this.slideshow_wait);}},first:function(){this.slideshow_stop();if(this.kepek.length>0&&this.pos!=0){this.pos=0;this.go();}},previous:function(){this.slideshow_stop();if(this.pos>0){this.pos--;this.go();}},next:function(){this.slideshow_stop();if(this.pos+1<this.kepek.length){this.pos++;this.go();}},last:function(){this.slideshow_stop();if(this.kepek.length>0&&this.pos!=this.kepek.length-1){this.pos=this.kepek.length-1;this.go();}},link:function(){this.win.open(this.kep.src,'_blank');},mailto:function(){this.win.location='mailto:?subject='+escape(this.leirasok[this.pos])+'&body='+escape(this.kep.src);},slideshow_stop:function(){if(this.slideshow_on){this.slideshow_on=false;if(this.timeout!=undefined){this.win.clearTimeout(this.timeout);this.timeout=undefined;};this.update_navbar();}},slideshow_start:function(){if(!this.slideshow_on&&this.pos+1<this.kepek.length){this.slideshow_on=true;if(this.timeout!=undefined)this.win.clearTimeout(this.timeout);this.timeout=this.win.setTimeout("GalleryViewer.timer()",this.slideshow_wait);this.update_navbar();}},slideshow:function(){if(this.slideshow_on)this.slideshow_stop();else this.slideshow_start();},timer:function(){this.timeout=undefined;if(this.pos+1<this.kepek.length){this.pos++;this.go();}},close:function(){this.open=false;this.removeEvent(this.win,"resize",this.myResize);this.removeEvent(this.win,"scroll",this.myScroll);this.removeEvent(this.win.document,"keydown",this.myHandleKey);this.slideshow_stop();if(this.tonnyil!=undefined){clearTimeout(this.tonnyil);this.tonnyil=undefined;};this.kep.onclick=null;this.kep.onmousemove=null;this.kep.onmouseout=null;if(this.elozokep!=undefined){this.elozokep.onclick=null;this.elozokep.onmousemove=null;this.elozokep.onmouseout=null;this.view.removeChild(this.elozokep);delete(this.elozokep);this.elozokep=undefined;};for(var i=0;i<this.area_length;i++){this.area[i].onclick=null;this.map.removeChild(this.area[i]);delete(this.area[i]);};if(this.panel!=undefined){this.panel.removeChild(this.map);delete(this.map);};if(this.nav!=undefined){this.panel.removeChild(this.nav);delete(this.nav);};if(this.pos_nav!=undefined){this.panel.removeChild(this.pos_nav);delete(this.pos_nav);};if(this.speed!=undefined){this.speed.onclick=null;this.panel.removeChild(this.speed);delete(this.speed);};if(this.panel!=undefined){document.body.removeChild(this.panel);delete(this.panel);};this.kovetkezo.onmousemove=null;this.kovetkezo.onclick=null;this.view.removeChild(this.kovetkezo);delete(this.kovetkezo);this.elozo.onmousemove=null;this.elozo.onclick=null;this.view.removeChild(this.elozo);delete(this.elozo);this.bezar.onmousemove=null;this.bezar.onmouseover=null;this.bezar.onmouseout=null;this.bezar.onclick=null;this.view.removeChild(this.bezar);delete(this.bezar);this.view.removeChild(this.desc);delete(this.desc);document.body.removeChild(this.indicator);delete(this.indicator);document.body.removeChild(this.view);delete(this.view);if(this.iframe!=undefined){document.body.removeChild(this.iframe);delete(this.iframe);};this.back.onclick=null;document.body.removeChild(this.back);delete(this.back);this.flash_visible();},flash_hidden:function(){var tags=document.getElementsByTagName("div");for(var i=0;i<tags.length;i++){if(tags[i].className=='flash'&&tags[i].style.visibility!='hidden'){if(tags[i].orig_visibility==undefined)tags[i].orig_visibility=tags[i].style.visibility;tags[i].style.visibility='hidden';}}},flash_visible:function(){var tags=document.getElementsByTagName("div");for(var i=0;i<tags.length;i++)if(tags[i].orig_visibility!=undefined){tags[i].style.visibility=tags[i].orig_visibility;tags[i].orig_visibility=undefined;}}};Gallery=function(){this.kepek=new Array();this.leirasok=new Array();this.add=function(kep,leiras){this.kepek.push(kep);this.leirasok.push(leiras!=undefined?leiras:'');};this.show=function(pos){if(!GalleryViewer.open&&this.kepek.length>0){GalleryViewer.kepek=this.kepek;GalleryViewer.leirasok=this.leirasok;GalleryViewer.create(pos);}};};function galleryinit(){var tags=document.getElementsByTagName("ul");var children;var i,j,id,kep,a,leiras;gallery=new Array();for(i=0;i<tags.length;i++){if(tags[i].className=="gallery"){id=parseInt(tags[i].id.split('_')[1]);gallery[id]=new Gallery();children=tags[i].getElementsByTagName("li");for(j=0;j<children.length;j++){kep=children[j].getElementsByTagName("img");a=children[j].getElementsByTagName("a");if (a.length!=0){a[0].href="javascript:void(gallery["+id+"].show("+j+"))";a[0].target='';leiras=children[j].getElementsByTagName("span");gallery[id].add(kep[0].getAttribute('longdesc'),leiras.length!=0?leiras[0].innerHTML:'');}}}}};addEvent(window,'load',galleryinit);


	PositionX = 10;
	PositionY = 10;
	defaultWidth  = 600;
	defaultHeight = 400;
	var AutoClose = true;
	function popimage(imageURL,imageTitle){
		var imgWin = window.open('','_blank','scrollbars=no,resizable=0,width='+defaultWidth+',height='+defaultHeight+',left='+PositionX+',top='+PositionY);
		if( !imgWin ) { return; } //popup blockers should not cause errors
		imgWin.document.write('<html><head><title>'+unescape(imageTitle)+'<\/title>'+ //'<base href="http://www.weboldal.hu/" />'+
			'<meta http-equiv="imagetoolbar" content="no">\n'+
			'<script type="text\/javascript">\n'+
			'function resizeWinTo() {\n'+
			'if( !document.images.length ) { document.images[1] = document.layers[0].images[1]; }'+
			'var oH = document.images[1].height, oW = document.images[1].width;\n'+
			'if( !oH || window.doneAlready ) { return; }\n'+ //in case images are disabled
			'window.doneAlready = true;\n'+ //for Safari and Opera
			'var x = window; x.resizeTo( oW + 100, oH + 100);\n'+
			'var myW = 0, myH = 0, d = x.document.documentElement, b = x.document.body;\n'+
			'if( x.innerWidth ) { myW = x.innerWidth; myH = x.innerHeight; }\n'+
			'else if( d && d.clientWidth ) { myW = d.clientWidth; myH = d.clientHeight; }\n'+
			'else if( b && b.clientWidth ) { myW = b.clientWidth; myH = b.clientHeight; }\n'+
			'if( window.opera && !document.childNodes ) { myW += 16; }\n'+
			'x.resizeTo( oW = oW + ( ( oW + 100 ) - myW ), oH = oH + ( (oH + 100 ) - myH + 16 ) );\n'+
			'var scW = screen.availWidth ? screen.availWidth : screen.width;\n'+
			'var scH = screen.availHeight ? screen.availHeight : screen.height;\n'+
			'if( !window.opera ) { x.moveTo(Math.round( scW<oW ? 0 : (scW-oW)/2 ),Math.round( scH<oH ? 0 : (scH-oH)/2 )); }\n'+
			'document.getElementById("indicator").style.visibility="hidden";\n'+
			'document.getElementById("closelink").style.visibility="visible";\n'+
			'}\n'+
			'<\/script>'+
			'<style type="text/css">'+
			'BODY{margin:0;}'+
			'A:link{color:#800000;font-family:Verdana;font-size:12px;font-weight:bold;text-decoration:none;}'+
			'A:visited{color:#800000;font-family:Verdana;font-size:12px;font-weight:bold;text-decoration:none;}'+
			'A:hover{color:#ff0000;font-family:Verdana;font-size:12px;font-weight:bold;text-decoration:none;}'+
			'A:active{color:#ff0000;font-family:Verdana;font-size:12px;font-weight:bold;text-decoration:none;}'+
			'</style>'+
			'<\/head><body onload="resizeWinTo();"'+(AutoClose?' onblur="self.close();"':'')+'>'+
			'<img id="indicator" src="art/indicator.gif" style="position: absolute; top: 50%; left: 50%;" />'+
			(document.layers?('<layer left="0" top="0" align="center">'):('<div style="position:absolute;left:0px;top:0px;display:table;text-align:center;">'))+
			'<a href="javascript:window.close();" title="Bezárás"><img src="'+imageURL+'" alt="" border="0" onload="resizeWinTo();" /></a><br /><a href="javascript:window.close();" id="closelink" title="Bezárás" style="visibility: hidden;">Bezár<\/a>'+
			(document.layers?'<\/layer>':'<\/div>')+'<\/body><\/html>');
		imgWin.document.close();
		if( imgWin.focus ) { imgWin.focus(); }
		return;
	}

	function popimageinit(){
		var tags=document.getElementsByTagName("a");
		var s;
		for(i=0;i<tags.length;i++){
			tag=tags[i];
			if(tag.className=="popimage"){
				tag.href="javascript:popimage('" + tag.href + "','" + escape(escape(tag.title)) + "');";
				tag.target="";
				tag.title="Kattintson a nagyobb képért!";
			}
		}
	}

	addEvent(window, 'load', popimageinit);
	addEvent(window, 'load', popupcenterinit);

	var pageWidth  = 770;
	var pageHeight = 670;
	function popupcenter(pageURL){
		var scW = screen.availWidth ? screen.availWidth : screen.width;
		var scH = screen.availHeight ? screen.availHeight : screen.height;
		var pageL = (parseInt(scW) - parseInt(pageWidth)) / 2;
		var pageT = (parseInt(scH) - parseInt(pageHeight)) / 2;
		var pageWin = window.open(pageURL,'_blank','scrollbars=no,resizable=no,width='+pageWidth+',height='+pageHeight+',left='+pageL+',top='+pageT);
	}

	function popupcenterinit(){
		var tags=document.getElementsByTagName("a");
		for(i=0;i<tags.length;i++){
			tag=tags[i];
			if(tag.className=="popupcenter"){
				tag.href="javascript:popupcenter('" + tag.href + "');";
				tag.target="";
			}
		}
	}
/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
 *
 */
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;var clear="art/spacer.gif";pngfix=function(){var els=document.getElementsByTagName('*');var ip=/\.png/i;var i=els.length;while(i-- >0){var el=els[i];var es=el.style;if(el.src&&el.src.match(ip)&&!es.filter){es.height=el.height;es.width=el.width;es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+el.src+"',sizingMethod='crop')";el.src=clear;}else{var elb=el.currentStyle.backgroundImage;if(elb.match(ip)){var path=elb.split('"');var rep=(el.currentStyle.backgroundRepeat=='no-repeat')?'crop':'scale';es.filter="progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+path[1]+"',sizingMethod='"+rep+"')";es.height=el.clientHeight+'px';es.backgroundImage='none';var elkids=el.getElementsByTagName('*');if (elkids){var j=elkids.length;if(el.currentStyle.position!="absolute")es.position='static';while (j-- >0)if(!elkids[j].style.position)elkids[j].style.position="relative";}}}}}
window.attachEvent('onload',pngfix);Viewer = {
	win : window,
	border : 7,
	frame_border : 1,
	margin : 4,
	indicator_width : 70,
	indicator_height : 10,
	min_width : 100,
	min_height : 100,
	view_delay : 10,
	view_steps : 30,
	blackbg : true,
	src : '',
	w : 0,
	h : 0,
	leiras : '',
	open : false,
	getWinWidth : function() {
		var w = this.win.innerWidth;
		if(w==undefined || w===0 || isNaN(w))
			w = this.win.document.documentElement.clientWidth;
		if(w==undefined || w===0 || isNaN(w))
			w = this.win.document.body.clientWidth;
		return w;
	},
	getWinHeight : function() {
		var h = this.win.innerHeight;
		if(h==undefined || h===0 || isNaN(h))
			h = this.win.document.documentElement.clientHeight;
		if(h==undefined || h===0 || isNaN(h))
			h = this.win.document.body.clientHeight;
		return h;
	},
	getScrollLeft : function() {
		var l = this.win.pageXOffset;
		if(l==undefined || l===0)
			l = this.win.document.documentElement.scrollLeft;
		if(l==undefined || l===0)
			l = this.win.document.body.scrollLeft;
		return l;
	},
	getScrollTop : function() {
		var t = this.win.pageYOffset;
		if(t==undefined || t==0)
			t=this.win.document.documentElement.scrollTop;
		if(t==undefined || t===0)
			t=this.win.document.body.scrollTop;
		return t;
	},
	getDocWidth : function() {
		var w=0, i;
		i = this.win.document.documentElement.offsetWidth;
		if (i>w) w = i;
		i = this.win.document.documentElement.scrollWidth;
		if (i>w) w = i;
		i = this.win.document.body.offsetWidth;
		if (i>w) w = i;
		i = this.win.document.body.scrollWidth;
		if (i>w) w = i;
		return w;
	},
	getDocHeight : function() {
		var h=0, i;
		i = this.win.document.documentElement.offsetHeight;
		if (i>h) h = i;
		i = this.win.document.documentElement.scrollHeight;
		if (i>h) h = i;
		i = this.win.document.body.offsetHeight;
		if (i>h) h = i;
		i = this.win.document.body.scrollHeight;
		if (i>h) h = i;
		return h;
	},
	viewer_poz : function() {
		if (!this.open)
			return;
		var descheight = 0;
		var width = this.getWinWidth()-this.border*2-this.frame_border*2-this.margin*2;
		var fullheight = this.getWinHeight()-this.border*2-this.frame_border*2-this.margin*2-this.border;
		var height, nwidth=this.kep_width, nheight=this.kep_height, loop;
		if (width < this.min_width)
			width = this.min_width;
		do {
			height = fullheight-descheight;
			if (height < this.min_height)
				height = this.min_height;
			if (nwidth > width) {
				nheight = nheight * width / nwidth;
				nwidth = width;
			}
			if (nheight > height) {
				nwidth = nwidth * height / nheight;
				nheight = height;
			}
			this.view.style.width = Math.round(nwidth+this.border*2)+'px';
			this.view.style.height = Math.round(nheight+this.border*2+this.leiras_y)+'px';
			if (descheight < this.desc.offsetHeight) {
				descheight+=1;
				loop = true;
			} else
				loop = false;
			if (nwidth < this.min_width || nheight < this.min_height || descheight > nheight)
				loop = false;
		} while (loop);
		if (this.iframe!=undefined) {
			this.iframe.style.width = parseInt(this.view.style.width)+this.frame_border*2+'px';
			this.iframe.style.height = parseInt(this.view.style.height)+this.frame_border*2+'px';
		}
		this.kep.width = Math.round(nwidth);
		this.kep.height = Math.round(nheight);

		this.kep.style.left = this.border+'px';
		this.kep.style.top = this.border+'px';
		if (this.blackbg) {
			this.viewbg.style.left = this.kep.style.left;
			this.viewbg.style.top = this.kep.style.top;
			this.viewbg.style.width = this.kep.width+'px';
			this.viewbg.style.height = this.kep.height+'px';
		}
		this.view.style.left = Math.round(width/2-parseInt(this.kep.width)/2)+this.margin+this.getScrollLeft()+'px';
		this.view.style.top = Math.round(height/2-parseInt(this.kep.height)/2)+this.margin+this.getScrollTop()+'px';
		if (this.iframe!=undefined) {
			this.iframe.style.left = this.view.style.left;
			this.iframe.style.top = this.view.style.top;
		}
		this.desc.style.marginTop = parseInt(this.kep.style.top)+parseInt(this.kep.height)+'px';
	},
	getEventTarget : function(event) {
		if (event==undefined)
			return undefined;
		if (event.srcElement!=undefined)
			return event.srcElement;
		else
			return event.target;
	},
	getEvent : function(event) {
		return (event!=undefined ? event : window.event);
	},
	blurElement : function(event) {
		var target = Viewer.getEventTarget(Viewer.getEvent(event));
		if (target!=undefined && target.blur)
			target.blur();
	},
	addEvent : function(obj, evType, fn) {
		if (obj.addEventListener) {
			obj.addEventListener(evType, fn, false);
			return true;
		} else if (obj.attachEvent) {
			var r = obj.attachEvent("on"+evType, fn);
			return r;
		} else {
	   		return false;
	 	}
	},
	removeEvent : function(obj, evType, fn) {
		if (obj.removeEventListener) {
			obj.removeEventListener(evType, fn, false);
			return true;
		} else if (obj.detachEvent) {
			var r = obj.detachEvent("on"+evType, fn);
			return r;
		} else {
	   		return false;
	 	}
	},
	myHandleKey : function(event) {
		if (!Viewer.open)
			return;
		event = Viewer.getEvent(event);
		if (event.ctrlKey || event.altKey)
			return true;
		var keyCode = event.keyCode;
		switch (keyCode) {
			case 27 : Viewer.close(); break;
			default : return true;
		}
		return false;
	},
	myResize : function(event) {
		if (!Viewer.open)
			return;
		event = Viewer.getEvent(event);
		Viewer.viewer_poz();
		Viewer.back.style.width = Viewer.getDocWidth()+'px';
		Viewer.back.style.height = Viewer.getDocHeight()+'px';
	},
	myScroll : function(event) {
		if (!Viewer.open)
			return;
		event = Viewer.getEvent(event);
		Viewer.viewer_poz();
	},
	mouseOffsetX : function(event) {
		if (event && event.offsetX!=undefined)
			return event.offsetX;
		else if (event && event.layerX)
			return event.layerX;
		else
			return -1;
	},
	mouseOffsetY : function(event) {
		if (event && event.offsetY && event.offsetY!=undefined)
			return event.offsetY;
		else if (event && event.layerY)
			return event.layerY;
		else
			return -1;
	},
	setOpacity : function(a, o) {
		if (a.style.opacity!=undefined) {
			a.style.opacity = o;
		} else {
			a.style.filter = 'Alpha(Opacity='+(o*100)+', Style=0)';
		}
	},
	show : function(name, w, h, title) {
		this.src = name;
		this.w = parseInt(w);
		this.h = parseInt(h);
		this.leiras = title!=undefined ? title : '';
		this.create();
	},
	create : function() {
		var pos=0;
//		this.flash_hidden();

		this.loading = false;
		this.preloading = false;
		this.kep = undefined;
		this.leiras_y = 0;

		this.back = document.createElement('div');
		this.back.style.position = 'absolute';
		this.back.style.left = '0px';
		this.back.style.top = '0px';
		this.back.style.width = this.getDocWidth()+'px';
		this.back.style.height = this.getDocHeight()+'px';
		this.back.style.backgroundColor = '#000';
		this.back.onclick = function() { Viewer.close(); };
		this.setOpacity(this.back, 0.5);
		this.back.style.zIndex = 10000;
		document.body.appendChild(this.back);

		if (navigator.userAgent.indexOf('Opera')!=-1 && parseFloat(navigator.appVersion)<=4) {
			this.iframe = undefined;
		} else {
			this.iframe = document.createElement('iframe');
			this.iframe.style.position = 'absolute';
			this.iframe.style.background = '#fff';
			this.iframe.style.border = 'none';
			this.iframe.frameBorder = 0;
			this.iframe.style.visibility = 'hidden';
			this.iframe.style.zIndex = 10001;
			document.body.appendChild(this.iframe);
		}

		this.view = document.createElement('div');
		this.view.style.position = 'absolute';
		this.view.style.background = '#fff';
		this.view.style.textAlign = 'left';
		this.view.style.border = this.frame_border+'px solid #000';
		this.view.style.overflow = 'hidden';
		this.view.style.visibility = 'hidden';
		this.view.style.zIndex = 10002;
		document.body.appendChild(this.view);

		if (this.blackbg) {
			this.viewbg = document.createElement('div');
			this.viewbg.style.background = '#000';
			this.viewbg.style.position = 'absolute';
			this.view.appendChild(this.viewbg);
		}

		this.desc = document.createElement('div');
		this.desc.style.marginLeft = this.border+'px';
		this.desc.style.marginRight = this.border+'px';
		this.desc.style.paddingLeft = '0px';
		this.desc.style.paddingRight = '0px';
		this.desc.style.paddingTop = this.border+'px';
		this.desc.style.paddingBottom = '0px';
		this.desc.style.fontFamily = 'verdana';
		this.desc.style.fontSize = '10px';
		this.desc.style.fontWeight = 'bold';
		this.desc.style.color = '#777';
		this.desc.style.visibility = 'hidden';
		this.desc.innerHTML = '';
		this.view.appendChild(this.desc);

		this.indicator = document.createElement('img');
		this.indicator.src = 'art/gallery/indicator.gif';
		this.indicator.style.position = 'absolute';
		this.indicator.style.visibility = 'hidden';
		this.indicator.width = this.indicator_width;
		this.indicator.height = this.indicator_height;
		this.indicator.old_scrollTop = this.getScrollTop();
		this.indicator.old_scrollLeft = this.getScrollLeft();
		this.indicator.style.left = Math.round(this.getWinWidth()/2-this.indicator.width/2)+'px';
		this.indicator.style.top = Math.round((this.getWinHeight())/2-this.indicator.height/2)+'px';
		this.indicator.style.zIndex = 10003;
		document.body.appendChild(this.indicator);

		this.open = true;



		this.preloading = true;
		this.indicator.src = this.indicator.src;
		this.indicator.style.left = parseInt(this.indicator.style.left)+this.indicator.old_scrollLeft-this.getScrollLeft()+'px';
		this.indicator.style.top = parseInt(this.indicator.style.top)+this.indicator.old_scrollTop-this.getScrollTop()+'px';
		setTimeout("if (Viewer.preloading && Viewer.indicator && Viewer.indicator.style) Viewer.indicator.style.visibility='visible';", 250);

		this.loading = true;

		this.kep = document.createElement('iframe');
		this.kep.style.visibility = 'hidden';
		this.kep.style.position = 'absolute';
		this.kep.style.border = 'none';
		this.kep.frameBorder = 0;
		//this.kep.width = parseInt(this.w);
		//this.kep.height = parseInt(this.h);
		this.kep.width = 100;
		this.kep.height = 100;
//		this.kep.main = this;
/*		if (this.kep.attachEvent) {
			this.kep.attachEvent("onload", function(){Viewer.loaded();});
		} else {
			this.kep.onload = this.loaded;
		}
		this.kep.src = this.src;*/
		this.view.appendChild(this.kep);
/*
		this.kep = document.createElement('div');
		this.kep.style.visibility = 'hidden';
		this.kep.style.position = 'absolute';
		this.kep.width = parseInt(this.w);
		this.kep.height = parseInt(this.h);
		this.kep.main = this;
		this.view.appendChild(this.kep);
		this.kep.innerHTML = '<iframe src="'+this.src+'" onload="Viewer.loaded()" width="'+this.w+'" height="'+this.h+'" />';
*/
		Viewer.loaded();


		this.addEvent(this.win, "resize", this.myResize);
		this.addEvent(this.win, "scroll", this.myScroll);
		this.addEvent(this.win.document, "keydown", this.myHandleKey);
	},
	loaded : function() {
		this.main = Viewer;
		if (!this.main.open || !this.main.desc)
			return;
		this.main.desc.innerHTML = this.main.leiras!='' ? this.main.leiras+'<br style="clear: both;" />' : '';
		//this.main.kep_width = parseInt(this.main.kep.width);
		//this.main.kep_height = parseInt(this.main.kep.height);
		this.main.kep_width = parseInt(this.main.w);
		this.main.kep_height = parseInt(this.main.h);
		this.main.viewer_poz();

		this.main.view.style.visibility = 'hidden';
		if (this.main.iframe!=undefined)
			this.main.iframe.style.visibility = 'hidden';
		this.main.desc.style.visibility = 'hidden';
		this.main.kep.style.visibility = 'hidden';

		this.main.leiras_y = 0;
//		this.main.viewer_poz();

		this.main.kep.src = this.main.src;

		this.main.setOpacity(this.main.kep, 0);

		this.main.desc.style.visibility = 'visible';
		this.main.kep.style.visibility = 'visible';
		if (this.main.iframe!=undefined)
			this.main.iframe.style.visibility = 'visible';
		this.main.view.style.visibility = 'visible';

		this.main.loading = false;
		this.main.preloading = false;

		this.main.indicator.style.visibility = 'hidden';
		this.main.indicator.style.left = parseInt(this.main.view.style.left)+Math.round(400-parseInt(this.main.indicator.width)/2)+'px';
		this.main.indicator.style.left = parseInt(this.main.view.style.left)+'px';
		this.main.indicator.style.left = parseInt(this.main.view.style.left)+Math.round(parseInt(this.main.view.style.width)/2-this.main.indicator.width/2)+'px';
		this.main.indicator.style.top = parseInt(this.main.view.style.top)+Math.round(parseInt(this.main.view.style.height)/2-this.main.indicator.height/2)+'px';
		this.main.indicator.old_scrollLeft = this.main.getScrollLeft();
		this.main.indicator.old_scrollTop = this.main.getScrollTop();

		var tim = new Date();
		this.main.poztim = tim.getTime();
		setTimeout("Viewer.leiras_poz()", this.main.view_delay);

		this.main.viewer_poz();
	},
	leiras_poz : function() {
		if (this.open && !this.loading && this.leiras_y < this.desc.offsetHeight) {
			var tim = new Date();
			var step = Math.floor((tim - this.poztim) / this.view_delay);
			if (step > this.view_steps)
				step = this.view_steps;
			if (this.desc.innerHTML != '') {
				this.leiras_y = Math.round(this.desc.offsetHeight * step / this.view_steps);
				this.view.style.height = parseInt(this.kep.height)+this.border*2+this.leiras_y+'px';
				this.desc.style.marginTop = parseInt(this.kep.style.top)+parseInt(this.kep.height)+this.desc.offsetHeight-this.leiras_y+'px';
			}
			if (step < this.view_steps) {
				this.setOpacity(this.kep, Math.round(step / this.view_steps * 100) / 100);
				setTimeout("Viewer.leiras_poz()", this.view_delay);
			} else {
				if (this.iframe!=undefined)
					this.iframe.style.height = parseInt(this.kep.height)+this.border*2+this.leiras_y+'px';
				this.setOpacity(this.kep, 0.99);
			}
		}
	},
	close : function() {
		this.open = false;

		this.removeEvent(this.win, "resize", this.myResize);
		this.removeEvent(this.win, "scroll", this.myScroll);
		this.removeEvent(this.win.document, "keydown", this.myHandleKey);

		this.kep.onload = null;

		this.view.removeChild(this.desc);
		delete(this.desc);
		if (this.blackbg) {
			this.view.removeChild(this.viewbg);
			delete(this.viewbg);
		}
		document.body.removeChild(this.indicator);
		delete(this.indicator);
		document.body.removeChild(this.view);
		delete(this.view);
		if (this.iframe!=undefined) {
			document.body.removeChild(this.iframe);
			delete(this.iframe);
		}
		this.back.onclick = null;
		document.body.removeChild(this.back);
		delete(this.back);

//		this.flash_visible();
	},
	flash_hidden : function() {
		var tags=document.getElementsByTagName("div");
		for(var i=0; i<tags.length; i++) {
			if (tags[i].className=='flash' && tags[i].style.visibility!='hidden') {
				if (tags[i].orig_visibility==undefined)
					tags[i].orig_visibility=tags[i].style.visibility;
				tags[i].style.visibility='hidden';
			}
		}
	},
	flash_visible : function() {
		var tags=document.getElementsByTagName("div");
		for(var i=0; i<tags.length; i++)
			if (tags[i].orig_visibility!=undefined) {
				tags[i].style.visibility=tags[i].orig_visibility;
				tags[i].orig_visibility=undefined;
			}
	}
}
