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='/system/';
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 = 'RTL Bulvár';
var domain = 'http://www.rtlbulvar.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 = '000000';
AC_FL_RunContent(
"src", "http://www.rtlklub.hu/items/flash/rtlklub_player",
"width", "548",
"height", "411",
"align", "middle",
"id", id,
"quality", "high",
"bgcolor", player_backgroundColor,
"wmode", "opaque",
"name", id,
"allowFullScreen", "true",
"allowScriptAccess","always",
"FlashVars","c="+ch_start_color+"&v="+videoid+"&gw=http://www.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
';
}
}
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_loader(){
var string='';
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){
alert(fe_box[i].id + ' - ' + fe_box[i].childNodes.length);
fe_box[i].childNodes[0].style.height = box_height + '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);
content.style.height = topHeightOffset+optionalContentBottomPadding+'px';
//container.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 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, content_type){
webaudit_hit();
if(content_type && id){
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 open_link(url){
if(url){
webaudit_hit();
//window.open(url);
blu(url);
}
}
function pop_content(content, width,height){
/*
var title = content
var w = (width) ? width : 800;
var h = (height) ? height : 600;
var x = ((screen.width-w)/2);
var y = ((screen.height-y)/2);
newwindow2=window.open('','name','height='+h+',width='+w+',left='+x+',top='+y+',dependent=1,alwaysRaised=1,location=0,resizable=0,status=0,titlebar=0,toolbar=0,directories=0,menubar=0,scrollbars=0');
var tmp = newwindow2.document;
tmp.write(''+content+'');
tmp.close();
//tmp.self.close();
*/
}
function print_article(id){
var title = $i('article_title' + id);
var paragraph = $i('paragraph' + id);
var w = 800;
var h = 600;
var x = ((screen.width-w)/2);
var y = ((screen.height-y)/2);
newwindow2=window.open('','name','height='+w+',width='+h+',left='+x+',top='+y+'');
var tmp = newwindow2.document;
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