window.name = "Hauptfenster"; function checkValues_NLsend() { if (!document.getElementById('gruppe0').checked && !document.getElementById('gruppe1').checked && !document.getElementById('gruppe2').checked && !document.getElementById('gruppe3').checked && !document.getElementById('gruppe4').checked ) { alert("Bitte mindestens eine Empfängergruppe angeben."); return false; } return true; } // ---------------------------------------------------------- function showLoginPage() { var login = window.open("admin.php?page=login","loginfenster","width=200,height=150,dependent=yes,menubar=no,location=no,resizable=no,left=200,top=200"); if (login.opener == null) { login.opener = window; } } function getResolution() { var res = screen.width; this.location = "index.php?width=" + res; } // ---------------------------------------------------------- /* * Hover-Farbe für Tabellen (z.B. Bilderkatalog) */ function setPointer(theRow, thePointerColor) { if (thePointerColor == '' || typeof(theRow.style) == 'undefined') { return false; } if (typeof(document.getElementsByTagName) != 'undefined') { var theCells = theRow.getElementsByTagName('td'); } else if (typeof(theRow.cells) != 'undefined') { var theCells = theRow.cells; } else { return false; } var rowCellsCnt = theCells.length; for (var c = 0; c < rowCellsCnt; c++) { theCells[c].style.backgroundColor = thePointerColor; } return true; } // end of the 'setPointer()' function // ---------------------------------------------------------- function GetCursor() { if (( navigator.userAgent.indexOf("Opera") != -1) || (navigator.userAgent.indexOf("Gecko") != -1)) { text_before = document.getElementsByName('content_main')[0].value; text_after = ""; }else{ document.getElementsByName('content_main')[0].focus(); var sel = document.selection.createRange(); sel.collapse(); var sel_before = sel.duplicate(); var sel_after = sel.duplicate(); sel.moveToElementText(document.getElementsByName('content_main')[0]); sel_before.setEndPoint("StartToStart",sel); sel_after.setEndPoint("EndToEnd",sel); text_before = sel_before.text; text_after = sel_after.text; } } function insert(AddCode) { GetCursor(); document.getElementsByName('content_main')[0].value = text_before + AddCode + text_after; document.getElementsByName('content_main')[0].focus(); } //********************************************************************** // BEGIN MODAL DIALOG CODE (can also be loaded as external .js file) //***********************************************************************/ // Global for brower version branching. var Nav4 = ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) == 4)) // One object tracks the current modal dialog opened from this window. var dialogWin = new Object() // Generate a modal dialog. // Parameters: // url -- URL of the page/frameset to be loaded into dialog // width -- pixel width of the dialog window // height -- pixel height of the dialog window // returnFunc -- reference to the function (on this page) // that is to act on the data returned from the dialog // args -- [optional] any data you need to pass to the dialog function openDGDialog(url, width, height, returnFunc, args) { if (!dialogWin.win || (dialogWin.win && dialogWin.win.closed)) { // Initialize properties of the modal dialog object. dialogWin.returnFunc = returnFunc dialogWin.returnedValue = "" dialogWin.args = args dialogWin.url = url dialogWin.width = width dialogWin.height = height // Keep name unique so Navigator doesn't overwrite an existing dialog. dialogWin.name = (new Date()).getSeconds().toString() // Assemble window attributes and try to center the dialog. if (Nav4) { // Center on the main window. dialogWin.left = window.screenX + ((window.outerWidth - dialogWin.width) / 2) dialogWin.top = window.screenY + ((window.outerHeight - dialogWin.height) / 2) var attr = "screenX=" + dialogWin.left + ",screenY=" + dialogWin.top + ",resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height } else { // The best we can do is center in screen. dialogWin.left = (screen.width - dialogWin.width) / 2 dialogWin.top = (screen.height - dialogWin.height) / 2 var attr = "left=" + dialogWin.left + ",top=" + dialogWin.top + ",resizable=yes,width=" + dialogWin.width + ",height=" + dialogWin.height } // Generate the dialog and make sure it has focus. dialogWin.win=window.open(dialogWin.url, dialogWin.name, attr) dialogWin.win.focus() } else { dialogWin.win.focus() } } // Event handler to inhibit Navigator form element // and IE link activity when dialog window is active. function deadend() { if (dialogWin.win && !dialogWin.win.closed) { dialogWin.win.focus() return false } } // Since links in IE4 cannot be disabled, preserve // IE link onclick event handlers while they're "disabled." // Restore when re-enabling the main window. var IELinkClicks // Disable form elements and links in all frames for IE. function disableForms() { IELinkClicks = new Array() for (var h = 0; h < frames.length; h++) { for (var i = 0; i < frames[h].document.forms.length; i++) { for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) { frames[h].document.forms[i].elements[j].disabled = true } } IELinkClicks[h] = new Array() for (i = 0; i < frames[h].document.links.length; i++) { IELinkClicks[h][i] = frames[h].document.links[i].onclick frames[h].document.links[i].onclick = deadend } frames[h].window.onfocus = checkModal frames[h].document.onclick = checkModal } } // Restore IE form elements and links to normal behavior. function enableForms() { for (var h = 0; h < frames.length; h++) { for (var i = 0; i < frames[h].document.forms.length; i++) { for (var j = 0; j < frames[h].document.forms[i].elements.length; j++) { frames[h].document.forms[i].elements[j].disabled = false } } for (i = 0; i < frames[h].document.links.length; i++) { frames[h].document.links[i].onclick = IELinkClicks[h][i] } } } // Grab all Navigator events that might get through to form // elements while dialog is open. For IE, disable form elements. function blockEvents() { if (Nav4) { window.captureEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) window.onclick = deadend } else { disableForms() } window.onfocus = checkModal } // As dialog closes, restore the main window's original // event mechanisms. function unblockEvents() { if (Nav4) { window.releaseEvents(Event.CLICK | Event.MOUSEDOWN | Event.MOUSEUP | Event.FOCUS) window.onclick = null window.onfocus = null } else { enableForms() } } function finishChecking() { if (dialogWin.win && !dialogWin.win.closed) { dialogWin.win.focus() } } // Invoked by onFocus event handler of EVERY frame, // return focus to dialog window if it's open. function checkModal() { setTimeout("finishChecking()", 50) return true } //************************** // END MODAL DIALOG CODE //**************************/ // ---------------------------------------------------------- // Aufruf der Admin-Popups // ---------------------------------------------------------- function showWindow(url, width, height) { if (false==true) openDGDialog(url,width,height); //showModelessDialog(url, '','dialogHeight:'+height+'px;dialogWidth:'+width+'px'); else window.open(url, 'fenster', 'width='+width+',height='+height+',dependend=yes,resizable=yes,status=no,toolbar=no,scrollbars=no'); } // ---------------------------------------------------------- // Zeigt das JS-Popup mit Infos über das Template an // ---------------------------------------------------------- function showTemplateInfo() { document.getElementById("outerTemplateInfoDiv").style.visibility='visible'; document.getElementById("templateInfoDiv").style.visibility='visible'; } // ---------------------------------------------------------- // Befüllt das JS-Popup mit Infos über das Template // (Bleibt noch unsichtbar) // ---------------------------------------------------------- function setTemplateInfo() { var myDiv = document.getElementById("templateInfoDiv"); var myBr = document.createElement("br"); myDiv.appendChild(myBr); var myText = document.createTextNode("Breite Titelbild : " + "1000 Pixel"); var myBr = document.createElement("br"); myDiv.appendChild(myText); myDiv.appendChild(myBr); var myText = document.createTextNode("Höhe Titelbild : " + "- Beliebig - "); var myBr = document.createElement("br"); myDiv.appendChild(myText); myDiv.appendChild(myBr); var myText = document.createTextNode("max. Breite Inhaltsbereich : " + "700 Pixel"); var myBr = document.createElement("br"); myDiv.appendChild(myText); myDiv.appendChild(myBr); var myBr = document.createElement("br"); myDiv.appendChild(myBr); }