var div_opacity = 0; var opacity_layer = null; var req = null; function add_opacity_layer() { if (opacity_layer == null) { opacity_layer = document.createElement('div'); opacity_layer.style.filter = 'Alpha(opacity = 0)'; opacity_layer.style.position = 'absolute'; opacity_layer.style.top = '0px'; opacity_layer.style.left = '0px'; opacity_layer.style.width = '100%'; opacity_layer.style.height = document.documentElement.scrollHeight + 'px'; opacity_layer.style.minHeight = '100%'; opacity_layer.style.backgroundColor = '#000000'; opacity_layer.style.overflow = 'hidden'; opacity_layer.style.opacity = 0; opacity_layer.onclick = closeHelpFrame; document.getElementsByTagName('body')[0].appendChild(opacity_layer); } else { document.getElementsByTagName('body')[0].removeChild(opacity_layer); opacity_layer = null; } } function change_opacity(factor) { div_opacity = div_opacity + (factor * 5); if ((div_opacity >= 0) && ((div_opacity <= 70))) { opacity_layer.style.opacity = (div_opacity / 100); opacity_layer.style.filter = 'Alpha(opacity = ' + div_opacity + ')'; window.setTimeout("change_opacity(" + factor + ")", 10); } else { div_opacity = div_opacity - (factor * 5); if (factor == -1) add_opacity_layer(); } } function help_received_data() { switch(req.readyState) { case 4: if (req.status == 200) { if (req.responseText != "") { document.getElementById('div_help_content').innerHTML = req.responseText; } else { alert('Ein Fehler ist aufgetreten. Bitte überprüfe, ob Du einen aktuellen Browser verwendest.'); } } else { alert('Ein Fehler ist aufgetreten. Bitte überprüfe, ob Du einen aktuellen Browser verwendest.'); } break; default: return false; break; } } function get_help(id) { try { req = new XMLHttpRequest(); } catch(ms) { try { req = new ActiveXObject("Msxml2.XMLHTTP"); } catch(nonms) { try { req = new ActiveXObject("Microsoft.XMLHTTP"); } catch(failed) { req = null; } } } if (req != null) { req.open("GET", '/ajax.php?action=g_help&helpid=' + id, true); req.onreadystatechange = help_received_data; req.send(null); return true; } else { return false; } } function openHelpFrame(id, width, height) { add_opacity_layer(); document.getElementById('div_help_content').innerHTML = '
Bitte warten...'; // document.getElementById('div_help_content').style.height = height + 'px'; height = height + 30; document.getElementById('div_help').style.width = width + 'px'; // document.getElementById('div_help').style.height = height + 'px'; document.getElementById('div_help').style.top = ((50) / 2) + 'px'; document.getElementById('div_help').style.left = ((1000 - width) / 2) + 'px'; document.getElementById('div_help').style.display = ''; window.setTimeout("change_opacity(1)", 10); get_help(id); } function closeHelpFrame() { document.getElementById('div_help').style.display = 'none'; window.setTimeout("change_opacity(-1)", 10); }