<!--
// JavaScript Document


//------------------------- Cookies für Stil-, Schriftwechsel setzen Anfang ------------------------
// JavaScript Document

function setActiveStyleSheet(title) {
var i, a, main;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title")) {
a.disabled = true;
if(a.getAttribute("title") == title) a.disabled = false;
}
}
createCookie("style", title, 1);
}

function getActiveStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1 && a.getAttribute("title") && !a.disabled) return a.getAttribute("title");
}
return null;
}

function getPreferredStyleSheet() {
var i, a;
for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
if(a.getAttribute("rel").indexOf("style") != -1
&& a.getAttribute("rel").indexOf("alt") == -1
&& a.getAttribute("title")
)return a.getAttribute("title");
}
return null;
}

function createCookie(name,value,days) {
if (days) {
var date = new Date();
date.setTime(date.getTime()+(1*24*60*60*1000));
var expires = "; expires="+date.toGMTString();
}
else expires = "";
document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
var nameEQ = name + "=";
var ca = document.cookie.split(';');
for(var i=0;i < ca.length;i++) {
var c = ca[i];
while (c.charAt(0)==' ') c = c.substring(1,c.length);
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
}
return null;
}

function eraseCookie(name) {
createCookie(name,"",-1);
}

function setFontSize(fontVal) {
var fontSet = document.getElementById("body").style.fontSize;
var docBase = new Array(); docBase = document.getElementById("body");
if (!fontVal) {fontVal = document.getElementById("fontSet").value;}
var docSize = fontVal+"%";
createCookie("size", fontVal, 1);
docBase.style.fontSize = docSize;
if (fontSet) {fontSet.value = fontVal;
}
}

window.onload = function(e) {
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);
var cookie2 = readCookie("size");
if (cookie2) {setFontSize(cookie2);}
}
window.onunload = function(e) {
var title = getActiveStyleSheet();
createCookie("style", title, 1);
}
var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

var cookie = readCookie("size");
var groesse = cookie ? cookie : 100;
//---------------------------- Stil-, Schriftwechsel Ende-------------------------------



//------------------------------ Sonstige Funktionen --------- ------------------------
//--------- Suche Steuern
function chkSuche()
{
s = document.getElementById("Suche").sbeg
if(s.value.length <= 2)
{
alert("Das Wort ' " + s.value + " ' ist kein besonders guter Suchbegriff!\n Bitte geben Sie mindestens 3 Zeichen ein.")
s.focus()
return false;
}
}

//--------- Suche Bild nachliefern bei PRINT
if(window.location.href.indexOf("cgi-bin")>0 || window.location.href.indexOf("news")>0)
{
   if(title == "light"){document.write('<div id="headmenu"><img style="border:none;display:block" src="http://www.duesseldrachen.de/images/nav/l_head.jpg" alt="Menuzettel" width="100%" height="100%" \/><\/div>');}
   if(title == "light"){document.write('<div class="start"><img style="border:none;display:block" src="http://www.duesseldrachen.de/images/nav/l_cont1.jpg" alt="Blatt 1" width="100%" height="100%" \/><\/div>');}
   if(title == "light"){document.write('<div id="bodykopf"><img style="border:none;display:block" src="http://www.duesseldrachen.de/images/nav/l_cont2.jpg" alt="Blatt 2" width="100%" height="100%" \/><\/div>');}
   if(title == "print"){document.write('<div class="start"><img style="border:none;display:block" src="http://www.duesseldrachen.de/images/nav/spirale.gif" alt="Spirale" width="100%" height="100%"" \/><\/div>');}
}

//--------  Ausdruck steuern

function druck(){
window.print()
}



