'
}, {
display: 'none'
}, hs.container),
domCh = dom.childNodes,
div = domCh[0],
scrollUp = domCh[1],
scrollDown = domCh[2],
marker = domCh[3],
table = div.firstChild,
tbody = dom.getElementsByTagName(tree[1])[0],
tr;
for (var i = 0; i < group.length; i++) {
if (i == 0 || !isX) tr = hs.createElement(tree[2], null, null, tbody);
(function(){
var a = group[i],
cell = hs.createElement(tree[3], null, null, tr),
pI = i;
hs.createElement('a', {
href: a.href,
onclick: function() {
hs.getExpander(this).focus();
return hs.transit(a);
},
innerHTML: hs.stripItemFormatter ? hs.stripItemFormatter(a) : a.innerHTML
}, null, cell);
})();
}
if (!floatMode) {
scrollUp.onclick = function () { scroll(-1); };
scrollDown.onclick = function() { scroll(1); };
hs.addEventListener(tbody, document.onmousewheel !== undefined ?
'mousewheel' : 'DOMMouseScroll', function(e) {
var delta = 0;
e = e || window.event;
if (e.wheelDelta) {
delta = e.wheelDelta/120;
if (hs.opera) delta = -delta;
} else if (e.detail) {
delta = -e.detail/3;
}
if (delta) scroll(-delta * 0.2);
if (e.preventDefault) e.preventDefault();
e.returnValue = false;
});
}
return {
add: add,
selectThumb: selectThumb
}
};
hs.langDefaults = hs.lang;
// history
var HsExpander = hs.Expander;
if (hs.ie && window == window.top) {
(function () {
try {
document.documentElement.doScroll('left');
} catch (e) {
setTimeout(arguments.callee, 50);
return;
}
hs.ready();
})();
}
hs.addEventListener(document, 'DOMContentLoaded', hs.ready);
hs.addEventListener(window, 'load', hs.ready);
// set handlers
hs.addEventListener(document, 'ready', function() {
if (hs.expandCursor || hs.dimmingOpacity) {
var style = hs.createElement('style', { type: 'text/css' }, null,
document.getElementsByTagName('HEAD')[0]);
function addRule(sel, dec) {
if (!hs.ie) {
style.appendChild(document.createTextNode(sel + " {" + dec + "}"));
} else {
var last = document.styleSheets[document.styleSheets.length - 1];
if (typeof(last.addRule) == "object") last.addRule(sel, dec);
}
}
function fix(prop) {
return 'expression( ( ( ignoreMe = document.documentElement.'+ prop +
' ? document.documentElement.'+ prop +' : document.body.'+ prop +' ) ) + \'px\' );';
}
if (hs.expandCursor) addRule ('.highslide img',
'cursor: url('+ hs.graphicsDir + hs.expandCursor +'), pointer !important;');
addRule ('.highslide-viewport-size',
hs.ie && (hs.uaVersion < 7 || document.compatMode == 'BackCompat') ?
'position: absolute; '+
'left:'+ fix('scrollLeft') +
'top:'+ fix('scrollTop') +
'width:'+ fix('clientWidth') +
'height:'+ fix('clientHeight') :
'position: fixed; width: 100%; height: 100%; left: 0; top: 0');
}
});
hs.addEventListener(window, 'resize', function() {
hs.getPageSize();
if (hs.viewport) for (var i = 0; i < hs.viewport.childNodes.length; i++) {
var node = hs.viewport.childNodes[i],
exp = hs.getExpander(node);
exp.positionOverlay(node);
if (node.hsId == 'thumbstrip') exp.slideshow.thumbstrip.selectThumb();
}
});
hs.addEventListener(document, 'mousemove', function(e) {
hs.mouse = { x: e.clientX, y: e.clientY };
});
hs.addEventListener(document, 'mousedown', hs.mouseClickHandler);
hs.addEventListener(document, 'mouseup', hs.mouseClickHandler);
hs.addEventListener(document, 'ready', hs.setClickEvents);
hs.addEventListener(window, 'load', hs.preloadImages);
hs.addEventListener(window, 'load', hs.preloadAjax);
}
hs.graphicsDir = 'img/highslide/';
hs.outlineType = 'rounded-white';
function switch_to_tab(id,name,target) {
document.getElementById('rpc_tab_'+name+'_content').innerHTML = 'Moment...';
window.setTimeout("new Ajax.Updater('rpc_tab_"+name+"_content', '"+target+"')",500);
for (c = 0; document.getElementById('tab_'+name+'['+0+']'); c++) {
if (c == id) { document.getElementById('tab_'+name+'['+c+']').className='tab1'; }
else { document.getElementById('tab_'+name+'['+c+']').className='tab0'; }
document.getElementById('tab_'+name+'['+c+']').blur();
}
return false;
} function del_zipsearch() {
alert('jo');
switch_content('rpc_content','asd',1,'0','nav=0');
return false;
}
function switch_lang(lang) {
if (lang == 'de') { id = 'rpc_content'; rpc = 'home.de'; scrolltop = '1'; nav = 1; vars_and = '&nav=1'; }
if (lang == 'uk') { id = 'rpc_content'; rpc = 'home.uk'; scrolltop = '1'; nav = 48; vars_and = '&nav=48'; }
new Ajax.Updater('rpc_nav_basic', 'rpc/nav.basic.rpc.php?modus=rpc&target_rpc=rpc_nav_basic&rpc='+rpc+vars_and, { onComplete: function() {
new Ajax.Updater('rpc_content', 'rpc/general.rpc.php?modus=rpc&target_rpc=rpc_content&rpc='+rpc+vars_and, { onComplete: function() {
refresh_divs(id,rpc,nav,vars_and);
if (document.getElementById('rpc_login')) { new Ajax.Updater('rpc_login', 'rpc/login.rpc.php?modus=rpc&target_rpc=rpc_login&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Login
if (scrolltop) { eval(scrolltop); }
}});
}});
}
// ###########################################################################
// Funktion um eine AJAX-URL zu interpretieren
function check_ajaxurl() {
if (window.location.hash != "") {
var hashpart = window.location.hash;
var ajaxurl = '';
hashpart = hashpart.split("/");
for (c = 1; c < hashpart.length-1; c++) {
if (c > 1) {
if (c % 2 == 0) { ajaxurl = ajaxurl+'='; }
else { ajaxurl = ajaxurl+'&'; }
}
ajaxurl = ajaxurl+hashpart[c]; // ajax-url fuer funktion switch_content zusammenbauen
if (hashpart[c] == "nav") { var nav = hashpart[(c+1)]; } // wenn nav-variable, dann fuer funktion switch_content merken
if (hashpart[c] == "tpl") { var rpc = hashpart[(c+1)]; } // wenn tpl-variable, dann fuer funktion switch_content merken
}
var filterurl = ajaxurl.match(/tpl\=(.*?)\&/g); // tpl aus variablen-variable fuer switch_content filtern
ajaxurl = ajaxurl.replace(filterurl,'');
switch_content('rpc_content',rpc,1,nav,ajaxurl,'',''); // entsprechende seite aufrufen
}
}
// ###########################################################################
// Funktion um den Content-Bereich samt Navigationen zu tauschen / aktualisieren
var this_location = new Array();
function switch_content(id,rpc,scrolltop,nav,vars,anker,oncomplete) {
// Aktuelle Location merken fuer Reload-Shortcut
this_location['id'] = id;
this_location['rpc'] = rpc;
this_location['scrolltop'] = scrolltop;
this_location['nav'] = nav;
this_location['vars'] = vars;
this_location['anker'] = anker;
this_location['oncomplete'] = oncomplete;
// Leere Variablen als Standard
var vars_ask = '', vars_and = '';
// Wenn Variablen gegeben, dann URL-Zusatz erstellen
if (vars) { vars_ask = '?'+vars; vars_and = '&'+vars; }
//document.getElementById(id).style.filter = 'Gray()'; // Content-Bereich waehrend des Ladens Grau
//document.getElementById(id).style.filter = 'alpha(opacity=50)'; // Content-Bereich waehrend des Ladens Transparent
// Wartehinweis einblenden
//document.getElementById(id).innerHTML = '
Moment...
';
document.getElementById('loading').style.display = 'block';
document.getElementById('loading').style.visibility = 'visible';
// Wenn nach dem Laden nach oben gescrollt werden soll, dann hier definieren
if (scrolltop == 1) { scrolltop = 'window.scrollTo(0,0);'; } else { scrolltop = ''; }
// AJAX anschmeissen
new Ajax.Updater(id, 'rpc/general.rpc.php?modus=rpc&target_rpc='+id+'&rpc='+rpc+vars_and, { onComplete: function() { refresh_divs(id,rpc,nav,vars_and); if (scrolltop) { eval(scrolltop); } if (oncomplete) { eval(oncomplete); } if (anker) { document.location.href='#'+anker; } } });
// Browser-URL auf AJAX-Url aendern damit Adressbar-Links wieder funktionieren
// var ajaxurl = 'tpl='+rpc+vars_and; ajaxurl = ajaxurl.replace(/&/g,'/').replace(/=/g,'/'); document.location.href='./#?/'+ajaxurl+'/';
//document.getElementById(id).focus(); // Focus lenken
// Wenn Google Maps vorhanden, dann laden
if (document.getElementById('map')) { load(); }
// acp template-info-button
if (document.getElementById('apanel_tplinfo')) { document.getElementById('apanel_tplinfo').innerHTML = rpc+'.rpc.tpl'+(nav ? ' (ID: '+nav+')' : ''); }
// wenn debug-console offen
if (document.getElementById('debugconsole') && enable_debug_layer) { document.getElementById('debugconsole').src = 'php/debugconsole.php_error.php'; }
// Wenn Google Analytics vorhanden, dann AJAX-Aufruf mitteilen
if (typeof(pageTracker) == "object") { pageTracker._trackPageview("/"+rpc+","+nav+".html"); }
}
// ###########################################################################
// Funktion, um weitere Elemente automatisch mit zu tauschen
function refresh_divs(id,rpc,nav,vars_and) {
if (rpc == 'apo') { document.getElementById('ci_back').style.backgroundImage = 'none'; }
else if (document.getElementById('ci')) { document.getElementById('ci_back').style.backgroundImage = 'url('+document.getElementById('ci').innerHTML+')'; }
document.getElementById('ajax_locator').value = '1'; // AJAX-History aktivieren
document.getElementById('ajax_history').src = 'history,'+rpc+','+nav+'.html'; // Template an AJAX-History uebergeben
//if (document.getElementById('rpc_search')) { new Ajax.Updater('rpc_search', 'rpc/search.rpc.php?modus=rpc&target_rpc=rpc_search&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Suche
if (document.getElementById('rpc_nav_main')) { new Ajax.Updater('rpc_nav_main', 'rpc/nav.main.rpc.php?modus=rpc&target_rpc=rpc_nav_main&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Main) refreshen
if (document.getElementById('rpc_nav_basic')) { new Ajax.Updater('rpc_nav_basic', 'rpc/nav.basic.rpc.php?modus=rpc&target_rpc=rpc_nav_basic&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Basic) refreshen
if (document.getElementById('rpc_nav_top')) { new Ajax.Updater('rpc_nav_top', 'rpc/nav.top.rpc.php?modus=rpc&target_rpc=rpc_nav_top&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Right) refreshen
if (document.getElementById('rpc_nav_left')) { new Ajax.Updater('rpc_nav_left', 'rpc/nav.left.rpc.php?modus=rpc&target_rpc=rpc_nav_left&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Right) refreshen
if (document.getElementById('rpc_nav_right')) { new Ajax.Updater('rpc_nav_right', 'rpc/nav.right.rpc.php?modus=rpc&target_rpc=rpc_nav_right&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Right) refreshen
if (document.getElementById('rpc_nav_bottom')) { new Ajax.Updater('rpc_nav_bottom', 'rpc/nav.bottom.rpc.php?modus=rpc&target_rpc=rpc_nav_bottom&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Right) refreshen
if (document.getElementById('rpc_nav_path')) { new Ajax.Updater('rpc_nav_path', 'rpc/nav.path.rpc.php?modus=rpc&target_rpc=rpc_nav_path&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Pfad) refreshen
if (document.getElementById('rpc_teaser')) { new Ajax.Updater('rpc_teaser', 'rpc/teaser.rpc.php?modus=rpc&target_rpc=rpc_teaser&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Pfad) refreshen
if (document.getElementById('rpc_socialbookmarks')) { new Ajax.Updater('rpc_socialbookmarks', 'rpc/socialbookmarks.rpc.php?modus=rpc&target_rpc=rpc_socialbookmarks&rpc='+rpc+vars_and, { onComplete: function() { /* none */ } }); } // Navigation (Pfad) refreshen
google_adsense(); // Google adsense aufrufen
// Wenn im Template verwendet, ggf. Galleryscroller initialisieren
for (c = 0; document.getElementById('galleryscroller_'+c); c++) {
var pb = new poma.scrollbox('galleryscroller_'+c,{'ud':false,'usebuttons':false,'speed':10});
}
document.getElementById('this_tpl').innerHTML = rpc;
var skin = 'blue';
var force_skin = '';
var logo_base_top = '0px';
if (nav.substring(0,2) == 90) { var skin = 'green'; }
if (document.getElementById('this_tpl').innerHTML == 'home.de') {
//document.getElementById('fixed_top_blue_blind').style.display = 'none';
new Effect.Morph('fixed_bottom', { style: 'bottom: 0px', duration: 0.4 });
logo_base_top = '-30px';
if (skin == 'green') { new Effect.Morph('logo_green', { style: 'top: '+logo_base_top, duration: 0.3, delay: 0.1 }); }
else { new Effect.Morph('logo_blue', { style: 'top: '+logo_base_top, duration: 0.3, delay: 0.2 }); }
new Effect.Morph('searchbox', { style: 'top: 50px', duration: 0.2, delay: 0.2 });
new Effect.Morph('fixed_top_blue', { style: 'top: -40px', duration: 0.2, delay: 0.4 });
//new Effect.Morph('fixed_top_blue_blind', { style: 'top: -40px', duration: 0.2, delay: 0 });
new Effect.Morph('flexible_content', { style: 'top: 125px', duration: 0.2, delay: 0.6 });
//window.setTimeout("document.getElementById('fixed_top_blue_blind').style.display = 'block';",600);
force_skin = skin;
resize_content();
} else {
if (document.getElementById('fixed_bottom').style.bottom != '-120px') {
//document.getElementById('fixed_top_blue_blind').style.display = 'none';
new Effect.Morph('fixed_bottom', { style: 'bottom: -120px', duration: 0.4 });
logo_base_top = '0px';
new Effect.Morph('flexible_content', { style: 'top: 165px', duration: 0.2, delay: 0.1 });
new Effect.Morph('fixed_top_blue', { style: 'top: 0px', duration: 0.2, delay: 0.2 });
//new Effect.Morph('fixed_top_blue_blind', { style: 'top: 0px', duration: 0.2, delay: 0 });
if (skin == 'green') { new Effect.Morph('logo_green', { style: 'top: '+logo_base_top, duration: 0.3, delay: 0.4 }); }
else { new Effect.Morph('logo_blue', { style: 'top: '+logo_base_top, duration: 0.3, delay: 0.4 }); }
new Effect.Morph('searchbox', { style: 'top: 90px', duration: 0.2, delay: 0.7 });
//window.setTimeout("document.getElementById('fixed_top_blue_blind').style.display = 'block';",400);
force_skin = skin;
resize_content();
}
}
// Wechsel aufs gruene Design
if (skin == 'green' || force_skin == 'green') {
new Effect.Morph('logo_blue', { style: 'top: -146px', duration: 0.3, afterFinish: function() {
new Effect.Morph('fixed_top_gray', { style: 'top: 0px', duration: 0.5, delay: 0.2 });
new Effect.Morph('logo_green', { style: 'top: '+logo_base_top, duration: 0.6, delay: 0.6 });
new Effect.Morph('searchbox', { style: 'background: #579f56', duration: 0.6, delay: 0.6 });
new Effect.Morph('rpc_nav_main', { style: 'margin-left: -'+(Math.round((viewportwidth()/2))+200)+'px', duration: 0.5, afterFinish: function() {
document.getElementById('nav_main_col').className = 'nav_main_green';
document.getElementById('nav_basic_col').className = 'nav_basic_green';
document.getElementById('content_col').className = 'content_green';
new Effect.Morph('rpc_nav_main', { style: 'margin-left: -470px', duration: 0.5 });
} });
} });
// Wechsel aufs blaue Design
} else if (document.getElementById('fixed_top_gray').style.top == '0px') {
new Effect.Morph('logo_green', { style: 'top: -146px', duration: 0.3, afterFinish: function() {
new Effect.Morph('fixed_top_gray', { style: 'top: -171px', duration: 0.3, delay: 0.1 });
new Effect.Morph('logo_blue', { style: 'top: '+logo_base_top, duration: 0.6, delay: 0.6 });
new Effect.Morph('searchbox', { style: 'background: #2b69a9', duration: 0.6, delay: 0.6 });
new Effect.Morph('rpc_nav_main', { style: 'margin-left: -'+(Math.round((viewportwidth()/2))+200)+'px', duration: 0.5, afterFinish: function() {
document.getElementById('nav_main_col').className = 'nav_main_blue';
document.getElementById('nav_basic_col').className = 'nav_basic_blue';
document.getElementById('content_col').className = 'content_blue';
new Effect.Morph('rpc_nav_main', { style: 'margin-left: -470px', duration: 0.5 });
} });
} });
}
// Wenn Google-Plus aufrufen
renderPlusone();
// Wartehinweis ausblenden
document.getElementById('loading').style.display = 'none';
document.getElementById('loading').style.visibility = 'hidden';
}
// ###########################################################################
// Google-Plus bei ajax-klick refreshen
function renderPlusone() {
// Wenn Google-Plus verwendet wird (div vorhanden?)
if (document.getElementById('plusone-div')) {
gapi.plusone.render("plusone-div", {"size": "small", "count": "true"});
}
}
// ###########################################################################
// Google-Adsense bei ajax-klick refreshen
function google_adsense() {
/*
document.getElementById('google_adsense_1').innerHTML='';
domWrite(
"google_adsense_1",
"http://pagead2.googlesyndication.com/pagead/show_ads.js",
function() {
google_ad_client = "pub-0000000000000000";
google_ad_slot = "0000000000";
google_ad_width = 160;
google_ad_height = 600;
}
);
*/
}
// ###########################################################################
// Twitter-div
function twitter_updater() {
if (document.getElementById('rpc_twitter')) { twitter_updater_upd(); }
else { window.clearInterval(twitter_interval); }
}
function twitter_updater_init() {
if (document.getElementById('rpc_twitter')) {
twitter_updater_upd();
//var twitter_interval = window.setInterval("twitter_updater()", 60000); // 60 sekunden
var twitter_interval = window.setInterval("twitter_updater()", 3600000); // 1 stunde
}
}
function twitter_updater_upd() {
new Ajax.Updater('rpc_twitter', 'rpc/general.rpc.php?modus=rpc&rpc=twitter');
}
// ###########################################################################
// Graypage-Layer
document.write("");
function graypage() {
document.getElementById('graypage').style.height = document.body.scrollHeight;
document.getElementById('graypage').style.width = document.body.scrollWidth;
document.getElementById('graypage').style.display = 'block';
document.getElementById('graypage').style.visibility = 'visible';
}
function clearpage() {
document.getElementById('graypage').style.height = '0px';
document.getElementById('graypage').style.width = '0px';
document.getElementById('graypage').style.display = 'none';
document.getElementById('graypage').style.visibility = 'hidden';
}
document.write("
");
// ###########################################################################
// Ajax-Shortcuts
var chr = new Array;
function key_press(Ereignis) {
if (!Ereignis) { Ereignis = window.event; }
if (Ereignis.which) { keycode = Ereignis.which; }
else if (Ereignis.keyCode) { keycode = Ereignis.keyCode; }
chr[keycode] = 1;
if (chr[17] == 1 && chr[220] == 1) { graypage() } // zirkumflex
if (chr[87] == 1 && chr[65] == 1) /* w+a */ { window.location.href = './acp/'; chr = new Array; }
if (chr[87] == 1 && chr[68] == 1) /* w+d */ { switch_debug_layer(); }
if (chr[87] == 1 && chr[73] == 1) /* w+i */ { window.location.href = './image.php'; chr = new Array; }
if (chr[87] == 1 && chr[79] == 1) /* w+o */ { window.location.href = document.getElementById('apanel_onlineurl').innerHTML; chr = new Array; }
if (chr[87] == 1 && chr[81] == 1) /* w+q */ { window.location.href = './qrcode.php'; chr = new Array; }
if (chr[87] == 1 && chr[82] == 1 && this_location['id']) /* w+r */ { switch_content(this_location['id'],this_location['rpc'],this_location['scrolltop'],this_location['nav'],this_location['vars'],this_location['anker'],this_location['oncomplete']); chr = new Array; } // r
if (chr[87] == 1 && chr[86] == 1) /* w+v */ { window.location.href = './m/'; chr = new Array; }
//document.getElementById('keycodetext').value = keycode + '';
//alert('Taste mit Dezimalwert ' + keycode + ' gedrueckt');
}
function key_release(Ereignis) {
if (!Ereignis) { Ereignis = window.event; }
if (Ereignis.which) { keycode = Ereignis.which; }
else if (Ereignis.keyCode) { keycode = Ereignis.keyCode; }
chr[keycode] = 0;
if (keycode == 27) { chr[17] = 0; clearpage(); } // esc
//document.getElementById('keycodetext').value = keycode + '';
//alert('Taste mit Dezimalwert ' + keycode + ' losgelassen');
}
document.onkeydown = key_press;
document.onkeyup = key_release;
// ###########################################################################
// Viewports
function viewportwidth() {
var viewportwidth;
// Die meisten Standard-Bowser (mozilla/netscape/opera/ie7) verwenden window.innerWidth
if (typeof window.innerWidth != 'undefined') { viewportwidth = window.innerWidth; }
// IE6
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientWidth != 'undefined' && document.documentElement.clientWidth != 0) { viewportwidth = document.documentElement.clientWidth; }
// Aeltere IE-Versionen
else { viewportwidth = document.getElementsByTagName('body')[0].clientWidth; }
return viewportwidth;
}
function viewportheight() {
var viewportheight;
// Die meisten Standard-Bowser (mozilla/netscape/opera/ie7) verwenden window.innerHeight
if (typeof window.innerHeight != 'undefined') { viewportheight = window.innerHeight; }
// IE6
else if (typeof document.documentElement != 'undefined' && typeof document.documentElement.clientHeight != 'undefined' && document.documentElement.clientHeight != 0) { viewportheight = document.documentElement.clientHeight; }
// Aeltere IE-Versionen
else { viewportheight = document.getElementsByTagName('body')[0].clientHeight; }
return viewportheight;
}
// ###########################################################################
// Scrollbars
function getscrollwidth() {
var scrOfX = 0;
if (typeof(window.pageXOffset ) == 'number' ) {
// Netscape
scrOfX = window.pageXOffset;
} else if (document.body && ( document.body.scrollLeft || document.body.scrollTop )) {
// DOM
scrOfX = document.body.scrollTop;
} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop )) {
// IE6 standards compliant mode
scrOfX = document.documentElement.scrollTop;
}
return scrOfX;
}
function getscrollheight() {
var scrOfY = 0;
if (typeof(window.pageYOffset ) == 'number' ) {
// Netscape
scrOfY = window.pageYOffset;
} else if (document.body && ( document.body.scrollLeft || document.body.scrollTop )) {
// DOM
scrOfY = document.body.scrollTop;
} else if (document.documentElement && (document.documentElement.scrollLeft || document.documentElement.scrollTop )) {
// IE6 standards compliant mode
scrOfY = document.documentElement.scrollTop;
}
return scrOfY;
}
// ###########################################################################
// Mousemoves
var mousemove_docEl = (typeof document.compatMode != "undefined" && document.compatMode != "BackCompat") ? "documentElement" : "body";
function mouse_init() {
if (document.layers) { document.captureEvents(Event.MOUSEMOVE); }
document.onmousemove = mouse_pos;
}
function mouse_pos(e) {
// position where mousemove fired
var xPos = e? e.pageX : window.event.x;
var yPos = e? e.pageY : window.event.y;
// for ie add scroll position
if (document.all && !document.captureEvents) {
xPos += document[mousemove_docEl].scrollLeft;
yPos += document[mousemove_docEl].scrollTop;
}
if (xPos >= viewportwidth()-170 && yPos <= 300 && document.getElementById('apanel') && document.getElementById('apanel').style.display == 'none') { Effect.toggle('apanel', 'slide', { duration: 0.5 }); }
if ((xPos <= viewportwidth()-170 || yPos >= 300) && document.getElementById('apanel') && document.getElementById('apanel').style.display != 'none') { Effect.toggle('apanel', 'slide', { duration: 0.5 }); }
if (document.layers) routeEvent(e);
}
// ###########################################################################
// Debug-Layer
var enable_debug_layer = 0;
function switch_debug_layer() {
if (enable_debug_layer == 0) {
enable_debug_layer = 1;
document.getElementById('debugconsole').style.top = viewportheight()+getscrollheight()-150;
Effect.Appear('debugconsole', { duration: 0.5 });
document.getElementById('debugconsole').src = 'php/debugconsole.php_error.php';
} else {
enable_debug_layer = 0;
Effect.Fade('debugconsole', { duration: 0.5 });
// document.getElementById('debugconsole').src = 'about:blank';
}
}
// ###########################################################################
// Window-Scrolls
var unscroll = 0;
var unscroll_interval;
function clear_unscroll() {
if (unscroll == 1) {
if (document.getElementById('debugconsole') && enable_debug_layer) {
//document.getElementById('debugconsole').style.display = 'block';
document.getElementById('debugconsole').style.top = viewportheight()+getscrollheight()-150;
Effect.Appear('debugconsole', { duration: 0.5 });
}
unscroll = 0;
}
}
function win_scroll() {
if (document.getElementById('debugconsole') && enable_debug_layer) {
document.getElementById('debugconsole').style.display = 'none';
// document.getElementById('debugconsole').src = 'about:blank';
//Effect.Fade('debugconsole', { duration: 0.05 });
unscroll = 1;
window.clearInterval(unscroll_interval);
unscroll_interval = window.setInterval("clear_unscroll()", 200);
}
}
window.onscroll = win_scroll;
// ###########################################################################
// Resize Content
function resize_content() {
if (document.getElementById('this_tpl').innerHTML == 'home.de') { home_height = 125; } else { home_height = 165; }
if (document.getElementById('this_tpl').innerHTML == 'home.de') { bottom_height = 115; } else { bottom_height = 0; }
document.getElementById('flexible_content').style.height = ((viewportheight()-bottom_height)-home_height)+'px';
document.getElementById('ci_back').style.top = '30px';
document.getElementById('ci_back').style.height = (viewportheight()-30)+'px';
document.getElementsByTagName('body')[0].style.overflow = 'hidden';
}
// ###########################################################################
// init
function init() {
//check_ajaxurl();
//twitter_updater_init();
document.onload = mouse_init();
}
document.onload = init(); var login_afterrequest = false;
var login_template = 'login';
var login_lang = 'de' // default
var login_nav_id = new Array();
login_nav_id['de'] = 1;
login_nav_id['uk'] = 48;
var http_request = false;
var http_target = false;
var http_fields = false;
var http_url = '';
function makePOSTRequest(url, parameters) {
http_url = url;
http_request = false;
if (window.XMLHttpRequest) { // Mozilla, Safari,...
http_request = new XMLHttpRequest();
if (http_request.overrideMimeType) {
// set type accordingly to anticipated content type
//http_request.overrideMimeType('text/xml');
http_request.overrideMimeType('text/html');
}
} else if (window.ActiveXObject) { // IE
try {
http_request = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
http_request = new ActiveXObject("Microsoft.XMLHTTP");
} catch (e) {}
}
}
if (!http_request) {
alert('Fehler: Kann keine XMLHTTP-Instanz erstellen.');
return false;
}
http_request.onreadystatechange = alertContents;
http_request.open('POST', url, true);
http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
http_request.setRequestHeader("Content-length", parameters.length);
http_request.setRequestHeader("Connection", "close");
http_request.send(parameters);
}
function alertContents() {
if (http_request.readyState == 4) {
if (http_request.status == 200) {
//alert(http_request.responseText);
result = http_request.responseText;
//document.getElementById('myspan').innerHTML = result;
document.getElementById(http_target).innerHTML = result;
// wenn es sich um das loginform handelt
if (login_afterrequest) {
switch_content('rpc_content',login_template,1,login_nav_id[login_lang],'nav='+login_nav_id[login_lang]);
login_afterrequest = false;
}
} else {
alert('Fehler: Die Anfrage konnte nicht gesendet werden.\nHTTP '+http_request.status+' ('+http_url+' > '+http_target+')');
}
}
}
function get(target,file,fields,form) {
http_target = target
http_fields = fields
http_fields = http_fields.split(",")
poststr = ""
poststr = poststr+'submitfields='+fields+'&'
for (c = 0; c < http_fields.length; c++) {
if (c > 0) { poststr = poststr+'&' }
if (document.forms[form].elements[http_fields[c]]) {
if (document.forms[form].elements[http_fields[c]].type == 'radio' && document.forms[form].elements[http_fields[c]].checked) {
poststr = poststr+document.forms[form].elements[http_fields[c]].name+'='+encodeURI(document.forms[form].elements[http_fields[c]].value); // +'&'
}
else if (document.forms[form].elements[http_fields[c]].type == 'checkbox' && document.forms[form].elements[http_fields[c]].checked == true) {
//alert(document.getElementById(http_fields[c]).name);
// && document.getElementById(http_fields[c]).checked == true
poststr = poststr+document.forms[form].elements[http_fields[c]].name+'='+encodeURI(document.forms[form].elements[http_fields[c]].value);
}
else {
//poststr = poststr+http_fields[c]+'='+encodeURI(document.getElementById(http_fields[c]).value);
poststr = poststr+http_fields[c]+'='+encodeURI(document.forms[form].elements[http_fields[c]].value);
if (document.forms[form].elements[http_fields[c]].name == "action" && document.forms[form].elements[http_fields[c]].value == "login") {
login_afterrequest = true;
}
if (document.forms[form].elements[http_fields[c]].name == "lang") {
login_lang = document.forms[form].elements[http_fields[c]].value;
}
}
} else {
//alert('Can\'t access field '+http_fields[c]);
}
}
makePOSTRequest(file, poststr);
//alert(poststr);
}
// Spezielle Formfeld-Effekte (Cursor auf/ab, Mausrad auf/ab, etc.)
function form_wheel(element) {
// Wenn Mausrad-Auf UND Wert ist eine Zahl
if (event.wheelDelta >= 0 && !isNaN(element.value)) {
num = element.value; if (element.value != '') { num++; element.value = num; }
}
// Wenn Mausrad-Ab UND Wert ist eine Zahl
else if (event.wheelDelta <= 1 && !isNaN(element.value)) {
num = element.value; if (element.value != '') { num--; element.value = num; }
}
}
// Funktion um Stadtname durch PLZ zu ermitteln
function form_zip_name(zip,cc) {
// Wenn Wert ist eine Zahl und Wert ist 4 oder 5 Zeichen lang
if (!isNaN(zip) && zip.length >= 4 && zip.length <= 5) {
// ZIP-RPC abfragen und Antowrt in das Feld "ort" setzten, sofern Feld existiert
var req = new Ajax.Request('rpc/zip.rpc.php',
{
parameters: 'modus=rpc&zip_name='+zip+'&zip_cc='+cc,
method: 'get',
asynchronous: false,
onSuccess: function (request) { if (document.getElementById('ort')) { document.getElementById('ort').value = request.responseText; } }
});
}
}
// Spezielle Formfeld-Effekte (Cursor auf/ab, Mausrad auf/ab, etc.)
function form_key(element,event) {
if (!event) { event = window.event; }
if (event.which) { Tastencode = event.which; }
else if (event.keyCode) { keycode = event.keyCode; }
// Wenn Pfeil-Auf-Taste UND Wert ist eine Zahl
if ((keycode == 38) && !isNaN(element.value)) {
num = element.value; if (element.value != '') { num++; element.value = num; }
}
// Wenn Pfeil-Ab-Taste UND Wert ist eine Zahl
if ((keycode == 40) && !isNaN(element.value)) {
num = element.value; if (element.value != '') { num--; element.value = num; }
}
// Testausgabe des Dezimalwertes, der Taste
//window.status = 'Taste mit Dezimalwert ' + keycode + ' gedrueckt';
}
/* KALENDER ############################################################### */
//****************************************************************************
// PopCalendar 3.30, Emailware(please mail&commend me if u like it)
// Originally coded by Liming(Victor) Weng, email: victorwon@netease.com
// Release date: 2000.3.7
// Anyone may modify it to satify his needs, but please leave this comment ahead.
//****************************************************************************
var gdCtrl = new Object();
var goSelectTag = new Array();
var gcGray = "#808080";
var gcToggle = "#ffff00";
var gcBG = "#cccccc";
var gdCurDate = new Date();
var giYear = gdCurDate.getFullYear();
var giMonth = gdCurDate.getMonth()+1;
var giDay = gdCurDate.getDate();
function fSetDate(iYear, iMonth, iDay){
VicPopCal.style.visibility = "hidden";
gdCtrl.value = iDay+"."+iMonth+"."+iYear; //Here, you could modify the locale as you need !!!!
for (i in goSelectTag)
if (goSelectTag[i].style) { goSelectTag[i].style.visibility = "visible"; }
if (goSelectTag) { goSelectTag.length = 0; }
}
function fSetSelected(aCell){
var iOffset = 0;
var iYear = parseInt(tbSelYear.value);
var iMonth = parseInt(tbSelMonth.value);
self.event.cancelBubble = true;
aCell.bgColor = gcBG;
with (aCell.children["cellText"]) {
var iDay = parseInt(innerText);
if (color==gcGray)
iOffset = (Victor<10)?-1:1;
iMonth += iOffset;
if (iMonth<1) {
iYear--;
iMonth = 12;
}else if (iMonth>12){
iYear++;
iMonth = 1;
}
}
fSetDate(iYear, iMonth, iDay);
}
function Point(iX, iY){
this.x = iX;
this.y = iY;
}
function fBuildCal(iYear, iMonth) {
var aMonth=new Array();
for(i=1;i<7;i++)
aMonth[i]=new Array(i);
var dCalDate=new Date(iYear, iMonth-1, 1);
var iDayOfFirst=dCalDate.getDay();
var iDaysInMonth=new Date(iYear, iMonth, 0).getDate();
var iOffsetLast=new Date(iYear, iMonth-1, 0).getDate()-iDayOfFirst+1;
var iDate = 1;
var iNext = 1;
for (d = 0; d < 7; d++)
aMonth[1][d] = (d" + WeekDay[i] + "");
write("
" + WeekDay[i] + "
");
write("");
for (w = 1; w < 7; w++) {
write("
");
for (d = 0; d < 7; d++) {
//write("
");
write("
");
write(" ");
write("
")
}
write("
");
}
}
}
function fUpdateCal(iYear, iMonth) {
myMonth = fBuildCal(iYear, iMonth);
var i = 0;
for (w = 0; w < 6; w++)
for (d = 0; d < 7; d++)
with (cellText[(7*w)+d]) {
Victor = i++;
if (myMonth[w+1][d]<0) {
color = gcGray;
innerText = -myMonth[w+1][d];
} else {
color = ((d==0)||(d==6))?"red":"black";
innerText = myMonth[w+1][d];
}
}
}
function fSetYearMon(iYear, iMon){
tbSelMonth.options[iMon-1].selected = true;
for (i = 0; i < tbSelYear.length; i++)
if (tbSelYear.options[i].value == iYear)
tbSelYear.options[i].selected = true;
fUpdateCal(iYear, iMon);
}
function fPrevMonth(){
var iMon = tbSelMonth.value;
var iYear = tbSelYear.value;
if (--iMon<1) {
iMon = 12;
iYear--;
}
fSetYearMon(iYear, iMon);
}
function fNextMonth(){
var iMon = tbSelMonth.value;
var iYear = tbSelYear.value;
if (++iMon>12) {
iMon = 1;
iYear++;
}
fSetYearMon(iYear, iMon);
}
function fToggleTags(){
with (document.all.tags("SELECT")){
for (i=0; ir)||(ptLT.x+aTag.offsetWidthb)||(ptLT.y+aTag.offsetHeight
function fPopCalendar(popCtrl, dateCtrl){
gdCtrl = dateCtrl;
fSetYearMon(giYear, giMonth);
var point = fGetXY(popCtrl);
with (VicPopCal.style) {
left = point.x;
top = point.y+popCtrl.offsetHeight+1;
width = VicPopCal.offsetWidth;
height = VicPopCal.offsetHeight;
fToggleTags(point);
visibility = 'visible';
}
VicPopCal.focus();
}
function fHideCal(){
var oE = window.event;
if ((oE.clientX>0)&&(oE.clientY>0)&&(oE.clientX");
write("
");
write("");
*/
}
// End -- Coded by Liming Weng, email: victorwon@netease.com -->
/*! SWFObject v2.1
Copyright (c) 2007-2008 Geoff Stearns, Michael Williams, and Bobby van der Sluis
This software is released under the MIT License
*/
var swfobject = function() {
var UNDEF = "undefined",
OBJECT = "object",
SHOCKWAVE_FLASH = "Shockwave Flash",
SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
FLASH_MIME_TYPE = "application/x-shockwave-flash",
EXPRESS_INSTALL_ID = "SWFObjectExprInst",
win = window,
doc = document,
nav = navigator,
domLoadFnArr = [],
regObjArr = [],
objIdArr = [],
listenersArr = [],
script,
timer = null,
storedAltContent = null,
storedAltContentId = null,
isDomLoaded = false,
isExpressInstallActive = false;
/* Centralized function for browser feature detection
- Proprietary feature detection (conditional compiling) is used to detect Internet Explorer's features
- User agent string detection is only used when no alternative is possible
- Is executed directly for optimal performance
*/
var ua = function() {
var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
playerVersion = [0,0,0],
d = null;
if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
d = nav.plugins[SHOCKWAVE_FLASH].description;
if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
playerVersion[2] = /r/.test(d) ? parseInt(d.replace(/^.*r(.*)$/, "$1"), 10) : 0;
}
}
else if (typeof win.ActiveXObject != UNDEF) {
var a = null, fp6Crash = false;
try {
a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".7");
}
catch(e) {
try {
a = new ActiveXObject(SHOCKWAVE_FLASH_AX + ".6");
playerVersion = [6,0,21];
a.AllowScriptAccess = "always"; // Introduced in fp6.0.47
}
catch(e) {
if (playerVersion[0] == 6) {
fp6Crash = true;
}
}
if (!fp6Crash) {
try {
a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
}
catch(e) {}
}
}
if (!fp6Crash && a) { // a will return null when ActiveX is disabled
try {
d = a.GetVariable("$version"); // Will crash fp6.0.21/23/29
if (d) {
d = d.split(" ")[1].split(",");
playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
}
}
catch(e) {}
}
}
var u = nav.userAgent.toLowerCase(),
p = nav.platform.toLowerCase(),
webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
ie = false,
windows = p ? /win/.test(p) : /win/.test(u),
mac = p ? /mac/.test(p) : /mac/.test(u);
/*@cc_on
ie = true;
@if (@_win32)
windows = true;
@elif (@_mac)
mac = true;
@end
@*/
return { w3cdom:w3cdom, pv:playerVersion, webkit:webkit, ie:ie, win:windows, mac:mac };
}();
/* Cross-browser onDomLoad
- Based on Dean Edwards' solution: http://dean.edwards.name/weblog/2006/06/again/
- Will fire an event as soon as the DOM of a page is loaded (supported by Gecko based browsers - like Firefox -, IE, Opera9+, Safari)
*/
var onDomLoad = function() {
if (!ua.w3cdom) {
return;
}
addDomLoadEvent(main);
if (ua.ie && ua.win) {
try { // Avoid a possible Operation Aborted error
doc.write(""); // String is split into pieces to avoid Norton AV to add code that can cause errors
script = getElementById("__ie_ondomload");
if (script) {
addListener(script, "onreadystatechange", checkReadyState);
}
}
catch(e) {}
}
if (ua.webkit && typeof doc.readyState != UNDEF) {
timer = setInterval(function() { if (/loaded|complete/.test(doc.readyState)) { callDomLoadFunctions(); }}, 10);
}
if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, null);
}
addLoadEvent(callDomLoadFunctions);
}();
function checkReadyState() {
if (script.readyState == "complete") {
script.parentNode.removeChild(script);
callDomLoadFunctions();
}
}
function callDomLoadFunctions() {
if (isDomLoaded) {
return;
}
if (ua.ie && ua.win) { // Test if we can really add elements to the DOM; we don't want to fire it too early
var s = createElement("span");
try { // Avoid a possible Operation Aborted error
var t = doc.getElementsByTagName("body")[0].appendChild(s);
t.parentNode.removeChild(t);
}
catch (e) {
return;
}
}
isDomLoaded = true;
if (timer) {
clearInterval(timer);
timer = null;
}
var dl = domLoadFnArr.length;
for (var i = 0; i < dl; i++) {
domLoadFnArr[i]();
}
}
function addDomLoadEvent(fn) {
if (isDomLoaded) {
fn();
}
else {
domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
}
}
/* Cross-browser onload
- Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- Will fire an event as soon as a web page including all of its assets are loaded
*/
function addLoadEvent(fn) {
if (typeof win.addEventListener != UNDEF) {
win.addEventListener("load", fn, false);
}
else if (typeof doc.addEventListener != UNDEF) {
doc.addEventListener("load", fn, false);
}
else if (typeof win.attachEvent != UNDEF) {
addListener(win, "onload", fn);
}
else if (typeof win.onload == "function") {
var fnOld = win.onload;
win.onload = function() {
fnOld();
fn();
};
}
else {
win.onload = fn;
}
}
/* Main function
- Will preferably execute onDomLoad, otherwise onload (as a fallback)
*/
function main() { // Static publishing only
var rl = regObjArr.length;
for (var i = 0; i < rl; i++) { // For each registered object element
var id = regObjArr[i].id;
if (ua.pv[0] > 0) {
var obj = getElementById(id);
if (obj) {
regObjArr[i].width = obj.getAttribute("width") ? obj.getAttribute("width") : "0";
regObjArr[i].height = obj.getAttribute("height") ? obj.getAttribute("height") : "0";
if (hasPlayerVersion(regObjArr[i].swfVersion)) { // Flash plug-in version >= Flash content version: Houston, we have a match!
if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements
fixParams(obj);
}
setVisibility(id, true);
}
else if (regObjArr[i].expressInstall && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) { // Show the Adobe Express Install dialog if set by the web page author and if supported (fp6.0.65+ on Win/Mac OS only)
showExpressInstall(regObjArr[i]);
}
else { // Flash plug-in and Flash content version mismatch: display alternative content instead of Flash content
displayAltContent(obj);
}
}
}
else { // If no fp is installed, we let the object element do its job (show alternative content)
setVisibility(id, true);
}
}
}
/* Fix nested param elements, which are ignored by older webkit engines
- This includes Safari up to and including version 1.2.2 on Mac OS 10.3
- Fall back to the proprietary embed element
*/
function fixParams(obj) {
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
if (nestedObj) {
var e = createElement("embed"), a = nestedObj.attributes;
if (a) {
var al = a.length;
for (var i = 0; i < al; i++) {
if (a[i].nodeName == "DATA") {
e.setAttribute("src", a[i].nodeValue);
}
else {
e.setAttribute(a[i].nodeName, a[i].nodeValue);
}
}
}
var c = nestedObj.childNodes;
if (c) {
var cl = c.length;
for (var j = 0; j < cl; j++) {
if (c[j].nodeType == 1 && c[j].nodeName == "PARAM") {
e.setAttribute(c[j].getAttribute("name"), c[j].getAttribute("value"));
}
}
}
obj.parentNode.replaceChild(e, obj);
}
}
/* Show the Adobe Express Install dialog
- Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
*/
function showExpressInstall(regObj) {
isExpressInstallActive = true;
var obj = getElementById(regObj.id);
if (obj) {
if (regObj.altContentId) {
var ac = getElementById(regObj.altContentId);
if (ac) {
storedAltContent = ac;
storedAltContentId = regObj.altContentId;
}
}
else {
storedAltContent = abstractAltContent(obj);
}
if (!(/%$/.test(regObj.width)) && parseInt(regObj.width, 10) < 310) {
regObj.width = "310";
}
if (!(/%$/.test(regObj.height)) && parseInt(regObj.height, 10) < 137) {
regObj.height = "137";
}
doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
dt = doc.title,
fv = "MMredirectURL=" + win.location + "&MMplayerType=" + pt + "&MMdoctitle=" + dt,
replaceId = regObj.id;
// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
if (ua.ie && ua.win && obj.readyState != 4) {
var newObj = createElement("div");
replaceId += "SWFObjectNew";
newObj.setAttribute("id", replaceId);
obj.parentNode.insertBefore(newObj, obj); // Insert placeholder div that will be replaced by the object element that loads expressinstall.swf
obj.style.display = "none";
var fn = function() {
obj.parentNode.removeChild(obj);
};
addListener(win, "onload", fn);
}
createSWF({ data:regObj.expressInstall, id:EXPRESS_INSTALL_ID, width:regObj.width, height:regObj.height }, { flashvars:fv }, replaceId);
}
}
/* Functions to abstract and display alternative content
*/
function displayAltContent(obj) {
if (ua.ie && ua.win && obj.readyState != 4) {
// For IE when a SWF is loading (AND: not available in cache) wait for the onload event to fire to remove the original object element
// In IE you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
var el = createElement("div");
obj.parentNode.insertBefore(el, obj); // Insert placeholder div that will be replaced by the alternative content
el.parentNode.replaceChild(abstractAltContent(obj), el);
obj.style.display = "none";
var fn = function() {
obj.parentNode.removeChild(obj);
};
addListener(win, "onload", fn);
}
else {
obj.parentNode.replaceChild(abstractAltContent(obj), obj);
}
}
function abstractAltContent(obj) {
var ac = createElement("div");
if (ua.win && ua.ie) {
ac.innerHTML = obj.innerHTML;
}
else {
var nestedObj = obj.getElementsByTagName(OBJECT)[0];
if (nestedObj) {
var c = nestedObj.childNodes;
if (c) {
var cl = c.length;
for (var i = 0; i < cl; i++) {
if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
ac.appendChild(c[i].cloneNode(true));
}
}
}
}
}
return ac;
}
/* Cross-browser dynamic SWF creation
*/
function createSWF(attObj, parObj, id) {
var r, el = getElementById(id);
if (el) {
if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
attObj.id = id;
}
if (ua.ie && ua.win) { // IE, the object element and W3C DOM methods do not combine: fall back to outerHTML
var att = "";
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries, like Object.prototype.toJSONString = function() {}
if (i.toLowerCase() == "data") {
parObj.movie = attObj[i];
}
else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
att += ' class="' + attObj[i] + '"';
}
else if (i.toLowerCase() != "classid") {
att += ' ' + i + '="' + attObj[i] + '"';
}
}
}
var par = "";
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
par += '';
}
}
el.outerHTML = '';
objIdArr[objIdArr.length] = attObj.id; // Stored to fix object 'leaks' on unload (dynamic publishing only)
r = getElementById(attObj.id);
}
else if (ua.webkit && ua.webkit < 312) { // Older webkit engines ignore the object element's nested param elements: fall back to the proprietary embed element
var e = createElement("embed");
e.setAttribute("type", FLASH_MIME_TYPE);
for (var k in attObj) {
if (attObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
if (k.toLowerCase() == "data") {
e.setAttribute("src", attObj[k]);
}
else if (k.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
e.setAttribute("class", attObj[k]);
}
else if (k.toLowerCase() != "classid") { // Filter out IE specific attribute
e.setAttribute(k, attObj[k]);
}
}
}
for (var l in parObj) {
if (parObj[l] != Object.prototype[l]) { // Filter out prototype additions from other potential libraries
if (l.toLowerCase() != "movie") { // Filter out IE specific param element
e.setAttribute(l, parObj[l]);
}
}
}
el.parentNode.replaceChild(e, el);
r = e;
}
else { // Well-behaving browsers
var o = createElement(OBJECT);
o.setAttribute("type", FLASH_MIME_TYPE);
for (var m in attObj) {
if (attObj[m] != Object.prototype[m]) { // Filter out prototype additions from other potential libraries
if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
o.setAttribute("class", attObj[m]);
}
else if (m.toLowerCase() != "classid") { // Filter out IE specific attribute
o.setAttribute(m, attObj[m]);
}
}
}
for (var n in parObj) {
if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // Filter out prototype additions from other potential libraries and IE specific param element
createObjParam(o, n, parObj[n]);
}
}
el.parentNode.replaceChild(o, el);
r = o;
}
}
return r;
}
function createObjParam(el, pName, pValue) {
var p = createElement("param");
p.setAttribute("name", pName);
p.setAttribute("value", pValue);
el.appendChild(p);
}
/* Cross-browser SWF removal
- Especially needed to safely and completely remove a SWF in Internet Explorer
*/
function removeSWF(id) {
var obj = getElementById(id);
if (obj && (obj.nodeName == "OBJECT" || obj.nodeName == "EMBED")) {
if (ua.ie && ua.win) {
if (obj.readyState == 4) {
removeObjectInIE(id);
}
else {
win.attachEvent("onload", function() {
removeObjectInIE(id);
});
}
}
else {
obj.parentNode.removeChild(obj);
}
}
}
function removeObjectInIE(id) {
var obj = getElementById(id);
if (obj) {
for (var i in obj) {
if (typeof obj[i] == "function") {
obj[i] = null;
}
}
obj.parentNode.removeChild(obj);
}
}
/* Functions to optimize JavaScript compression
*/
function getElementById(id) {
var el = null;
try {
el = doc.getElementById(id);
}
catch (e) {}
return el;
}
function createElement(el) {
return doc.createElement(el);
}
/* Updated attachEvent function for Internet Explorer
- Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
*/
function addListener(target, eventType, fn) {
target.attachEvent(eventType, fn);
listenersArr[listenersArr.length] = [target, eventType, fn];
}
/* Flash Player and SWF content version matching
*/
function hasPlayerVersion(rv) {
var pv = ua.pv, v = rv.split(".");
v[0] = parseInt(v[0], 10);
v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
v[2] = parseInt(v[2], 10) || 0;
return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
}
/* Cross-browser dynamic CSS creation
- Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
*/
function createCSS(sel, decl) {
if (ua.ie && ua.mac) {
return;
}
var h = doc.getElementsByTagName("head")[0], s = createElement("style");
s.setAttribute("type", "text/css");
s.setAttribute("media", "screen");
if (!(ua.ie && ua.win) && typeof doc.createTextNode != UNDEF) {
s.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
}
h.appendChild(s);
if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
var ls = doc.styleSheets[doc.styleSheets.length - 1];
if (typeof ls.addRule == OBJECT) {
ls.addRule(sel, decl);
}
}
}
function setVisibility(id, isVisible) {
var v = isVisible ? "visible" : "hidden";
if (isDomLoaded && getElementById(id)) {
getElementById(id).style.visibility = v;
}
else {
createCSS("#" + id, "visibility:" + v);
}
}
/* Filter to avoid XSS attacks
*/
function urlEncodeIfNecessary(s) {
var regex = /[\\\"<>\.;]/;
var hasBadChars = regex.exec(s) != null;
return hasBadChars ? encodeURIComponent(s) : s;
}
/* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
*/
var cleanup = function() {
if (ua.ie && ua.win) {
window.attachEvent("onunload", function() {
// remove listeners to avoid memory leaks
var ll = listenersArr.length;
for (var i = 0; i < ll; i++) {
listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
}
// cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
var il = objIdArr.length;
for (var j = 0; j < il; j++) {
removeSWF(objIdArr[j]);
}
// cleanup library's main closures to avoid memory leaks
for (var k in ua) {
ua[k] = null;
}
ua = null;
for (var l in swfobject) {
swfobject[l] = null;
}
swfobject = null;
});
}
}();
return {
/* Public API
- Reference: http://code.google.com/p/swfobject/wiki/SWFObject_2_0_documentation
*/
registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr) {
if (!ua.w3cdom || !objectIdStr || !swfVersionStr) {
return;
}
var regObj = {};
regObj.id = objectIdStr;
regObj.swfVersion = swfVersionStr;
regObj.expressInstall = xiSwfUrlStr ? xiSwfUrlStr : false;
regObjArr[regObjArr.length] = regObj;
setVisibility(objectIdStr, false);
},
getObjectById: function(objectIdStr) {
var r = null;
if (ua.w3cdom) {
var o = getElementById(objectIdStr);
if (o) {
var n = o.getElementsByTagName(OBJECT)[0];
if (!n || (n && typeof o.SetVariable != UNDEF)) {
r = o;
}
else if (typeof n.SetVariable != UNDEF) {
r = n;
}
}
}
return r;
},
embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj) {
if (!ua.w3cdom || !swfUrlStr || !replaceElemIdStr || !widthStr || !heightStr || !swfVersionStr) {
return;
}
widthStr += ""; // Auto-convert to string
heightStr += "";
if (hasPlayerVersion(swfVersionStr)) {
setVisibility(replaceElemIdStr, false);
var att = {};
if (attObj && typeof attObj === OBJECT) {
for (var i in attObj) {
if (attObj[i] != Object.prototype[i]) { // Filter out prototype additions from other potential libraries
att[i] = attObj[i];
}
}
}
att.data = swfUrlStr;
att.width = widthStr;
att.height = heightStr;
var par = {};
if (parObj && typeof parObj === OBJECT) {
for (var j in parObj) {
if (parObj[j] != Object.prototype[j]) { // Filter out prototype additions from other potential libraries
par[j] = parObj[j];
}
}
}
if (flashvarsObj && typeof flashvarsObj === OBJECT) {
for (var k in flashvarsObj) {
if (flashvarsObj[k] != Object.prototype[k]) { // Filter out prototype additions from other potential libraries
if (typeof par.flashvars != UNDEF) {
par.flashvars += "&" + k + "=" + flashvarsObj[k];
}
else {
par.flashvars = k + "=" + flashvarsObj[k];
}
}
}
}
addDomLoadEvent(function() {
createSWF(att, par, replaceElemIdStr);
if (att.id == replaceElemIdStr) {
setVisibility(replaceElemIdStr, true);
}
});
}
else if (xiSwfUrlStr && !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac)) {
isExpressInstallActive = true; // deferred execution
setVisibility(replaceElemIdStr, false);
addDomLoadEvent(function() {
var regObj = {};
regObj.id = regObj.altContentId = replaceElemIdStr;
regObj.width = widthStr;
regObj.height = heightStr;
regObj.expressInstall = xiSwfUrlStr;
showExpressInstall(regObj);
});
}
},
getFlashPlayerVersion: function() {
return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
},
hasFlashPlayerVersion: hasPlayerVersion,
createSWF: function(attObj, parObj, replaceElemIdStr) {
if (ua.w3cdom) {
return createSWF(attObj, parObj, replaceElemIdStr);
}
else {
return undefined;
}
},
removeSWF: function(objElemIdStr) {
if (ua.w3cdom) {
removeSWF(objElemIdStr);
}
},
createCSS: function(sel, decl) {
if (ua.w3cdom) {
createCSS(sel, decl);
}
},
addDomLoadEvent: addDomLoadEvent,
addLoadEvent: addLoadEvent,
getQueryParamValue: function(param) {
var q = doc.location.search || doc.location.hash;
if (param == null) {
return urlEncodeIfNecessary(q);
}
if (q) {
var pairs = q.substring(1).split("&");
for (var i = 0; i < pairs.length; i++) {
if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
}
}
}
return "";
},
// For internal usage only
expressInstallCallback: function() {
if (isExpressInstallActive && storedAltContent) {
var obj = getElementById(EXPRESS_INSTALL_ID);
if (obj) {
obj.parentNode.replaceChild(storedAltContent, obj);
if (storedAltContentId) {
setVisibility(storedAltContentId, true);
if (ua.ie && ua.win) {
storedAltContent.style.display = "block";
}
}
storedAltContent = null;
storedAltContentId = null;
isExpressInstallActive = false;
}
}
}
};
}();
var domWrite = (function(){ // by Frank Thuerigen
// private
var dw = document.write, // save document.write()
dwln = document.writeln, // save document.writeln()
myCalls = [], // contains all outstanding Scripts
t = '', // timeout
checkMs = 400, // checking interval for d.w() writes
// ...default: 200 ms
maxMs = 2000, // maximum execution milliseconds
// ...default: 1000 ms
maxT; // maximum execution timeout
function getid() {
var myDate = new Date();
return '_'+myDate.getTime()+'_'+Math.random().toString().replace( /\./, '');
}
function startnext(){ // start next call in pipeline
if ( myCalls.length > 0 ) {
try { console.log('function startnext: Status='+myCalls[0].stat) } catch (e) {};
switch ( myCalls[0].stat ) {
case 0: // created
try { console.log('startnext.start') } catch (e) {};
myCalls[0].start();
startnext();
break;
case 1: // waiting
try { console.log('startnext.startload') } catch (e) {};
myCalls[0].startload();
break;
case 4:
try { console.log('startnext.resume') } catch (e) {};
myCalls[0].resume();
break;
case 5:
myCalls.shift();
try { console.log('startnext.end # of myCalls left: '+myCalls.length) } catch (e) {};
startnext();
break;
}
}
else {
try { console.log('startnext.END ALL: restore document.write functions') } catch (e) {};
document.write=dw; // restore document.write()
document.writeln=dwln; // restore document.writeln()
}
}
function fillStack( pCall ){ // eval embedded script tags in HTML code
try { console.log('function fillStack()') } catch (e) {};
var regexp1 = /[^'"]* OR
//
}
MyCall.prototype={
start: function(){
try { console.log('myCall.start...') } catch (e) {};
this.stat=1; // status = waiting
},
startload: function(){
try { console.log('myCall.startload...') } catch (e) {};
this.stat=2; // loading-executing
this.f.apply( window ); // execute settings function
var that = this;
document.write = (function(){
var o=that,
cb=testDone( o );
if ( o.cont !== false ){ // timeout has been defined
try { console.log('myCall.startload --> start foreign script timeout') } catch (e) {};
window.setTimeout(
function(){ // after timeout fill stack
o.stat = 5; // status = done
fillStack(o); // fill div
},
o.cont
);
}
return function( pString ){ // overload document.write()
o.stat=3; // status = processing
if ( o.cont===false ){
window.clearTimeout(o.t);
}
o.oldbuf = o.buf;
o.buf += pString; // add string to buffer
if ( o.cont===false ){
o.t=window.setTimeout( cb, o.ms );
}
};
})();
document.writeln = document.write;
this.dw = document.write;
this.dwln = document.writeln;
var s=document.createElement('script');
s.setAttribute('language','javascript');
s.setAttribute('type','text/javascript');
s.setAttribute('src', this.src);
document.getElementsByTagName('head')[0].appendChild(s);
try { console.log('myCall.startload --> script appended: '+this.src) } catch (e) {};
},
resume: function(){
try { console.log('myCall.resume... document.write(), .writeln() reset to object functions...') } catch (e) {};
this.stat=3; // post-processing
document.write=this.dw;
document.writeln=this.dwln;
outputStack( myCalls[0] );
},
pause: function(){
try { console.log('myCall.pause...') } catch (e) {};
this.stat=4;
},
stop: function(){
try { console.log('myCall.stop...') } catch (e) {};
window.clearTimeout( this.t );
this.stat=5;
}
}
return function( pDiv, pSrc, pFunc, pContinue, pForce ){ // public
if (myCalls.length > 0 && pForce !== true ) {
try { console.log('==> domWrite call POSTPONED: ' + pDiv) } catch (e) {};
window.setTimeout(
function(){ domWrite( pDiv, pSrc, pFunc, pContinue ); },
1000
);
return;
}
try { console.log('==> domWrite call: '+pSrc) } catch (e) {};
var c = new MyCall( pDiv, pSrc, pFunc, pContinue );
if (pContinue){
myCalls.unshift( c );
startnext();
}
else {
myCalls.push( c );
}
try { console.log('==> ADDED # of myCalls now: '+myCalls.length) } catch (e) {};
if ( myCalls.length === 1 ){
startnext();
}
}
})();