// ez kell a trukkhoz var napkepelajsonobj = { title : '2006 07 25', text : 'Sör How-to', linkurl : 'http://legalja.hu/?leg=view&img=20060725_sor.jpg', thumburl : 'http://legalja.hu/_pic_list.php?img=20060725_sor.jpg', openwindow : function(){ window.open(this.imglinkurl,'_blank',''); return true; }, checkimgloaded : function(){ if(!napkepelajsonobj.tempthumb.complete){ setTimeout('napkepelajsonobj.checkimgloaded(napkepelajsonobj.myimg)',1000); } else{ max_x=napkepelajsonobj.myimg.width; max_y=napkepelajsonobj.myimg.height; pic_x=napkepelajsonobj.tempthumb.width; pic_y=napkepelajsonobj.tempthumb.height; ex=pic_x; ey=pic_y; if(ex>max_x) { ex=max_x; ey=max_x*pic_y/pic_x; } if(ey>max_y) { ey=max_y; ex=max_y*pic_x/pic_y; } napkepelajsonobj.myimg.width=ex; napkepelajsonobj.myimg.height=ey; napkepelajsonobj.myimg.src=napkepelajsonobj.tempthumb.src; } }, loadparameters : function(prefix){ napkepelajsonobj.myimg=document.getElementById(prefix+'img'); mytext=document.getElementById(prefix+'text'); mytitle=document.getElementById(prefix+'title'); napkepelajsonobj.tempthumb=new Image(); napkepelajsonobj.tempthumb.src=this.thumburl; napkepelajsonobj.checkimgloaded(); napkepelajsonobj.myimg.imglinkurl=this.linkurl; napkepelajsonobj.myimg.onclick=this.openwindow; mytext.innerHTML=this.text; mytitle.innerHTML=this.title; } } napkepelajsonobj.loadparameters('napkepela');