/** * Setzt Links mit dem Attribut rel="external" das sie in einem neuen Fenster / Tab geoeffnet werden. */ function externalLinks() { var anchors = document.getElementsByTagName('a'); // alle a-Tags holen for(var i = 0; i < anchors.length; i++) { // a-Tags durchgehen... if(anchors[i].getAttribute('href') && anchors[i].getAttribute('rel') == 'external') { // wenn sie ein href-Attribut haben und rel='external'... anchors[i].target = '_blank'; // target='_blank' setzen } } } /** * Redirect the browser to the given link if the user confirms the dialog. * * @param string msg message to be confirmed by the user * @param string link url to redirect the user to if he confirms the dialog */ function link_action_confirm(msg, link) { if(confirm(msg)) { window.location.href = link; } } function senden_check(text) { // Function - prüft ob alle felder ausgefüllt und gibt ggf ne fehlermeldung aus if(document.getElementById('form').total.value == '' || (document.getElementById('form').zusatz && document.getElementById('form').zusatz.value == '')) { alert(text); return false; } return true; } /** * Aktualisiert den Pagetitle und die currentPosition. * * @param string base_url BasisURL der Homepage * @param string section aktuelle Section der Homepage * @param string section_title Titel der aktuellen Section der Homepage * @param string action_title Titel der aktuellen Action der Homepage */ function updateTitle(base_url, section, section_title, action_title) { document.title = "Segaja's Homepage - " + section_title; // Title neu setzen // --- currentPosition aktualisieren - Anfang --- var currentPosition = document.getElementById('currentPosition'); // Container holen while(currentPosition.lastChild) { // Container leeren... currentPosition.removeChild(currentPosition.lastChild); } // neue currentPosition bestimmen... if(action_title) { var a = document.createElement('a'); a.href = base_url + section; a.appendChild(document.createTextNode(section_title)); currentPosition.appendChild(a); currentPosition.appendChild(document.createTextNode(' | ' + action_title)); } else { currentPosition.appendChild(document.createTextNode(section_title)); } // --- currentPosition aktualisieren - Ende --- } //create onDomReady Event and Initialize event depending on browser... window.onDomReady = function() { if(document.addEventListener) { // W3C-compliant browser... document.addEventListener('DOMContentLoaded', onReady, false); } else { // IE document.onreadystatechange = function() { if(document.readyState == 'interactive' || document.readyState == 'complete') { onReady(); } } } }(); function onReady() { externalLinks(); // ermoeglicht externe Links icq_status(); // ICQ-Status ermitteln und anzeigen };