function function_indication(){ if(document.getElementById('led')){ var led = document.getElementById('led'); toggle = (led.style.display == 'block') ? 'none' : 'block'; led.style.display = toggle; } } function $i(id) {setTimeout(function_indication,200); return document.getElementById(id); } function $t(name) { return document.getElementsByTagName(name); } function $c(code) { return String.fromCharCode(code); } function $h(value) { return ('0'+Math.max(0,Math.min(255,Math.round(value))).toString(16)).slice(-2); } function _i(id,text) { id.innerHTML=text; } var ie6=(parseFloat(navigator.appVersion.split("MSIE")[1])==6) ? true : false; var agent=navigator.appVersion; var client=((navigator.appName=='Microsoft Internet Explorer')?'ie':(((navigator.appVersion).indexOf('Safari')!=-1)?'sa':((navigator.appName=='Opera')?'op':'ff'))); var iphone = (agent.indexOf('iPhone')!=-1) ? true : false; var now=new Date(); var interpreter_code = true; var environment_code = true; var xml_http = null; var data_path='/'; var data_link='parser'; var data_load=[]; var data_url; var menu_current=0; var command_name; var article_id=null; var running_articles=null; var optionalContentBottomPadding = 10; var component_id; var menu_ttfsize = 11; var menu_fontface = 3; var title = 'RTLHírek'; var domain = 'http://www.rtlhirek.hu'; var title_restore = title; var data_type='init'; var css_url = '/site/layout/'; var timer_data; var load_external_css = true; var wait_timeout=10; var cookie_time=1000; var frame_per_second=Math.round(1000/40); var screen_width; var screen_height; var navigation_buffer = 0; var containerInitialHeight = 0; var screenstage = 0; var levelcode = "home"; var parameters = ''; var OSName="Unknown OS"; var flash_installed = 0; var flash_version = 0; var preloading = false; var doubleclick_time = 60; var compdebug = 0; var default_page = 'main'; var prerender = 1; function object_opacity(id, value) { id.style.opacity = value/100; if(client == 'ie'){id.style.filter = 'alpha(opacity='+value+')';}} function reinit(){ $i('content').innerHTML = ''; xml_http = null; data_load=[]; } function get_operating_system(){ if (navigator.appVersion.indexOf("Win")!=-1){ OSName="Windows";} if (navigator.appVersion.indexOf("Mac")!=-1){ OSName="MacOS";} if ((OSName == "MacOS") && (navigator.appVersion.indexOf("5.0")!=-1)){ OSName="MacOSX Leopard";} if (navigator.appVersion.indexOf("X11")!=-1){ OSName="UNIX";} if (navigator.appVersion.indexOf("Linux")!=-1){ OSName="Linux";} if (navigator.appVersion.indexOf("AmigaOS")!=-1){ OSName="Amiga OS";} return OSName; } function code_certification(){ switch(client){ case 'ff': interpreter_code = true; break; case 'ie': interpreter_code = true; break; case 'sa': interpreter_code = true; break; case 'op': interpreter_code = true; break; } switch(get_operating_system()){ case 'Windows': environment_code = true; break; case 'MacOS': environment_code = true; break; case 'MacOSX Leopard': environment_code = true; break; case 'AmigaOS': environment_code = false; break; } } function skip_preloading(){ preloading = false; } function toggle_loader(s){ webaudit_hit(); //var displaying = (s == true) ? 'block' : 'none'; //$i('loader').style.display = displaying; //if(!s){ $i('content').style.visibility = 'visible'; } } function update_loader_status(status){ } function compile_embedplayer(id, videoid){ var player_backgroundColor = ($i('videoplayer_div')) ? $i('videoplayer_div').style.backgroundColor.replace('#', '') : '666666'; var titleBrandUrl = get_brandlogo(); var ch_start_color = (channel_start_color) ? channel_start_color : '000000'; AC_FL_RunContent( "src", "/items/flash/rtlklub_player", "width", "586", "height", "440", "align", "middle", "id", id, "quality", "high", "bgcolor", player_backgroundColor, "wmode", "opaque", "name", id, "allowFullScreen", "true", "allowScriptAccess","always", "FlashVars","c="+ch_start_color+"&v="+videoid+"&seekBrandUrl=http://www.rtlklub.hu"+get_seekbar()+"&titleBrandUrl=http://www.rtlklub.hu"+titleBrandUrl+"&gw=http://www1.rtlhirek.hu/libs/amfphp/gateway.php", "type", "application/x-shockwave-flash", "pluginspage", "http://www.adobe.com/go/getflashplayer" ); if(external_parameter){ var id = external_parameter.split(':'); //load_gallery(id[1]); } } function embedding_article_media(){ var body = $i('article_body'); var pagedivs = null; var embeds = new Array(); var y = 0; if(body){ for(var i=0;i= data.length) || image.length == 0){ ready = 1; } update_loader_status('Képek betöltése (' + imagecount + '/' + data.length + ' | ' + naturalcount + ') [skip preloading]'); imagecount = 0; // reset the num of complete images naturalcount = 0; if((ready == 1) || (preloading == false)){ /* * if images loaded */ window.clearInterval(imagearray.preloader_mem); run_page(); } } , 10); } else { run_page(); } } function refresh_page(){ var articles = $i('articles'); webaudit_hit(); if(articles == null){ window.location.reload(); } else { setTimeout("refresh_page()", 1740000); } } function advertize_init(){ var obj = $i('banner336x280'); if(obj){ var advert_image = '/items/banners/banner_01.png'; obj.innerHTML = ''; } } function set_cookie(name,value,time){ var date=new Date(); date.setTime(date.getTime()+time*24*60*60*1000); var cookie=name+'='+value+'; expires='+date.toGMTString()+'; path=/'; document.cookie=cookie; } function get_cookie(name) { var value=''; var all_cookies=document.cookie.split(';'); for(var i=0;i
'; return string; } function init_footer_content(){ var string=''; return string; } function init_menuitems(){ update_loader_status('Menü inicializálás'); data_type = 'menu'; load_data(); } function init_footer(){ update_loader_status('Lábléc tartalmi inicializálás'); data_type = 'footer'; load_data(); } var memory_cycles = 0; function reorder_stageboxes(){ var smartorder = (client == 'ie') ? true : true; var fe_box = exclude_nodes($i('content'), '#text').childNodes; var topHeightOffset = 0; var box_height = 0; var box_y = 0; var topOffsets = 0; var deepest_bottom = 0; var topfields = new Array(); var bottomfields = new Array(); var leftfields = new Array(); var rightfields = new Array(); if(smartorder){ var x_collision = false; var y_collision = false; var collision = false; var box = null; var repass = false; for(var i=0;i 0){ if(fe_box[i].childNodes.length > 1){ var move_html = fe_box[i].innerHTML; fe_box[i].innerHTML = '
' + move_html + '
'; move_html = null; } box = fe_box[i]; if(normalize(box.style.height) < box.childNodes[0].offsetHeight){ move_bottom_neighbours(i); } //blu(box.id + ': ' + box.style.height + ' < ' + box.childNodes[0].offsetHeight); box.style.height = box.childNodes[0].offsetHeight + 'px'; //} } } } resize_container(); } function move_bottom_neighbours(box_key){ var fe_box = exclude_nodes($i('content'), '#text').childNodes; var box = (typeof(box_key) == 'object') ? box_key : fe_box[box_key]; var x1 = normalize(box.style.left); var x2 = x1+box.childNodes[0].offsetWidth; var y1 = normalize(box.style.top); var y2 = y1 + box.childNodes[0].offsetHeight; var distance = box.childNodes[0].offsetHeight-normalize(box.style.height); // blu(box.offsetHeight); for(var i=0;i 0){ n_x1 = normalize(box.style.left); n_x2 = n_x1+box.offsetWidth; n_y1 = normalize(box.style.top); n_y2 = n_y1 + box.childNodes[0].offsetHeight; /* a terjeszkedo doboz ala eso dobozok szelesithetik a skalat, de ez megvaltozhatja az xc1 es xc2 egyenletet, ezert a dist ertekhez kotheto a feltetel, kivalasztaskor. tehat: y_coll-nal a distance erteknel nem lehet nagyobb az also belogas. */ y_collision = ((y1 < n_y1) && ((y2-n_y1) < distance)) ? true : false; //x1 = (n_x1 < x1) ? n_x1 : x1; x2 = (n_x2 >= x2) ? n_x2 : x2; xc1 = (((n_x1 <= x1) || (n_x1 > x1)) && (n_x1 <= x2)) ? true : false; xc2 = ((n_x2 > x1) && ((n_x2 <= x2) || (n_x2 > x2))) ? true : false; x_collision = (xc1 && xc2) ? true : false; collision = (x_collision && y_collision) ? true : false; if(collision){ //blu(fe_box[box_key].id + ' bottoms: fe_box' + i); //blu(box.id); box.style.top = n_y1 + (distance) + 'px'; //box.style.border = '2px solid green'; } } } } function resize_container(){ //blu('dev'); var fe_box = exclude_nodes($i('content'), '#text').childNodes; var topfields = new Array(); var topHeightOffset = 0; for(var i=0;i 0){ box_height = fe_box[i].childNodes[0].offsetHeight; febox_height = fe_box[i].offsetHeight; if(febox_height != box_height){ fe_box[i].childNodes[0].style.height = fe_box[i].offsetHeight + 'px'; } box_y = (fe_box[i].style.top) ? fe_box[i].style.top : '0'; box_width = fe_box[i].childNodes[0].offsetWidth; box_x = (fe_box[i].style.left) ? fe_box[i].style.left : '0'; topOffsets = (eval(box_height)) + (eval(box_y.replace('px', '').replace('pt', ''))); topHeightOffset = (topOffsets >= topHeightOffset) ? topOffsets : topHeightOffset; /* ne fedhesse le a felette allo a dobozt :) */ fe_box[i].style.zIndex = topOffsets; } } var content = $i('content'); var container = $i('container'); var content_height = (!content.style.height) ? 0 : normalize(content.style.height); //blu(content_height + ' - ' + topHeightOffset); // if(content_height < topHeightOffset){ content.style.height = topHeightOffset+optionalContentBottomPadding+'px'; //container.style.height = content.style.height //content.style.overflow = 'hidden'; //$i('custom_color').style.height = content.style.height; // } } function drag_menu(){ var data = data_load; var string = ''; var color = 'FFFFFF'; var message = ''; var navobj = $i('navigation'); if(navobj){ if(data == undefined){ message = 'FAILED TO LOAD NAVIGATION ITEMS. WRONG MENUDATA RECEIVED.\n NAVIGATION BUFFER SET TO EMPTY.'; $i('navigation').innerHTML = ''; navigation_buffer = 0; init_footer(); } else { if(data != null){ update_loader_status('Menü elemek betöltése'); $i('navigation').innerHTML = decodeURIComponent(data); navigation_buffer = 1; /* run only on init */ init_footer(); } else { message = 'Failed to load navigation items: empty menudata received. Navigation buffer set to empty'; $i('navigation').innerHTML = ''; toggle_loader(0); } } } else { blu('no navigation object found. checking footer ...'); init_footer(); } } function drag_footer(){ var data = data_load; var string = ''; var color = 'FFFFFF'; var message = ''; var footer = $i('footer'); if(footer){ if(data == undefined){ message = 'FAILED TO LOAD FOOTER CONTENT. WRONG FOOTERDATA RECEIVED.'; $i('footer').innerHTML = ''; preload_images(document.images); } else { if(data != null){ update_loader_status('Lábléc tartalmak kitömörírése'); $i('footer').innerHTML = decodeURIComponent(data); preload_images(document.images); } else { message = 'FAILED TO LOAD FOOTER CONTENT. EMPTY FOOTERDATA RECEIVED'; $i('footer').innerHTML = ''; toggle_loader(0); } } } else { blu('no footer object found. preloading images ...'); preload_images(document.images); } } function new_div(id, classname, string){ var div = document.createElement('div'); if(id){ div.id = id; } if(classname){ div.className = classname; } if(string){ div.innerHTML = string; } return div; } function load_component_stylesheet(cssfile){ if(load_external_css){ var styles = document.getElementsByTagName("LINK"); var css_buffer = 0; for(var i=0;ihelytelen adat');} /* compile frontend */ //$i('content').innerHTML = ''; var build = (obj) ? $i(obj) : $i('content'); var topHeightOffset = 0; var topOffsets = 0; var compile_box; var parentOffset = $i('container').offsetHeight; var virtualHeight = 0; var memory_modifier = (modifier) ? modifier : null; var vbox = null; var load_boxshot = 1; if(build){ /* creating virtual stage */ if($i('virtualbox') == null){ document.body.appendChild(new_div('virtualbox'));} vbox = $i('virtualbox'); vbox.style.position = 'relative'; vbox.style.float = 'left'; vbox.style.visibility = 'hidden'; var limit = 0; for(i=0;i \"" + EncodeString(value) + "\"\n"; } } } else { //Stings/Chars/Numbers etc. dumped_text = ""+arr+" ("+typeof(arr)+")"; } return dumped_text; } function EncodeString(s) { var ss = new String(); for( i = 0; i < s.length; i++) { var fs = s.charCodeAt(i); ss += '&#' + fs + ';'; } return '' + ss + ''; } function blu(string){ if(blueprint == true){ if(!$i('blujs')){ if(!$i('blueprint')){ document.body.appendChild(new_div('blueprint',false,false)); } var blu = $i('blueprint'); blu.style.display = 'block'; blu.style.position = (ie6) ? 'absolute' : 'fixed'; blu.style.top = '6px'; blu.style.right = '6px'; blu.style.border = '4px solid #0e2537'; blu.style.display = 'block'; blu.style.zIndex = 113000; blu.style.color = '#000000'; blu.style.cursor = 'pointer'; blu.style.width = '500px'; blu.style.height = '200px'; blu.style.overflowY = 'auto'; blu.style.lineHeight = '12px'; blu.style.backgroundColor = '#a8d5eb'; object_opacity(blu, 75); blu.onclick = function () { blu.style.display = 'none'; } var blu_puffer = blu.innerHTML; } else { var blu = $i('blujs'); if($i('blueprint').style.display == 'none'){ $i('blueprint').style.display = 'block';} } var blu_puffer = blu.innerHTML; var output = (string) ? dump(string) : 'null / false / undefined'; blu.innerHTML = blu_puffer + '
' + output + '
'; blu_puffer = null; } } function get_status(address) { var client = new XMLHttpRequest(); client.open("HEAD", address); client.send(); } function post_data(address, data) { var client = new XMLHttpRequest(); client.open("POST", address); client.setRequestHeader("Content-Type", "text/plain;charset=UTF-8"); client.send(data); } function load_data(postdata){ timer_data=(new Date()).valueOf(); update_loader_status('Betöltés: ' + data_type); switch(data_type){ case 'frontend': switch(menu_current){ case 0: data_url=data_path+data_link+'/frontend/main'; break; case 1: data_url=data_path+data_link+'/frontend/photogallery'; break; case 2: data_url=data_path+data_link+'/frontend/videogallery'; break; case 3: data_url=data_path+data_link+'/frontend/hour'; break; case 4: data_url=data_path+data_link+'/frontend/search/' + external_parameter; break; case 100: data_url=data_path+data_link+'/frontend/' + levelcode; break; default: data_url=data_path+data_link+'/frontend/main'; } break; case 'component': data_url=data_path+data_link+'/components/' + component_id; break; case 'article': data_url=data_path+data_link+'/article/' + article_id; break; case 'command': data_url=data_path+data_link + '/command/' + command_name; break; case 'menu': data_url=data_path+data_link+'/menu/dock'; break; case 'footer': data_url=data_path+data_link+'/footer/dock'; break; case 'login': data_url=data_path+data_link+'?menu=login&username='+escape(login_username)+'&password='+escape(login_password); break; case 'set_topic_rank': data_url=data_path+data_link+'?menu=set_topic_rank&login='+login+'&topic='+ranking_topic+'&value='+ranking_value; break; } /* asyncron thread processing */ var post_data = (postdata) ? postdata : null; var method = (post_data == null) ? 'GET' : 'POST'; if(xml_http == null){ if(client!='ie'){ xml_http=new XMLHttpRequest(); xml_http.onreadystatechange=xml_http_change; xml_http.open(method,data_url,true); xml_http.send(postdata); } else { xml_http=new ActiveXObject('Microsoft.XMLHTTP'); xml_http.onreadystatechange=xml_http_change; xml_http.open(method,data_url,true); if(post_data == null){ xml_http.send(); } else { xml_http.send(postdata); } } } } function external_interface(cmd){ var head = document.getElementsByTagName("HEAD")[0]; var command_history = head.getElementsByTagName('SCRIPT'); //for(var i=0;ihiba a soros művelet feldolgozásában ' + data_type + ':'+xml_http.status); } if(data_load != null){ switch(data_type){ case 'frontend': switch(menu_current){ case 0: setTimeout('build_layout_components()',wait_timeout); break; case 1: setTimeout('build_layout_components()',wait_timeout); break; case 2: setTimeout('build_layout_components()',wait_timeout); break; case 3: setTimeout('build_layout_components()',wait_timeout); break; case 4: setTimeout('build_layout_components()',wait_timeout); break; case 100: setTimeout('build_layout_components()',wait_timeout); break; default:setTimeout('build_layout_components()',wait_timeout); break; } break; case 'menu': setTimeout('drag_menu()',wait_timeout); break; case 'footer': setTimeout('drag_footer()',wait_timeout); break; case 'article': setTimeout('display_article()',wait_timeout); break; case 'command': var command_switch = command_name.split(':'); switch(command_switch[0]){ case 'register_a_vote': setTimeout('display_vote_result()',wait_timeout); break; case 'search_gallery_channels': setTimeout('photogallery_search_gallery_channels()',wait_timeout); break; case 'search_galleries': setTimeout('gallery_drag_channel_thumbnails()',wait_timeout); break; case 'search_articles': setTimeout('search_result()',wait_timeout); break; case 'load_channel_galleries': setTimeout('gallery_drag_channel_thumbnails()',wait_timeout); break; case 'load_channel_videogalleries': setTimeout('gallery_drag_channel_thumbnails()',wait_timeout); break; case 'load_gallery': setTimeout('photogallery_drag_gallery_thumbnails()',wait_timeout); break; case 'load_videogallery': setTimeout('load_videodata()',wait_timeout+500); break; } break; } } else { blu('no data parsed ' + data_type + menu_current); } } /* process thread limitation! */ xml_http = null; } } function read_content(id, title, content_type, channel_id){ webaudit_hit(); if(content_type && title && id){ if(content_type.indexOf('http:')!=-1){ window.open(content_type, '_blank'); } else { switch (content_type){ case 'article': window.open('/cikk/'+id, '_self'); break; case 'photo': window.open('/dock/photogallery/'+channel_id+':'+id, '_self'); break;//gotoThe('photogallery', id); break; case 'video': window.open('/dock/videogallery/'+channel_id+':'+id, '_self'); break; default: alert('hibás, vagy nem létező link. \n( read_content #' + id + ';' + title + ';' + content_type + ')'); } } } else { alert(error_message(1)); } } function error_message(errorcode){ if(errorcode){ switch(errorcode){ case 1: return 'nem megfelelő hivatkozás'; break; case 2: return 'hibás, vagy nem létező link'; break; case 3: return 'ez az oldal nem elérhető'; break; default: return 'unknown error'; } } else { alert('fatál error'); } } function gotoThe(page, id){ /* another page navigator */ if(page && id){ resetting_global_function_variables(); switch(page){ case 'main': init_home(); break; case 'photogallery': init_photogallery(); break; default: alert(error_message(2)); } parameter = id; } else { alert(error_message(1)); } } var article_multiple_instance = true; var last_article_pos = null; var check_aid = null; function hide_article_space(){ var obj = $i('articles'); if(obj){ obj.style.display = 'none'; $i('articleswitch').onclick = function(){show_article_space();} $i('articleswitch').innerHTML = '[CIKKEK MEGJELENÍTÉSE: ' + ($i('articles').childNodes.length) + ' futó cikk a háttérben.]'; } } function show_article_space(){ var obj = $i('articles'); if(obj){ obj.style.display = 'block'; $i('articleswitch').onclick = function(){hide_article_space();} $i('articleswitch').innerHTML = '[CIKKEK ELREJTÉSE]'; } } function read_article(id, label){ read_content(id, label, 'article', ''); } function _read_article(id, label){ check_aid = id; if(levelcode == 'videogallery'){ window.open('/cikk/' + id); } else { if(article_id != check_aid){ /* reading global article space */ var articles = $i('articles'); /* set the global distance between the viewed article boxes */ var article_drop_distance = 26; var article_container = null; var top_pos_index = 1; var top_pos = 1; /* ad fix */ var banner = $i('banner336x280'); var banner2 = $i('banner336x247'); /* if no global article space exists */ if(articles == null){ if(banner){banner.style.display = 'none';} if(banner2){banner2.style.display = 'none';} /* creating global article space */ articles = new_div('articles', false, false); if(!ie6){ articles.style.position = 'fixed'; } /* applying the global article space to the html container */ if(!ie6){ $i('container').appendChild(articles); } else { document.body.appendChild(articles); } var articleswitch = $i('articleswitch'); if(article_multiple_instance && !articleswitch){ if(client != 'op'){articles.parentNode.innerHTML += '
[CIKKEK ELREJTÉSE]
';} if(ie6){ var asw = $i('articleswitch'); asw.style.position = 'absolute'; asw.style.top = '23px'; asw.style.left = '200px'; } } else { articleswitch.style.display = 'block'; } /* creating the first box, for sampling */ article_container = new_div('article' + id, 'article', false); article_container.style.zIndex = 0; article_container.style.top = '1px'; article_container.style.left = '1px'; $i('articles').appendChild(article_container); } else { /* show if hidden */ show_article_space(); /* if the FIRST example box is available */ running_articles = $i('articles').childNodes.length; /* creating NEW box for the current article with unique id */ article_container = new_div('article' + id, 'article', false); /* searching for new highest layer index */ for(var i=0;i top_pos) ? top_pos_index : top_pos; } article_container.style.zIndex = get_highest_article_layer() + 1; article_container.style.top = article_container.style.left = (top_pos + article_drop_distance) + 'px'; /* applying the current article box to the global article space */ $i('articles').appendChild(article_container); } /* layer order */ article_container.style.display = 'block'; if(article_id != id){ if(article_container.innerHTML == true){ article_container.innerHTML = '
Fájl megnyitása:
"' + decodeURIComponent(label) + '"
'; } data_type = 'article'; article_id = id; webaudit_hit(); load_data(); //external_interface('article:'+id); } } } } function count_articles(){ var articles = exclude_nodes($i('articles'), '#text').childNodes; return articles.length; } function get_highest_article_layer(){ var top_layer_index = 0; var top_layer = 0; var articles = exclude_nodes($i('articles'), '#text'); for(var i=0;i top_layer) ? top_layer_index : top_layer; } return top_layer; } function toggle_article_page(id, page){ var body = exclude_nodes($i('articlebody' + id), '#text'); for(var i=0;i'); tmp.write('

'+title.innerHTML+'

'+ paragraph.innerHTML); tmp.close(); newwindow2.window.print(); //tmp.self.close(); } */ /* other article functions */ function article_fontsize(id, size){ var body = $i(id); var bodypages = body.getElementsByTagName('div'); for(var i=0;i'+content+''); tmp.close(); //tmp.self.close(); } function print_article(id){ var title = $i('paragraph_' + id); var lead = $i('article_lead' + id); var title_alt = $i('title_alt' + id); var body = $i('articlebody' + id); var date = $i('date' + id); var link = $i('link' + id); var author = $i('author' + id); var w = 800; var h = 600; var x = ((screen.width-w)/2); var y = ((screen.height-y)/2); newwindow2=window.open('','name','scrollbars,height='+w+',width='+h+',left='+x+',top='+y+''); var tmp = newwindow2.document; tmp.write('

'+title.innerHTML+'



'); tmp.write('

'+title_alt.innerHTML+'



'); tmp.write('

'+lead.innerHTML+'


'); tmp.write('

'+date.innerHTML+'
'); tmp.write(link.innerHTML+'
'); tmp.write(author.innerHTML+'



'); tmp.write(body.innerHTML); tmp.close(); newwindow2.window.print(); //tmp.self.close(); } /* other article functions */ function article_fontsize(id, size){ var body = $i(id); var bodypages = body.getElementsByTagName('div'); for(var i=0;i