function background_image_cache(fix) {
try {
document.execCommand("BackgroundImageCache", false, fix);
} catch(err) { }
}
function count_chars(obj){
var max_char = 1000;
var char_len = obj.value.length;
if(char_len > max_char){
obj.value = obj.value.substr(0,max_char);
}
char_len = obj.value.length;
$i('chars').innerHTML = char_len + '/' +max_char + ' karakter';
}
function popup(id,w,h){
var x = ((screen.width-w)/2);
var y = ((screen.height-y)/2);
var popup = window.open(''+id,'','width='+w+',height='+h+',hotkeys=0,dependent=1,alwaysRaised=1,location=0,resizable=1,status=0,titlebar=0,toolbar=0,directories=0,menubar=0,scrollbars=1,left=' +x+',top=150');
}
function popup_ns(id,w,h) {
var x = ((screen.width-w)/2);
var y = ((screen.height-h)/2);
var popup = window.open(''+id,'','width='+w+',height='+h+',hotkeys=0,dependent=1,alwaysRaised=1,location=0,resizable=0,status=0,titlebar=0,toolbar=0,directories=0,menubar=0,scrollbars=0,left=' +x+',top='+y+'');
}
function confirmRequest(msg, url) {
if (confirm(msg)) {
location = url;
}
}
function fullscreen(theURL) {
window.open(theURL, '', 'width=1600, height=1150, fullscreen=yes, scrollbars=auto');
}
function click_info(){
var obj = $i('browsersupport');
var footer = $i('footer');
obj.style.display = (obj.style.display == 'none') ? 'block' : 'none';
footer.style.height = (obj.style.display == 'block') ? '110px' : '80px';
reorder_stageboxes();
scrollpage(document.body, 30);
}
function print_r(theObj){
var html = '';
if(theObj.constructor){
html+='
';
for(var p in theObj){
if(typeof(theObj[p]) == 'object'){
html+='- ['+p+'] => '+typeof(theObj)+'
';
html+='';
var inner = theObj[p];
for(var r in inner){
if(typeof(inner[r]) == 'object'){
var inf = inner[r];
html+='- ['+p+'] => '+typeof(theObj)+'
';
html+='';
html+=print_r2(inf);
html+='
';
} else {
html+='- ['+r+'] => '+inner[r]+' ('+typeof(inner[r])+')
';
}
}
html+='
';
} else {
html+='- ['+p+'] => '+theObj[p]+'
';
}
}
html+='
';
return html;
}
}
function print_r2(theObj){
var html = '';
if(theObj.constructor){
html+='';
for(var p in theObj){
if(typeof(theObj[p]) == 'object'){
html+='- ['+p+'] => '+typeof(theObj)+'
';
html+='';
var inner = theObj[p];
for(var r in inner){
html+='- ['+r+'] => '+inner[r]+' ('+typeof(inner[r])+')
';
}
html+='
';
} else {
html+='- ['+p+'] => '+theObj[p]+'
';
}
}
html+='
';
return html;
}
}
function change_background(object, color){
object.appendChild(new_div('selection', false, false));
var selector=$i('selection');
selector.style.position = 'absolute';
selector.style.width = object.offsetWidth + "px";
selector.style.height = object.offsetHeight + "px";
selector.style.top = 0;
selector.style.left = "-8px";
selector.style.borderRight = '8px solid #fff';
object_opacity(selector, 10);
var temp_color = object.style.backgroundColor;
var temp_function = object.onmouseover;
selector.onmouseover = function (){
object.onmouseover = function(){}
}
selector.onclick = function (){
object.removeChild(selector);
}
selector.onmouseout = function (){
object.removeChild(selector);
object.onmouseover = temp_function;
}
}
function blueprint() {
var width = window.innerWidth;
var height = window.innerHeight;
if(document.getElementById('dhtml_goodies_id' + divCounter).style.display == 'none'){
document.getElementById('dhtml_goodies_id' + divCounter).style.display = 'block';
} else {
fadeoutobject(document.getElementById('dhtml_goodies_id' + divCounter));
//document.getElementById('dhtml_goodies_id' + divCounter).style.display = 'none';
}
}
function setBGColor(id, hexc){
document.getElementById('' + id + '').style.backgroundColor = hexc;
}
function unsetBGColor(id, hexc){
document.getElementById(id).style.backgroundColor = hexc;
}
function closeme(){
opener.focus();
self.close();
}
function loadPage(id){
window.open(id, '_parent');
}
function listitem_highlite(obj, maxed){
for(var i=1;i<=maxed;i++){
var listitem_object = document.getElementById('listitem' + i);
listitem_highlite_force_off(listitem_object);
}
obj.style.backgroundColor='#ffffff';
//obj.childNodes[1].style.backgroundColor='#000000';
obj.style.color='#305cb6';
}
function listitem_highlite_force_off(obj){
obj.style.backgroundColor='';
//obj.childNodes[1].style.backgroundColor='#ffffff';
obj.style.color='#ffffff';
}
function resetting_global_function_variables(){
/* this function appears in the frontend environment
* external calls, needs a global resetting, when a new page called.
*/
global_runtime = null
motion_sense = false;
item_pos = 1;
vgt_item_pos = 1;
pgt_item_pos = 1;
}
/* *************** slider **************** */
motion_sense = false;
var item_pos = 1;
var vgt_item_pos = 1;
var pgt_item_pos = 1;
function section_pos(id, move){
var obj = $i(id);
var childs = exclude_nodes(obj, '#text').childNodes;
var active = 0;
for(var i=0;childs.length>i;i++){
if(childs[i].className == 'active'){
active = i;
childs[i].className = 'inactive';
}
}
if(move == 'left' && active > 0){
childs[active-1].className = 'active';
} else if((move == 'right') && (active < (childs.length-1))){
childs[active+1].className = 'active';
} else {
childs[active].className = 'active';
}
}
function section_active(active, obj, group, SAMPLE_DST_OBJ, OBJ_ID, MAX_ITEMS){
//autoslide(SAMPLE_DST_OBJ, active, obj, MAX_ITEMS);
var childs = exclude_nodes($i(obj), '#text').childNodes;
var _obj = document.getElementById(OBJ_ID);
var sample = document.getElementById(SAMPLE_DST_OBJ);
var objpos = (_obj.style.right) ? eval(_obj.style.right.replace('px', '')) : 0;
var POS = active+1;
var inactive = 0;
var dist = eval(sample.offsetWidth) * active;
for(var i=0;childs.length>i;i++){
if(childs[i].className == 'active'){
inactive = i;
}
if(inactive != active){
childs[i].className = 'inactive';
}
}
var itempos = inactive+1;
if(motion_sense == false){
if(inactive != active){
childs[active].className = 'active';
var DRC = (active > inactive) ? 'left' : 'right';
var step = 0;
switch(DRC){
case 'left': step=POS-itempos; break;
case 'right': step=itempos-POS; break;
}
move_object(_obj, DRC, dist, 0, 11, 11);
}
}
}
function exclude_nodes(obj, nodename){
if(obj){
for(var i=0;obj.childNodes.length>i;i++){
if(obj.childNodes[i].nodeName == nodename){
obj.removeChild(obj.childNodes[i]);
}
}
return obj;
} else {
alert(error_message(1));
}
}
function display_tab(object, tabobject){
var obj = object;
/* reseting the channel pos */
var parent = exclude_nodes(obj.parentNode, '#text');
var tabs = exclude_nodes(tabobject.parentNode, '#text');
//alert(tabs.childNodes.length);
for(var i=0;parent.childNodes.length>i;i++){
//alert(parent.childNodes[i].id);
parent.childNodes[i].style.display = 'none';
tabs.childNodes[i].className = 'inactivetab';
}
obj.style.display = 'block';
tabobject.className = 'activetab';
}
function slide(SAMPLE_DST_OBJ, DRC, OBJ_ID, MAX_ITEMS, CUST_SPEED){
if(motion_sense == false){
if(!SAMPLE_DST_OBJ) alert('SAMPLE_DST_OBJ');
if(!DRC) alert('DRC');
if(!OBJ_ID) alert('OBJ_ID');
if(!MAX_ITEMS) alert('MAX_ITEMS');
var sample = document.getElementById(SAMPLE_DST_OBJ);
var speed = (CUST_SPEED) ? CUST_SPEED : 10;
if(client == 'ie'){
speed = speed/2;
}
var _obj = document.getElementById(OBJ_ID);
var rpos = (_obj.style.right) ? eval(_obj.style.right.replace('px', '')) : 0;
var sample_w = sample.offsetWidth;
var realpos = (DRC == 'left') ? (rpos / sample_w)+1 : (rpos / sample_w);
var dist = (DRC == 'left') ? sample.offsetWidth * realpos : sample.offsetWidth * (realpos-1);
//if(DRC == 'left') blu (sample.offsetWidth + ' * ' + realpos + ' = ' + dist);
//if(DRC == 'right') blu (sample.offsetWidth + ' * ' + (realpos-1) + ' = ' + dist);
var limit = sample.offsetWidth * MAX_ITEMS;
var cpu = 10;
var objpos = (_obj.style.right) ? eval(_obj.style.right.replace('px', '')) : 0;
var itempos = (objpos/dist)+1;
var realpos_reset = 0;
//blu(itempos + ';' + MAX_ITEMS);
if(((realpos < MAX_ITEMS) && (DRC == 'left')) || ((realpos > 0 && DRC == 'right'))){
if(motion_sense == false){
move_object(_obj, DRC, dist, limit, speed, cpu);
switch(DRC){
case 'left': realpos++; break;
case 'right': realpos; break;
}
var current_listitem_object = document.getElementById('listitem' + (realpos));
listitem_highlite(current_listitem_object, MAX_ITEMS);
}
} else {
if(motion_sense == false){
realpos = (DRC == 'left') ? 0 : MAX_ITEMS;
dist = (DRC == 'left') ? sample.offsetWidth * realpos : sample.offsetWidth * (realpos-1);
move_object(_obj, DRC, dist, limit, speed, cpu);
realpos_reset = (DRC == 'left') ? 1 : MAX_ITEMS;
current_listitem_object = document.getElementById('listitem' + (realpos_reset));
listitem_highlite(current_listitem_object, MAX_ITEMS);
}
}
}
}
function slide_normal(SAMPLE_DST_OBJ, DRC, OBJ_ID, MAX_ITEMS, CUST_SPEED, step, section_name){
if(!SAMPLE_DST_OBJ) alert('SAMPLE_DST_OBJ');
if(!DRC) alert('DRC');
if(!OBJ_ID) alert('OBJ_ID');
if(!MAX_ITEMS) alert('MAX_ITEMS');
var _obj = document.getElementById(OBJ_ID);
var sample = document.getElementById(SAMPLE_DST_OBJ);
var steps = (step) ? step : 1;
webaudit_hit();
var rpos = (_obj.style.right) ? eval(_obj.style.right.replace('px', '')) : 0;
var sample_w = sample.offsetWidth;
var realpos = (DRC == 'left') ? (rpos / sample_w)+1 : (rpos / sample_w);
var dist = (DRC == 'left') ? sample.offsetWidth * realpos : sample.offsetWidth * (realpos-1);
//if(DRC == 'left') blu (sample.offsetWidth + ' * ' + realpos + ' = ' + dist);
//if(DRC == 'right') blu (sample.offsetWidth + ' * ' + (realpos-1) + ' = ' + dist);
//var dist = eval(sample.offsetWidth) * steps;
var objpos = (_obj.style.right) ? eval(_obj.style.right.replace('px', '')) : 0;
var itempos = realpos;
var speed = (CUST_SPEED) ? CUST_SPEED : 10;
if(client == 'ie'){
speed = speed;
}
var limit = sample.offsetWidth * Math.round(MAX_ITEMS);
var cpu = 5;
if(((realpos < MAX_ITEMS) && (DRC == 'left')) || ((realpos > 0 && DRC == 'right'))){
if(motion_sense == false){
move_object(_obj, DRC, dist, limit, speed, cpu);
var reverse_drc = (DRC == 'right') ? 'left' : 'right';
section_pos(section_name, reverse_drc);
//var current_listitem_object = document.getElementById('listitem' + item_pos);
//listitem_highlite(current_listitem_object, MAX_ITEMS);
}
} else {
if(motion_sense == 'd'){
realpos = (DRC == 'left') ? 0 : MAX_ITEMS;
dist = (DRC == 'left') ? sample.offsetWidth * realpos : sample.offsetWidth * (realpos-1);
move_object(_obj, DRC, dist, limit, speed, cpu);
realpos_reset = (DRC == 'left') ? 1 : MAX_ITEMS;
current_listitem_object = document.getElementById('listitem' + (realpos_reset));
listitem_highlite(current_listitem_object, MAX_ITEMS);
}
}
}
function autoslide(SAMPLE_DST_OBJ, POS, OBJ_ID, MAX_ITEMS){
var sample = document.getElementById(SAMPLE_DST_OBJ);
var DRC = (POS > item_pos) ? 'left' : 'right';
var dist = eval(sample.offsetWidth) * (POS-1);
var speed = 1; //sudden swap for big distances
//alert('POS:'+ POS + ' item_pos:' + item_pos + ' DRC:' + DRC + ' dist:' +dist + ' sense:' + motion_sense);
var _obj = document.getElementById(OBJ_ID);
var _limit_obj = document.getElementById('safeframe');
var limit = _limit_obj.offsetWidth * MAX_ITEMS;
_obj.style.width = limit + 'px';
var cpu = 10;
if(motion_sense == false){
move_object(_obj, DRC, dist, limit, speed, cpu);
item_pos = POS;
var current_listitem_object = document.getElementById('listitem' + item_pos);
listitem_highlite(current_listitem_object, MAX_ITEMS);
}
}
function autoslide(SAMPLE_DST_OBJ, POS, OBJ_ID, MAX_ITEMS){
var sample = document.getElementById(SAMPLE_DST_OBJ);
var DRC = (POS > item_pos) ? 'left' : 'right';
var dist = eval(sample.offsetWidth) * (POS-1);
var speed = 1; //sudden swap for big distances
//alert('POS:'+ POS + ' item_pos:' + item_pos + ' DRC:' + DRC + ' dist:' +dist + ' sense:' + motion_sense);
var _obj = document.getElementById(OBJ_ID);
var _limit_obj = document.getElementById('safeframe');
var limit = _limit_obj.offsetWidth * MAX_ITEMS;
_obj.style.width = limit + 'px';
var cpu = 10;
if(motion_sense == false){
move_object(_obj, DRC, dist, limit, speed, cpu);
item_pos = POS;
var current_listitem_object = document.getElementById('listitem' + item_pos);
listitem_highlite(current_listitem_object, MAX_ITEMS);
}
}
var global_runtime = null;
function timeout_autoslide(object, SAMPLE_DST_OBJ, POS, OBJ_ID, MAX_ITEMS){
var temp_style = object.style.backgroundColor;
if (POS != item_pos) object.style.backgroundColor = '#66768b';
if (global_runtime) window.clearInterval(global_runtime);
if (object.timeout_memory_flag) window.clearInterval(object.timeout_memory_flag);
var step = 0;
var length = 25;
object.timeout_memory_flag = window.setInterval(
function(){
// dummy ...
step++;
if(step>length){
window.clearInterval(object.timeout_memory_flag);
autoslide(SAMPLE_DST_OBJ, POS, OBJ_ID, MAX_ITEMS);
}
}, 10);
object.onmouseout = function(){
if(POS != item_pos) object.style.backgroundColor = temp_style;
window.clearInterval(object.timeout_memory_flag);
}
global_runtime = object.timeout_memory_flag;
}
function clear_search_value(obj){
if(obj.value == 'Keresés ...'){
obj.value = '';
}
}
function submit_now(obj){
// not now :-)
}
function post_content_filter_form(){
var obj = document.forms['content_filter'];
var keyword = (obj.elements[0].value.replace('Keresés ...')) ? obj.elements[0].value.replace('Keresés ...') : false;
var channel_id = (obj.elements[1].value) ? obj.elements[1].value : false;
var year_from = obj.elements[2].value;
var month_from = obj.elements[3].value;
var day_from = (obj.elements[4].value.length == 1) ? '0' + obj.elements[4].value : obj.elements[4].value;
var date_in = year_from + month_from + day_from + '000000';
var year_until = obj.elements[5].value;
var month_until = obj.elements[6].value;
var day_until = (obj.elements[7].value.length == 1) ? '0' + obj.elements[7].value : obj.elements[7].value;
var date_out = year_until + month_until + day_until + '245959';
search_galleries(keyword, channel_id, date_in, date_out);
}
function post_searchcontent_filter_form(){
var obj = document.forms['content_filter'];
var keyword = (obj.elements[0].value.replace('Keresés ...')) ? ((ie6) ? obj.elements[0].value.replace('Keresés ...') : unescape(obj.elements[0].value.replace('Keresés ...'))) : false;
var channel_id = (obj.elements[1].value) ? obj.elements[1].value : false;
var year_from = obj.elements[2].value;
var month_from = obj.elements[3].value;
var day_from = (obj.elements[4].value.length == 1) ? '0' + obj.elements[4].value : obj.elements[4].value;
var date_in = year_from + month_from + day_from + '000000';
var year_until = obj.elements[5].value;
var month_until = obj.elements[6].value;
var day_until = (obj.elements[7].value.length == 1) ? '0' + obj.elements[7].value : obj.elements[7].value;
var date_out = year_until + month_until + day_until + '245959';
search_articles(keyword, channel_id, date_in, date_out);
}
var flash_width = 1024;
var flash_height = 768;
function highlight_item(object, chex){
var obj = object;
var temp_color = obj.style.backgroundColor;
obj.style.backgroundColor = (chex) ? chex : '#edf0f4';
obj.onmouseout = function(){
obj.style.backgroundColor = temp_color;
}
}
function submit_form(obj, link){
obj.action = link;
}
function submit_a_vote(vote_id, answer_id){
register_a_vote(vote_id, answer_id);
}
var pDelay = 5000;
var pRotate = true;
var pMax = 5;
var pCurrent = Math.floor( Math.random() * pMax +1 );
function initPreviews() {
showbox(pCurrent);
rotatePreviews();
}
function rotatePreviews() {
if (pRotate == true) {
showbox(pCurrent);
if (pCurrent == pMax) { pCurrent = 1; } else { pCurrent++ }
setTimeout("rotatePreviews()", pDelay);
}
}
function showbox(pID) {
document.getElementById('box_' + pID).style.display = 'block';
document.getElementById('boxswitch_' + pID).className = 'switch-active';
for(i=1;i <= pMax; i++) {
if(i!=pID){
document.getElementById('box_' + i).style.display = 'none';
document.getElementById('boxswitch_' + i).className = 'switch-inactive';
}
}
}
function start_rtlbulvar_events(){
window.setTimeout("initPreviews()", 5000);
}
tMax = 2;
function switchtop(pID) {
document.getElementById('top5box_' + pID).style.visibility = 'visible';
document.getElementById('top_button_' + pID).className = 'active';
for(i=1;i <= tMax; i++) {
if(i!=pID){
document.getElementById('top5box_' + i).style.visibility = 'hidden';
document.getElementById('top_button_' + i).className = 'inactive';
}
}
}