        var lastdetail=null;
	var animate=true;

        function cto_srv_mini(c) {
                eval('window.clearTimeout(to_srv_mini_'+c+')');
        }

        function to_srv_mini(c, t, fprint) {
                var tmp=window.setTimeout('serverCall.get("hirfal_srv.php?cmd=srv_mini&c='+c+'&fp='+fprint+'")', t);
                eval('to_srv_mini_'+c+'=tmp');
        }

        function global_ctl_status (maxcount, loadedcount) {
                //window.status='loaded: '+loadedcount+' / '+maxcount;
                var bar=getobjectbyid('ctlprogressbar');
                if (maxcount>0) {
                        var percent=(loadedcount/maxcount)*100;
                } else {
                        var percent=100;
                }                       
                if (percent>100) {percent=100;}
                if (bar) {
                        bar.style.width=percent;
                }
        }

        function hidehirlistadetail() {
                var hircimtd=getobjectbyid('hircim_td_'+lastdetail);
                var hiridotd=getobjectbyid('hirido_td_'+lastdetail);
                if (lastdetail) {
                        var hirdet=getobjectbyid('tart'+lastdetail);
                        if (hirdet) {
				if (hirdet.style.display!='none') {
					if (tmrResizeHID) {
						var hl=getobjectbyid('tart'+tmrResizeHID);
						if (hl) {
							hl.style.display='none';		
						}
					}
		       			tmrResizeHID=lastdetail;
					if (animate) {
		       				tmrResizeH=window.setTimeout('tmrResizeHHld()', 1050);
					} else {
		       				tmrResizeH=window.setTimeout('tmrResizeHHld()', 10);
					}
				}
			}

                        //if (hirdet) {
                        //        hirdet.style['display']='none';
                        //}               
                        if (hircimtd) {
                                hircimtd.className='htd_cim';
                        }
                        if (hiridotd) {
                                hiridotd.className='htd_ido';
                        }
                }               
        }
        
        function setopacity(obj, percent) { 
		if ((animate)||(percent==100)) {
	                if ((obj)&&(obj.style)) {
	                        obj.style.zoom=1;
	                        obj.style.filter='Alpha(Opacity='+percent+')';
	                        //obj.style.filters.alpha.opacity=percent;
	                        obj.style.MozOpacity=percent/100;
	                        obj.style.opacity=percent/100;
	                }
		}
        }
	

	tmrResizeS=null;
	tmrResizeSID=null;

	tmrResizeH=null;
	tmrResizeHID=null;

	tmrScroll=null;
	function tmrResizeStart() {
		tmrResizeS=window.setTimeout('tmrResizeSHld()', 100);
	}

	var lasttmrRSHldt=false; //test
	var lasttmrRSHld=0; //time
	var lasttmrRSHldc=0; //count
	var lasttmrRSHldsc=0; //slowcount

	function tmrResizeSHld() {
		window.clearTimeout(tmrResizeS);
		var i=tmrResizeSID;
		//alert('Nagyitas:'+i);
                var hirdet=getobjectbyid('tart'+i);
		if (hirdet) {
        		var h=parseInt(hirdet.style.height);
        		hirdet.style.overflow='hidden';
        		hirdet.style.height='auto';
        		var m=hirdet.offsetHeight;
        		hirdet.style.overflow='hidden';
        		hirdet.style['height']=h;
			var opa=hirdet.style.opacity*100;
        		var dist=Math.round(m-h);

			if (opa<100) {
				if (!animate) {
					setopacity(hirdet, 100);
				} else {
					opa=Math.min(opa+10,100);
					setopacity(hirdet, opa);
					//setopacity(hirdet, Math.round((h/m)*100));
				}
			}
			

			lasttmrRSHldc++;
        		if (dist!=0) {
        			if (dist>0) {
        				var v=Math.max(Math.round(dist/5),3);
        				var v=Math.min(v,50);
        			} else {
        				var v=Math.min(-1*Math.round(dist/5),-3);
        				var v=Math.max(v,-30);
        			}
        			if (Math.abs(v)>Math.abs(dist)) {v=Math.round(dist);}
				if (!animate) {
	        			hirdet.style.height=m;
					lasttmrRSHldt=false;
	        			tmrResizeS=window.setTimeout('tmrResizeSHld()', 3000);		
				} else {
	        			hirdet.style.height=h+v;
	        			tmrResizeS=window.setTimeout('tmrResizeSHld()', 50);		
				}
				
        			//alert('még nem ok '+i+' cél:'+m+' aktuális:'+h+' változás:'+v);
        		}  else {
				if (opa<100) {
					tmrResizeS=window.setTimeout('tmrResizeSHld()', 50);
				} else {
					if (lasttmrRSHldt) {
						lasttmrRSHldt=false;
						var now=new Date().getTime();
						var rt=now-lasttmrRSHld;
						var rto=rt/lasttmrRSHldc;
						var o=document.getElementById('divdebug');
						if (rto>150) {lasttmrRSHldsc++;} else {lasttmrRSHldsc=0;}
						if (lasttmrRSHldsc>=2) {
							animate=false;
						}
						//if (o) {o.innerHTML=rto+' '+lasttmrRSHldsc+' '+animate;}
					}
	        			tmrResizeS=window.setTimeout('tmrResizeSHld()', 3000);
	        			//alert('ok '+m+' '+h);
				}
        		}
		} else {
			//alert('nincs ilyen: '+i);
		}
	}

	function tmrResizeHHld() {
		//alert("hide");
		if (tmrResizeSID==tmrResizeHID) {
			window.clearTimeout(tmrResizeS);
			tmrResizeSID=null;
		}
		window.clearTimeout(tmrResizeH);
		var i=tmrResizeHID;
                var hirdet=getobjectbyid('tart'+i);
		if (hirdet) {
        		var h=parseInt(hirdet.style.height);
			hirdet.style['display']='block';
        		hirdet.style.overflow='hidden';

			var opa=hirdet.style.opacity*100;
			
			if (opa>0) {setopacity(hirdet, Math.round(opa*0.8));}

        		if (h>1) {
        			var v=Math.min(-1*Math.round(h/5),-3);
				var v=Math.max(v,-30);
        			if (Math.abs(v)>Math.abs(h)) {v=-1*Math.round(h);}
				//alert('h:'+h+' v:'+v);
				//alert('h:'+h+' v:'+v);
				var nh=Math.round(h+v);
				if (nh<1) {nh=1;}
				//alert(hirdet.offsetHeight);
				//var o=document.getElementById('divdebug');
				//if (o) {o.innerHTML=new Date().getTime()+' '+animate;}
				if (!animate) {
	        			hirdet.style.height='0px';
	        			hirdet.style.display='none';
					tmrResizeHID=null;
					/*var o=document.getElementById('divdebug');
					if (o) {o.innerHTML='ki';}*/
				} else {
        				hirdet.style.height=nh+'px';
	        			tmrResizeH=window.setTimeout('tmrResizeHHld()', 50);		
				}
				/*if (nh<=1) {
        				//hirdet.style.display='none';	
        				//tmrResizeHID=null;
					tmrResizeH=window.setTimeout('tmrResizeHHld()', 50);
				} else {
        				tmrResizeH=window.setTimeout('tmrResizeHHld()', 50);		
				}*/
			} else {
				hirdet.style.display='none';	
				tmrResizeHID=null;
			}
		}
	}

        function setclassname(id, cname) {
                var obj=getobjectbyid(id);
		if (obj) {
			obj.className=cname;
		}
	}

        function hirlistadetail(i,id) {
                var hirdet=getobjectbyid('tart'+i);
                var hircimtd=getobjectbyid('hircim_td_'+i);
                var hiridotd=getobjectbyid('hirido_td_'+i);
                if (hirdet) {
                        if (hircimtd) {
				window.setTimeout('setclassname("hircim_td_'+i+'", "htd_cim_aktiv")',200);
                                //hircimtd.className='htd_cim_aktiv';
                        }
                        if (hiridotd) {
				window.setTimeout('setclassname("hirido_td_'+i+'", "htd_ido_aktiv")',200);
                                //hiridotd.className='htd_ido_aktiv';
                        }
                        if (hirdet.style['display']=='block') {
                                hidehirlistadetail();
                                lastdetail=i;                           
                                //hidehirlistadetail();
                        } else {
                                hidehirlistadetail();
                                hirdet.style['display']='block';
                                hirdet.style['overflow']='hidden';
                                hirdet.style['height']='1px';
				//alert(setopacity);
				setopacity(hirdet,0);
                                lastdetail=i;
                                serverCall.get('hirfal_srv.php?cmd=srv_hsz&msgid='+id+'&rid='+i);                               
				if (tmrScroll) {window.clearTimeout(tmrScroll);}
				if (animate) {
                                	tmrScroll=window.setTimeout("scrolltoobjparent('tart"+i+"', false, -120)", 3000);
				} else {
                                	tmrScroll=window.setTimeout("scrolltoobjparent('tart"+i+"', false, -120)", 100);
				}
				tmrResizeSID=i;

				lasttmrRSHldt=true;
				lasttmrRSHld=new Date().getTime();
				lasttmrRSHldc=0;
				tmrResizeS=window.setTimeout('tmrResizeSHld()', 50);
                        }
                        pageTracker._trackEvent('Hir', 'reszletek', id);
                }
        }

        function show_srvPage(params) {                
                serverCall.get('hirfal_srv.php?'+params+'&store=1');
                window.setTimeout("scrolltoobjparent('td_srv_center', false, 0)", 300);
        }

        function show_srvHsz(msgid, uid, hszdb) {
                if (typeof hszdb == "undefined") {
                  hszdb = "";
                }
                serverCall.get('hirfal_srv.php?cmd=srv_hsz&msgid='+msgid+'&rid='+uid+'&db='+hszdb);
                //pageTracker._trackEvent('Hir', 'reszletek', id);
        }

        function show_srvHsz_fullrc(msgid, uid) {
                serverCall.get('hirfal_srv.php?cmd=srv_hsz&rc=1&msgid='+msgid+'&rid='+uid);                          
        }

        function cprogressbar() {
                var o=document.getElementById('td_srv_center'); 
                if (o) {                        
                        o.innerHTML='<div style="text-align:center; margin-top:30px;"><img src="images/progress.gif"><br><br>Betöltés...</div>';
                }
        }

        function show_news(cat) {
                var o=document.getElementById('td_srv_center'); 
                if (o) {                        
                        o.innerHTML='<div style="text-align:center; margin-top:30px;"><img src="images/progress.gif"><br><br>Betöltés...</div>';
                }
                //document.location.href='?c='+cat;
                serverCall.get('hirfal_srv.php?cmd=srv_news&phase=1&c='+cat);                                
                //serverCall.get('hirfal_srv.php?cmd=srv_news&phase=1&c='+cat+'&store=1');                                
                window.setTimeout("scrolltoobjparent('td_srv_center', false, 0)", 300);
                pageTracker._trackEvent('Kategoria', 'megnyitas', cat);
        }

        function show_news_cont(cat, container) {
                var o=document.getElementById(container); 
                if (o) {                        
                        o.innerHTML='<div style="text-align:center; margin-top:30px;"><img src="images/progress.gif"><br><br>Betöltés...</div>';
	                serverCall.get('hirfal_srv.php?cmd=srv_news&phase=1&c='+cat+'&container='+container);
                }
        }

        function show_forum(msgid, topicid, forumcmd) {
                cprogressbar();
                serverCall.get('hirfal_srv.php?cmd=srv_forum&msgid='+msgid+'&topic='+topicid+'&forumcmd='+forumcmd);                            
                window.setTimeout("scrolltoobjparent('td_srv_center', false, 0)", 300);
                pageTracker._trackEvent('Forum', 'megnyitas', topicid, forumcmd);
        }

        function preload_forum(msgid, topicid) {
                //serverCall.get('hirfal_srv.php?cmd=srv_forum&msgid='+msgid, true, true);                              
        }

        function preload_news(cat) {
                //serverCall.get('hirfal_srv.php?cmd=srv_news&phase=0&c='+cat, true, true);                               
                serverCall.get('hirfal_srv.php?cmd=srv_news&phase=1&c='+cat, true, true);                               
        }

        function msgwndloaded() {
                var ww=370;
                var wh=302;
                var msgdiv=getobjectbyid('msgddiv');
                if (msgdiv) {
                        var doch=0;
                        if (msgdiv.clientHeight) {doch=msgdiv.clientHeight;}
                        if (doch>0) {
                                doch=doch+25+25+30; //margin+header                             
                                if (doch>screen.height-50) {doch=screen.height-50;}
                                var top=(screen.height-doch+30)/2-25;   // 25=header
                                var left=(screen.width-ww)/2;
                                setTimeout("self.resizeTo("+(ww+10)+", "+doch+");",100);
                                self.moveTo(left,top);
                        }
                }
                self.focus();
        }

        // SZAVAZAS
        function szavazas(id) {
                var szavazasform=document.forms['frmszavazas_'+id];
                if (szavazasform) {
                        szavazasform.submit();
                }
        }

        // KERESÉS
        function searchagain(resultcount)
        {
                var keresesujraform=document.forms['searchagainform'];
                var resultcountobj=getobjectbyid('search_maxresultcount');
                if (keresesujraform) {
                        if (resultcountobj) {resultcountobj.value=resultcount;}
                        keresesujraform.submit();
                }
        }

        // stst.hozzajarulas beikszelese
        function checkreg_stat()
        {
                var regstatobj=getobjectbyid('reg_stat');
                if (regstatobj) {
                        regstatobj.checked='checked';
                }                       
        }
        
        function frissites(uri)
        {
                document.location=uri;
        }

        function showhint(object) {
                if (object) {
                        alert(object.title);
                }
        }

        function findPosY_sc(obj)
        {
                var curtop = 0;
                if (obj.offsetParent)
                {
                        while ((obj.offsetParent) && (!obj.style['overflow']))
                        {
                                curtop += obj.offsetTop
                                obj = obj.offsetParent;
                        }
                }
                else if (obj.y)
                        curtop += obj.y;
                //window.status='findposy_sc:'+curtop;
                return curtop;
        }

        function findPosY(obj)
        {
                var curtop = 0;
                if (obj.offsetParent)
                {
                        while (obj.offsetParent)
                        {
                                curtop += obj.offsetTop
                                obj = obj.offsetParent;
                        }
                }
                else if (obj.y)
                        curtop += obj.y;
                return curtop;
        }

        function scrolltoobj(objid, setfocus, prepos)
        {
                var obj=getobjectbyid(objid);
                if (obj)
                {
                        var pos=findPosY_sc(obj)+prepos;
                        var tav=pos;
                        for (var i=0; tav>0; i++) 
                        {       
                                mm=parseInt(tav/10+1);
                                tav-=mm;                
                                window.scrollBy(0,mm); 
                        }
                        if (setfocus) {
                                obj.focus();            
                        }
                }
        }


        var lastmm=0;
        var sctp=0;
        function scrolltimer(tav, to_pos, objid)
        {
                if (tav>1) {var mm=parseInt(tav/12+1);} else {var mm=parseInt(tav/12-1);}
                var tav;
                if ((mm>0)&&(mm>lastmm+1)) {mm=lastmm+1;}
                if ((mm<0)&&(mm<lastmm-1)) {mm=lastmm-1;}
                tav-=mm;                
                lastmm=mm;
                sctp++;
                //window.status=mm+' '+tav+' '+sctp;
                window.scrollBy(0,mm);
                if ((tav>1)||(tav<-1)) 
                {
                        //window.status+=' ((tav>1)||(tav<-1))';
                        setTimeout("scrolltimer("+tav+", "+to_pos+", '"+objid+"')", 0);
                } else {
                        //window.scrollTo(0, to_pos);           
                        if (getobjectbyid(objid)) {
                                getobjectbyid(objid).focus();
                        }
                }
        }

        function scrolltoobjparent(objid, setfocus, felette)
        {
                var obj=getobjectbyid(objid);           
                if ((obj)&&(!obj.parentNode)) {                         
                        scrolltoobj(objid, setfocus, -30); 
                }
                if ((obj)&&(obj.parentNode))
                {
                        var winh=(document.all)?document.body.offsetHeight:window.innerHeight;
                        var pos=findPosY_sc(obj.parentNode)-1+felette;
                        var cpos=(document.all)?document.body.scrollTop:window.pageYOffset;
                        pos-=cpos;
                        var tav=pos;
                        var objidfocus="";
                        if (setfocus) {objidfocus=objid;}
                        lastmm=0;
                        if ((tav>winh-(130-felette))||(tav<felette)) {
				if (animate) {
                                	scrolltimer(tav, pos, objidfocus);
				} else {
					window.scrollBy(0,pos);
				}
                        }
                } 
        }

        function devcalc() {
                var vc1=document.forms.frm_devcalc.c1.value;
                var vc2=document.forms.frm_devcalc.c2.value;
                var vc3=document.forms.frm_devcalc.c3.value;
                var vc4=document.forms.frm_devcalc.c4.value;
                serverCall.get('hirfal_srv.php?cmd=srv_devcalc&c1='+vc1+'&c2='+vc2+'&c4='+vc4);
                pageTracker._trackEvent('Devizakalkulator', 'kalkulalas', vc1+'-'+vc2, vc4);
                //_ctl_get('hirfal_srv.php?cmd=srv_devcalc&c1='+vc1+'&c2='+vc2+'&c4='+vc4);
        }

        function documentloaded() {
                //alert('loaded');
                serverCall.get("hirfal_srv.php?cmd=srv_mini&c=all");
        }

        function hirert(ert, id, bid) {
                serverCall.get("hirfal_srv.php?cmd=srv_setert&id="+id+"&ert="+ert+"&bid="+bid);                
                pageTracker._trackEvent('Hir', 'ertekeles', id, ert);
        }

        function close_topdiv() {
                cleardiv('div_srv_centertop');
        }

        function srv_sn(id) {
                show_srvPage('cmd=srv_sn&msgid='+id);
        }

        function sc_form(formid, params) {
                var form=document.forms[formid];
                if (form) {
                        serverCall.sendForm(form, 'hirfal_srv.php?'+params)
                }
        }
        
        function scrolltop() {
                window.setTimeout("scrolltoobjparent('div_srv_centertop', false, 0)", 300);
        }

        function uncleardiv(id) {
          var div = document.getElementById(id)
          div.className='div_notempty';        
        }

        function cleardiv(id) {
          var div = document.getElementById(id)
          
          while (div.hasChildNodes()) {
              div.removeChild(div.firstChild);
          }               
          div.className='div_empty';
          //div.style.border='0px solid red';
        }
          
        function srv_hfnapireg() {
                serverCall.get('hirfal_srv.php?cmd=srv_hfnreg');
        }

        function srv_smsfalinfo() {
                serverCall.get('hirfal_srv.php?cmd=srv_smsfalinfo');
        }

        function srv_hgy(id) {                
                var o=document.getElementById('td_srv_center'); 
                if (o) {                        
                        o.innerHTML='<div style="text-align:center; margin-top:30px;"><img src="images/progress.gif"><br><br>Betöltés...</div>';
                }
                serverCall.get('hirfal_srv.php?cmd=srv_hgy&id='+id);
                window.setTimeout("scrolltoobjparent('td_srv_center', false, 0)", 300);
        }

        function newhgy() {             
                var o = document.getElementById("hgyreg");
                if (o) {
                        o.style.display='block';
                }                
        }

        function hide_newhgy() {                             
                var o = document.getElementById("hgyreg");
                if (o) {
                        o.style.display='none';
                        window.setTimeout("scrolltoobjparent('td_srv_center', false, 0)", 100);        
                }                
        }

        function delhgy(id) {             
                if (confirm('Biztos vagy benne hogy törlöd a hírgyűjtőt?')) {
                        serverCall.get('hirfal_srv.php?cmd=srv_hgydel&id='+id);
                }                
        }

        function modhgy(id) {             
                serverCall.get('hirfal_srv.php?cmd=srv_hgymod&id='+id);
        }

        function hide_modhgy() {                             
                var o = document.getElementById("hgyregmod");
                if (o) {
                        o.style.display='none';
                        window.setTimeout("scrolltoobjparent('td_srv_center', false, 0)", 100);        
                }                
        }

        function show_modhgy() {                             
                var o = document.getElementById("hgyregmod");
                if (o) {
                        o.style.display='block';
                        //window.setTimeout("scrolltoobj('frm_hgyregmod', false, -300)", 100);        
                }                
        }

        function srv_hfnreg() {
                sc_form("frm_hfnreg", "cmd=srv_hfnreg");
        }

        function frm_submit(id) {
                var frm=getobjectbyid(id);      
                if (frm) {
                        if (document.forms[id].nosubmit) {
                                if (document.forms[id].nosubmit.value!='') {document.forms[id].nosubmit.value='';}
                        }
                        try {
                                frm.submit();
                                return true;
                                /*if (frm.submit()) {
                                        return true;
                                } else {
                                        return false;
                                }*/
                        }
                        catch(err) {                        
                                return false;
                        }
                }
        }

	/*
        function frm_submit(id) {
                if (document.forms[id]) {
                        if (document.forms[id].nosubmit) {
                                if (document.forms[id].nosubmit.value!='') {document.forms[id].nosubmit.value='';}
                        }
                        document.forms[id].submit();
                }
        }               
	*/

        function ul_start() {
                var w=getobjectbyid('ul_wait');
                var f=getobjectbyid('ul_form');
                if (f) {f.style.visibility='hidden';}
                if (w) {w.style.display='block';}        
                if (!frm_submit('frm_upload')) {
                        w.style.display="none";
                        f.style.visibility='visible';
                }
        }


        function checksubmit(frm) {
                if (frm) {
                        if (frm.nosubmit) {
                                if (frm.nosubmit.value=='') {return true;}
                        }
                }               
                return false;
        }

        function swwc() {
                sc_form("frm_webcam", "cmd=swwc");
        }

        function swwc_start(id) {
               var c=document.forms['frm_webcam'].id;
               if (c) {
                   c.value=id;
               }
               swwc();                
        }

        function swwc_show() {
               serverCall.get('hirfal_srv.php?cmd=swwc_start');
        }

        function swwc_stop(id) {
               serverCall.get('hirfal_srv.php?cmd=swwc_stop');
        }

        function showtv(id) {
               serverCall.get('hirfal_srv.php?cmd=showtv&id='+id);
        }

        function showtv_h(id) {
               serverCall.get('hirfal_srv.php?cmd=showtv&s=h&id='+id);
        }

        function stoptv(id) {
               serverCall.get('hirfal_srv.php?cmd=stoptv&id='+id);
        }

        function stoptv_h(id) {
               cleardiv("div_srv_centertop");
        }

        function login_ide_change(box) {
                if (box) {
                        var txt=getobjectbyid('div_loginboxtext2');
                        var frm=getobjectbyid('loginbox');
                        if (box.value=='hf') {
                                if (txt) {txt.style.display='block';}
                                frm.target='_self';
                        } else {
                                if (txt) {txt.style.display='none';}
                                frm.target='_blank';
                        }
                }
        }


        function vmivill() {                
                var o = document.getElementById('vmenuitem');                
                if (o) {                        
                        if (o.className=='menuelem3') {
                                o.className='menuelem3v';
                        } else {
                                o.className='menuelem3';
                        }
                }
                window.setTimeout('vmivill()', 1000);
        }

        //window.setTimeout('vmivill()', 1000);

        function show_flash(div_id, swfurl) {
                var o = getobjectbyid(div_id);
                o.innerHTML='-';
               swf.reset();
               swf.write(div_id, 'http://www.hirfal.hu/'+swfurl, "swf_"+div_id);
               swf.play("swf_"+div_id);               
                //alert(o.innerHTML);
        }

        function redirect(url) {
                document.location.href=url;
        }

        function installSearchEngine() {
                if (window.external && ("AddSearchProvider" in window.external)) {
                  // Firefox 2 and IE 7, OpenSearch
                  window.external.AddSearchProvider("http://www.hirfal.hu/plugins/hirfal_searcheng4.xml");
                } else if (window.sidebar && ("addSearchEngine" in window.sidebar)) {
                  // Firefox <= 1.5, Sherlock
                  window.sidebar.addSearchEngine("http://www.hirfal.hu/plugins/hirfal_searcheng4.src","http://www.hirfal.hu/plugins/hirfal_searcheng4.gif","Search Plugin", "");
                } else {
                  // No search engine support (IE 6, Opera, etc).
                  alert("A böngésződ sajnos nem támogatja a keresőmotorok telepítését.");
                }
        }
                
        function installSearchEngineCheck() {
                if (window.external && ("AddSearchProvider" in window.external)) {
                  // Firefox 2 and IE 7, OpenSearch                  
                  var d=document.getElementById('div_installsearchengine');
                  if (d) {d.style.display='block';}
                } else if (window.sidebar && ("addSearchEngine" in window.sidebar)) {
                  // Firefox <= 1.5, Sherlock                  
                  var d=document.getElementById('div_installsearchengine');
                  if (d) {d.style.display='block';}
                } else {
                  // No search engine support (IE 6, Opera, etc).
                }
        }

        function sc(params) {
                if (serverCall) {
			serverCall.get('hirfal_srv.php?'+params);
		}
        }

	function share_iwiw(t,u) {
		window.open('/share.php?s=iwiw&u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'iwiwshare','toolbar=0,status=0,location=1, width=650,height=600,scrollbars=1');
		return false;
	}


	function share_facebook(u) {
		window.open('/share.php?s=facebook&u='+encodeURIComponent(u),'facebookshare','toolbar=0,status=0,location=1, width=650,height=400,scrollbars=1');
		return false;
	}

	function share_twitter(t,u) {
		window.open('/share.php?s=twitter&u='+encodeURIComponent(u),'twittershare','toolbar=0,status=0,location=1, width=800,height=400,scrollbars=1');
		return false;
	}

	function share_google(t,u) {
		window.open('/share.php?s=google&u='+encodeURIComponent(u)+'&t='+encodeURIComponent(t),'googleshare','toolbar=0,status=0,location=1, width=800,height=400,scrollbars=1');
		return false;
	}

	function share_myspace(u) {
		window.open('/share.php?s=myspace&u='+encodeURIComponent(u),'myspaceshare','toolbar=0,status=0,location=1, width=450,height=440,scrollbars=1');
		return false;
	}

	function show_obj(id, stype) {
		var o=document.getElementById(id);
		if (o) {
			o.style.display=stype;
		}
	}

	function get_esemenymini() {
		serverCall.get("hirfal_srv.php?cmd=srv_esemeny");
	}
	
	function get_esemenyminiid(id) {
		serverCall.get("hirfal_srv.php?cmd=srv_esemeny&id="+id);
	}

function XBrowserAddHandler(target,eventName,handlerName) { 
          if (target.addEventListener) { 
            target.addEventListener(eventName, function(e){target[handlerName](e);}, false);
          } else if (target.attachEvent) { 
            target.attachEvent("on" + eventName, function(e){target[handlerName](e);});
          } else { 
            var originalHandler=target["on"+eventName]; 
            if (originalHandler) { 
              target["on"+eventName]=function(e){originalHandler(e);target[handlerName](e);}; 
            } else { 
              target["on"+eventName]=target[handlerName]; 
            } 
          } 
}
