﻿function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
	function fnPreviewUserData(id){
		var url = '../pages/userdata.aspx?'
		window.open( url + 'id=' + id, '_blank', 'height=270,width=500,status=no,toolbar=no,menubar=no,location=no,resizable=yes,scrollbars=yes');
	}


var m_Module1 = null;
						    var m_Module2 = null;
                                                    var m_Module3 = null;
						    var m_Module4 = null;
						    var timer = 20000;
						    var speed = 70;
						    var h = 88;
						    var c = 11;
						    var d = 8;
                                                    function openInfo(){
                                                        if (m_Module1 == null) m_Module1 = document.getElementById('module1');
							if (m_Module2 == null) m_Module2 = document.getElementById('module2');
							if (m_Module3 == null) m_Module3 = document.getElementById('module3');
							if (m_Module4 == null) m_Module4 = document.getElementById('module4');
							openModule1();
							openModule2();
							openModule3();
							openModule4();
						    }
						    function openModule1(){
							openInfo2(m_Module1,'smoothScroll1()','D5A6A1A0-DFB1-43FA-963C-621CAFDD4FA1','Hírek',5);
						    }
						    function openModule2(){
							openInfo2(m_Module2,'smoothScroll2()','EF7BBEB7-EE5E-467A-B019-BAFAD455AEFD','Programajánló',40);
						    }
						    function openModule3(){
							openInfo2(m_Module3,'smoothScroll3()','59B77CB1-FE1C-4D73-A0DA-38A66B9B149F','Partyfotó',10);
						    }
						    function openModule4(){
							openInfo3(m_Module4,'smoothScroll4()');
						    }

					            function openInfo2(o,c,id,n,t){
                                                        var f = function (v){
                                                            if (o != null){
                                                                o.innerHTML = '';
                                                                o.scrollTop = 0;
                                                                o.innerHTML = v;
                                                            }
                                                            setTimeout(c,timer);
                                                        }
                                                        openAsyncUrl('collection2.aspx?id=' + id + '&n=' + encodeURIComponent(n) + '&top=' + t,f);
                                                    }

					            function openInfo3(o,c,id,n){
                                                        var f = function (v){
                                                            if (o != null){
                                                                o.innerHTML = '';
                                                                o.scrollTop = 0;
                                                                o.innerHTML = v;
                                                            }
                                                            setTimeout(c,timer);
                                                        }
                                                        openAsyncUrl('forum.aspx',f);
                                                    }
                                                    function smoothScroll1(){
                                                        if (m_Module1 != null){
                                                            if (parseInt(m_Module1.scrollHeight) == (parseInt(m_Module1.scrollTop) + h - c)){
								setTimeout('openModule1()',timer);
                                                            }else{
                                                                m_Module1.scrollTop += d;
                                                                if (m_Module1.scrollTop % h != 0){
                                                                    setTimeout('smoothScroll1();',speed);
                                                                }else{
                                                                    setTimeout('smoothScroll1()',timer);
                                                                }
                                                             }   
                                                        }
                                                    }
						    function smoothScroll2(){
                                                        if (m_Module2 != null){
                                                            if (parseInt(m_Module2.scrollHeight) == parseInt(m_Module2.scrollTop) + h - c){
                                                                setTimeout('openModule2()',timer);
                                                            }else{
                                                                m_Module2.scrollTop += d;
                                                                if (m_Module2.scrollTop % h != 0){
                                                                    setTimeout('smoothScroll2();',speed);
                                                                }else{
                                                                    setTimeout('smoothScroll2()',timer);
                                                                }
                                                             }   
                                                        }
                                                    }
						    function smoothScroll3(){
                                                        if (m_Module3 != null){
                                                            if (parseInt(m_Module3.scrollHeight) == parseInt(m_Module3.scrollTop) + h - c){
                                                                setTimeout('openModule3()',timer);
                                                            }else{
                                                                m_Module3.scrollTop += d;
                                                                if (m_Module3.scrollTop % h != 0){
                                                                    setTimeout('smoothScroll3();',speed);
                                                                }else{
                                                                    setTimeout('smoothScroll3()',timer);
                                                                }
                                                             }   
                                                        }
                                                    }
						    function smoothScroll4(){
                                                        if (m_Module4 != null){
                                                            if (parseInt(m_Module4.scrollHeight) == parseInt(m_Module4.scrollTop) + h){
		                                                setTimeout('openModule4()',timer);
                                                            }else{
                                                                m_Module4.scrollTop += d;
                                                                if (m_Module4.scrollTop % h != 0){
                                                                    setTimeout('smoothScroll4();',speed);
                                                                }else{
                                                                    setTimeout('smoothScroll4()',timer);
                                                                }
                                                             }   
                                                        }
                                                    }
                                                    openInfo();                                                      
						    function loadAdvertisement(){
							var f = document.getElementById('rightAdvertisement');
							f.src = f.src;
							setTimeout('loadAdvertisement()',60000);
						    }
						    setTimeout('loadAdvertisement()',60000);
