';
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;
var boxinfo;
var boxcontent;
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;
var content = exclude_nodes(build, '#text').childNodes;
for(i=0;i';
boxinfo.innerHTML += 'width: '+compile_box.offsetWidth+'px ';
boxinfo.innerHTML += 'height: '+compile_box.offsetHeight+'px';
boxinfo.style.zIndex = 10000000+i;
boxinfo.style.top = compile_box.style.top;
boxinfo.style.left = compile_box.style.left;
*/
//compile_box.style.top = (data[i].y != 0) ? data[i].y + 'px' : data[i].y;
//compile_box.style.left = (data[i].x != 0) ? data[i].x + 'px' : data[i].x;
}
var old_height = ($i('content').style.height) ? eval($i('content').style.height.replace('px', '')) : 0;
var new_height = optionalContentBottomPadding + (containerInitialHeight + topHeightOffset);
/* flushing layout memory */
document.body.removeChild(vbox);
/* displaying content area */
//content_resize(old_height, new_height);
/* when buffer used */
/* loading menuitems */
run_page();
} else {
alert('Frontend rendering failed: No content area');
}
}
function resize_stage_objects(){
if(screenstage){ screenstage_resize(); }
if($i('articles')){
article_resize();
}
}
function screenstage_resize(){
get_resolution();
var original_stage_height = $i('stage').offsetHeight;
var extended_stage_height = ((screen_height - eval($i('footer').offsetHeight)) - eval($i('header').offsetHeight))-$i('top-box').offsetHeight;
scale_div_height($i('stage'), original_stage_height, extended_stage_height, 20);
}
function content_resize(ori, ext){
get_resolution();
var original_stage_height = ori;
var extended_stage_height = ext;
$i('content').style.height = extended_stage_height + 'px';
}
function article_resize(){
get_resolution();
var top_dist = eval($i('article' + article_id).style.top.replace('px', ''));
var banner_h = ($i('article_banner')) ? eval($i('article_banner').offsetHeight) : 0;
var footer_h = ($i('footer') && screenstage) ? eval($i('footer').offsetHeight) : 0;
var atitle_h = ($i('article_title')) ? eval($i('article_title').offsetHeight) : 0;
var screen_hides = footer_h + banner_h + top_dist + atitle_h + 160;
var original_article_height = $i('article_page' + article_id).offsetHeight;
var extended_article_height = screen_height - screen_hides;
if(client=='op'){
var article_page = $i('article_page' + article_id);
article_page.style.height = extended_article_height + 'px';
article_page.style.overflow = 'auto';
} else if(client=='sa'){
var article_page = $i('article_page' + article_id);
article_page.style.height = extended_article_height + 'px';
} else {
scale_div_height($i('article_page' + article_id), original_article_height, extended_article_height, 5);
}
$i('article_page' + article_id).style.visibility = 'visible';
}
function dump(arr,level) {
var dumped_text = "";
if(!level){ level = 0; }
//The padding given at the beginning of the line.
var level_padding = "";
for(var j=0;j \"" + 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){
var keypressed;
var keycode;
this.onkeydown = function (event) {
keycode = event.keyCode;
if (event.keyCode == 16) {
keypressed = 'shift';
}
}
this.onkeyup = function (event) {
keycode = event.keyCode;
if (event.keyCode == 16) {
keypressed = '';
}
}
var target = (keypressed) ? '_blank' : '_self';
alert(keycode);
//webaudit_hit();
if(content_type && id){
if(content_type.indexOf('http:')!=-1){
window.open(content_type, '_blank');
} else {
switch (content_type){
case 'article': window.open('/cikk/' + id, target); 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