if (top != self) { top.location = self.location; } function js_START() { js_AKT_SERVER_ZEIT(); wdw_AKT_SERVER_ZEIT = window.setInterval('js_AKT_SERVER_ZEIT()', 1000 * int_AKTUALISIERUNGSINTERVALL); } // Muss mit PHP übergeben werden, da es die Serverzeit sein soll var wdw_AKT_SERVER_ZEIT = ''; var int_AKTUALISIERUNGSINTERVALL = 10; // Aktualisierungsintervall in Sekunden var int_AKT_SERVER_SEKUNDE = 20; // Aktuell Zeit - Sekunde var int_AKT_SERVER_MINUTE = 09; // Aktuell Zeit - Minute var int_AKT_SERVER_STUNDE = 19; // Aktuell Zeit - Stunde var int_AKT_SERVER_TAG = 6; // Aktuell Zeit - Tag var int_AKT_SERVER_MONAT = 9; // Aktuell Zeit - Monat var int_AKT_SERVER_JAHR = 2010; // Aktuell Zeit - Jahr str_TAG_DEU_LANG = new Array ('Sonntag', 'Montag', 'Dienstag', 'Mittwoch', 'Donnerstag', 'Freitag', 'Samstag'); str_TAG_DEU_KURZ = new Array ('So', 'Mo', 'Di', 'Mi', 'Do', 'Fr', 'Sa'); str_MONAT_DEU_LANG = new Array ( 'Januar', 'Februar', 'März', 'April', 'Mai', 'Juni', 'Juli', 'August', 'September', 'Oktober', 'November', 'Dezember' ); str_MONAT_DEU_KURZ = new Array ( 'Jan', 'Feb', 'Mrz', 'Apr', 'Mai', 'Jun', 'Jul', 'Aug', 'Sep', 'Okt', 'Nov', 'Dez' ); function js_AKT_SERVER_ZEIT () { var date_AKT = new Date(); if (int_AKT_SERVER_SEKUNDE > 59) { int_AKT_SERVER_SEKUNDE = int_AKT_SERVER_SEKUNDE - 60; int_AKT_SERVER_MINUTE ++; } if (int_AKT_SERVER_MINUTE > 59) { int_AKT_SERVER_MINUTE = 0; int_AKT_SERVER_STUNDE ++; } if (int_AKT_SERVER_STUNDE > 23) { int_AKT_SERVER_STUNDE = 0; int_AKT_SERVER_TAG ++; } if (int_AKT_SERVER_MONAT == 2) { if ((int_AKT_SERVER_JAHR % 4) == 0) { // Schaltjahr - Die Ausnahme für das Jahr 2400 hab ich mal weggelassen if (int_AKT_SERVER_TAG > 29) { int_AKT_SERVER_TAG = 1; int_AKT_SERVER_MONAT ++; } } else { if (int_AKT_SERVER_TAG > 28) { int_AKT_SERVER_TAG = 1; int_AKT_SERVER_MONAT ++; } } } else if (int_AKT_SERVER_MONAT == 4 || int_AKT_SERVER_MONAT == 6 || int_AKT_SERVER_MONAT == 9 || int_AKT_SERVER_MONAT == 11) { if (int_AKT_SERVER_TAG > 30) { int_AKT_SERVER_TAG = 1; int_AKT_SERVER_MONAT ++; } } else { if (int_AKT_SERVER_TAG > 31) { int_AKT_SERVER_TAG = 1; int_AKT_SERVER_MONAT ++; } } if (int_AKT_SERVER_MONAT > 12) { int_AKT_SERVER_MONAT = 1; int_AKT_SERVER_JAHR ++; } date_AKT.setDate(int_AKT_SERVER_TAG); date_AKT.setMonth(int_AKT_SERVER_MONAT - 1); date_AKT.setFullYear(int_AKT_SERVER_JAHR); var int_WOCHENTAG = date_AKT.getDay(); var str_SERVERZEIT = str_TAG_DEU_KURZ[int_WOCHENTAG] + ', ' + (int_AKT_SERVER_TAG < 10 ? '0' + int_AKT_SERVER_TAG : int_AKT_SERVER_TAG) + '. ' + str_MONAT_DEU_KURZ[int_AKT_SERVER_MONAT - 1] + ' ' + int_AKT_SERVER_JAHR + ' ' + (int_AKT_SERVER_STUNDE < 10 ? '0' + int_AKT_SERVER_STUNDE : int_AKT_SERVER_STUNDE) + ':' + (int_AKT_SERVER_MINUTE < 10 ? '0' + int_AKT_SERVER_MINUTE : int_AKT_SERVER_MINUTE) ; int_AKT_SERVER_SEKUNDE = int_AKT_SERVER_SEKUNDE + int_AKTUALISIERUNGSINTERVALL; document.getElementById('server_zeit').innerHTML = str_SERVERZEIT; return; } function js_LOGOUT () { var requestFile = 'http://www.grusskarten.eu.com/_module/ajax/logout.ajax.php'; sendAjaxRequest (requestFile); } function js_CHECK_VALUE (id) { // Felder aus der Registrierung if (id.substr(0, 4) == 'reg_') { // var requestFile = 'register.ajax.php?do=CheckValue&id=' + id + '&value=' + document.getElementById(id).value; // sendAjaxRequest (requestFile); //hier soll nun per ajax nachgefragt werden und die darüber auch gefüllt werden if (id == 'reg_nick') { js_REG_OK (id + '_ok', 0); js_TEXT_ERSETZEN (id + '_info', '...überprüfe...', ''); var requestFile = 'http://www.grusskarten.eu.com/_module/ajax/register.ajax.php?do=check_nick&id=' + id + '&portal=hochzeits_guide&nick=' + encodeURIComponent(document.getElementById(id).value); sendAjaxRequest (requestFile); } else if (id == 'reg_email') { js_REG_OK (id + '_ok', 0); js_TEXT_ERSETZEN (id + '_info', '...überprüfe...', ''); var requestFile = 'http://www.grusskarten.eu.com/_module/ajax/register.ajax.php?do=check_mxrecord&id=' + id + '&email=' + encodeURIComponent(document.getElementById(id).value); sendAjaxRequest (requestFile); } else if (id == 'reg_captcha') { js_REG_OK (id + '_ok', 0); js_TEXT_ERSETZEN (id + '_info', '...überprüfe...', ''); var requestFile = 'http://www.grusskarten.eu.com/_module/ajax/register.ajax.php?do=check_captcha&id=' + id + '&captcha=' + encodeURIComponent(document.getElementById(id).value); sendAjaxRequest (requestFile); } else if (id == 'reg_regeln') { if (document.getElementById('reg_regeln').checked == true) { js_TEXT_ERSETZEN (id + '_info', ' Ja, ich erkenne die Nutzungsbedinungen an.', 'ok'); } else { js_TEXT_ERSETZEN (id + '_info', 'Sie müssen die Nutzungsbedinungen anerkennen.', 'error'); } } js_CHECK_REG(); } return; } function js_CHECK_REG () { if ( document.getElementById('reg_nick_ok').value == 1 && document.getElementById('reg_email_ok').value == 1 && document.getElementById('reg_captcha_ok').value == 1 && document.getElementById('reg_regeln').checked == true ) { document.getElementById('reg_send').disabled = false; } else { document.getElementById('reg_send').disabled = true; } return; } function js_REG_OK (id, int_OK) { document.getElementById(id).value = int_OK; return; } function js_TEXT_ERSETZEN (id, str_TEXT, str_FORM) { // str_FORM = error, info, ok document.getElementById(id).firstChild.replaceData(0, document.getElementById(id).firstChild.nodeValue.length, str_TEXT); if (str_FORM == 'error') { document.getElementById(id).style.color = "#FF0000"; document.getElementById(id).style.fontWeight = 'bold'; } else if (str_FORM == 'ok') { document.getElementById(id).style.color = "#004000"; document.getElementById(id).style.fontWeight = 'normal'; } else { document.getElementById(id).style.color = "#000000"; document.getElementById(id).style.fontWeight = 'normal'; } return; } function js_REG_SEND () { var requestFile = 'http://www.grusskarten.eu.com/_module/ajax/register.ajax.php?do=reg_user&portal=hochzeits_guide&nick=' + encodeURIComponent(document.getElementById("reg_nick").value) + '&email=' + encodeURIComponent(document.getElementById("reg_email").value) + '&captcha=' + encodeURIComponent(document.getElementById("reg_captcha").value); sendAjaxRequest (requestFile); // document.getElementById('reg_angaben').style.display = "none"; // document.getElementById('reg_mailversand').style.display = "block"; return; } /* Simple AJAX Code-Kit (SACK) v1.6.1 */ /* ©2005 Gregory Wild-Smith */ /* www.twilightuniverse.com */ /* Software licenced under a modified X11 licence, see documentation or authors website for more details */ var ajax = new Array(); function sendAjaxRequest (requestFile) { var index = ajax.length; ajax[index] = new sack(); ajax[index].requestFile = requestFile; ajax[index].onCompletion = function() { evalAjaxResponse(index) }; ajax[index].runAJAX(); return; } // AJAX - Response function evalAjaxResponse (ajax_index) { eval(ajax[ajax_index].response); return; } function sack (file) { this.xmlhttp = null; this.resetData = function() { this.method = 'POST'; this.queryStringSeparator = '?'; this.argumentSeparator = '&'; this.URLString = ''; this.encodeURIString = true; this.execute = false; this.element = null; this.elementObj = null; this.requestFile = file; this.vars = new Object(); this.responseStatus = new Array(2); }; this.resetFunctions = function() { this.onLoading = function() { }; this.onLoaded = function() { }; this.onInteractive = function() { }; this.onCompletion = function() { }; this.onError = function() { }; this.onFail = function() { }; }; this.reset = function() { this.resetFunctions(); this.resetData(); }; this.createAJAX = function() { try { this.xmlhttp = new ActiveXObject ('Msxml2.XMLHTTP'); } catch (e1) { try { this.xmlhttp = new ActiveXObject ('Microsoft.XMLHTTP'); } catch (e2) { this.xmlhttp = null; } } if (! this.xmlhttp) { if (typeof XMLHttpRequest != 'undefined') { this.xmlhttp = new XMLHttpRequest(); } else { this.failed = true; } } }; this.setVar = function (name, value) { this.vars[name] = Array(value, false); }; this.encVar = function (name, value, returnvars) { if (true == returnvars) { return Array(encodeURIComponent(name), encodeURIComponent(value)); } else { this.vars[encodeURIComponent(name)] = Array(encodeURIComponent(value), true); } } this.processURLString = function (string, encode) { encoded = encodeURIComponent (this.argumentSeparator); regexp = new RegExp (this.argumentSeparator + '|' + encoded); varArray = string.split(regexp); for (i = 0; i < varArray.length; i++) { urlVars = varArray[i].split('='); if (true == encode){ this.encVar(urlVars[0], urlVars[1]); } else { this.setVar(urlVars[0], urlVars[1]); } } } this.createURLString = function (urlstring) { if (this.encodeURIString && this.URLString.length) { this.processURLString(this.URLString, true); } if (urlstring) { if (this.URLString.length) { this.URLString += this.argumentSeparator + urlstring; } else { this.URLString = urlstring; } } // prevents caching of URLString this.setVar('rndval', new Date().getTime()); urlstringtemp = new Array(); for (key in this.vars) { if (false == this.vars[key][1] && true == this.encodeURIString) { encoded = this.encVar(key, this.vars[key][0], true); delete this.vars[key]; this.vars[encoded[0]] = Array(encoded[1], true); key = encoded[0]; } urlstringtemp[urlstringtemp.length] = key + '=' + this.vars[key][0]; } if (urlstring){ this.URLString += this.argumentSeparator + urlstringtemp.join(this.argumentSeparator); } else { this.URLString += urlstringtemp.join(this.argumentSeparator); } } this.runResponse = function() { eval(this.response); } this.runAJAX = function(urlstring) { if (this.failed) { this.onFail(); } else { this.createURLString(urlstring); if (this.element) { this.elementObj = document.getElementById(this.element); } if (this.xmlhttp) { var self = this; if (this.method == 'GET') { totalurlstring = this.requestFile + this.queryStringSeparator + this.URLString; this.xmlhttp.open(this.method, totalurlstring, true); } else { this.xmlhttp.open(this.method, this.requestFile, true); try { this.xmlhttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded') } catch (e) { } } this.xmlhttp.onreadystatechange = function() { switch (self.xmlhttp.readyState) { case 1: self.onLoading(); break; case 2: self.onLoaded(); break; case 3: self.onInteractive(); break; case 4: self.response = self.xmlhttp.responseText; self.responseXML = self.xmlhttp.responseXML; self.responseStatus[0] = self.xmlhttp.status; self.responseStatus[1] = self.xmlhttp.statusText; if (self.execute) { self.runResponse(); } if (self.elementObj) { elemNodeName = self.elementObj.nodeName; elemNodeName.toLowerCase(); if ( elemNodeName == 'input' || elemNodeName == 'select' || elemNodeName == 'option' || elemNodeName == 'textarea' ) { self.elementObj.value = self.response; } else { self.elementObj.innerHTML = self.response; } } if (self.responseStatus[0] == '200') { self.onCompletion(); } else { self.onError(); } self.URLString = ''; break; } }; this.xmlhttp.send(this.URLString); } } }; this.reset(); this.createAJAX(); }