function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}



// Prüft, ob "field" NICHT leer ist. Ist dies nicht der Fall, wird die Fehlermeldung ausgegeben.
//
function Empty(field,error)
{ if(field.value == "") {alert(error);field.focus();return false;} else {return true;}};


// Prüft, ob "field" eine gültige Email Adresse enthaelt. Ist dies nicht der Fall, wird die Fehlermeldung ausgegeben.
//
function Email(field,error)
{ if(field.value.indexOf("@")<1) {alert(error);field.focus();return false;} else {return true;}};

// Die Nachricht darf nicht länger sein als "anzahl" Zeichen
function adviseZeichen(field,anzahl)
{ if(field.value.length>anzahl) {alert("Das Feld [Nachricht] hat zu viele Zeichen. (max. "+anzahl+" Zeichen)");field.focus();return false;} else {return true;}};

function chkFormular()
{
if(document.advise)
{
if (
	Empty(document.advise.advise_to_name,"Das Feld [Name des Empfängers] darf nicht leer sein.")
	&&Email(document.advise._to,"Das Feld [Email des Empfängers] darf nicht leer sein und muss die Form name@domain haben.")
	&&Empty(document.advise.advise_from_name,"Das Feld [Ihr Name] darf nicht leer sein.")
	&&Email(document.advise.advise_from_email,"Das Feld [Ihre Email] darf nicht leer sein und muss die Form name@domain haben.")
	&&adviseZeichen(document.advise.advise_from_comment,500)
	)

	{
    document.advise.submit();
	}
}
if(!document.advise)
	{
    document.ecardadvise.submit();
	}
}

function chkFormular_museumsnacht()
{
if(document.advise)
{
if (
	  Empty(document.advise.ecard_nameto,"Das Feld [Name des Empfängers] darf nicht leer sein.")
	&&Email(document.advise.ecard_mailto,"Das Feld [Email des Empfängers] darf nicht leer sein und muss die Form name@domain haben.")
	&&Empty(document.advise.ecard_namefrom,"Das Feld [Ihr Name] darf nicht leer sein.")
	&&Email(document.advise.ecard_mailfrom,"Das Feld [Ihre Email] darf nicht leer sein und muss die Form name@domain haben.")
	)

	{
    document.advise.submit();
	}
}
}

// ************* Toolbox ein/ausschalten ******************* //
tools=new Array();
tools[0]="accessstyle"; //access1: span um accessstyle
tools[1]="accesskontrast"; //access2:span um accesskontrast
tools[2]="accesstext"; //access3:span um accesstext

function moveTip(y) {
var stat=false;
if (typeof y2 == 'undefined') {
	y2=0;
} 
else {
	if(y2==y) {
	stat=true;
	}
}
y2=y;
if (typeof x == 'undefined')
	x=0;
if(stat==false)
	x=0;
if(x==0) {
tool_off();
tool_on(y);
x=1;
}
else {
tool_off();
x=0;
}
}

function tool_on(x) {
var id="access3";
for(i=0;i<tools.length;i++) {
if(i==x)
	id=tools[i];
}
document.getElementById(id).className="show";
document.getElementById('accessbox').className="show";
}

function tool_off() {
//alert(tools.length);
for(i=0;i<tools.length;i++) {
//alert(i+" - "+tools.length+" - "+tools[i]);
document.getElementById(tools[i]).className="hideposition"; //Text außerhalb des sichtbaren Bereichs
}
document.getElementById('accessbox').className="hide";	//Hintergrundbild nicht angezeigt, sonst Fehler im Mozilla/Firefox
x=0;
}
// ********************************************************* //

/************* Cookie Verwaltung **************/
function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*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;
}
/**********************************************/


// ***************** Cookie Cityinfoterminal *************** //
function cookieCityinfoSet(name,value,days) {
	var path="/";
	var domain="dortmund.de";
	var secure="false";

  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = date.toGMTString();
  }
  else expires = "";
  var curCookie = name + "=" + escape(value) + "; expires=" + expires + "; path=/;domain="+domain+";";
	document.cookie = curCookie;
}

function cookieCityinfoRead(CookieName)
{
   var i=0  //Suchposition im Cookie
   var suche = CookieName+"=";
   while (i<document.cookie.length){
      if (document.cookie.substring(i, i+suche.length)==suche){
         var ende = document.cookie.indexOf(";", i+suche.length);
         ende = (ende>-1) ? ende : document.cookie.length
         var cook = document.cookie.substring(i+suche.length, ende)
         return unescape(cook);
      }
      i++;
   }
	return null;
}

function switchCookie() {
	var url_query="";
	if (window.location.search != "") {
		url_query=window.location.search;
		url_query2=url_query.split("&");
		for(i=0;i<url_query2.length;i++) {
		var query = url_query2[i].replace(/\?/,"");
		if(query=="style=cityinfo2") {
			cookieCityinfoSet("cityinfo","40",50);
		}
		if(query=="style=0") {
			cookieCityinfoSet("cityinfo","40",-1);
		}
		}
	}
	var cookie_cityinfo = cookieCityinfoRead("cityinfo");
	if(cookie_cityinfo!=null) {
		document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/base/master_styles/basic/style_cityinfo.css\">");
	}
}

function setCityinfoStyle() {
	var cookie_cityinfo = cookieCityinfoRead("cityinfo");
	if(cookie_cityinfo!=null) {
		document.write("<link rel=\"stylesheet\" type=\"text/css\" href=\"/base/master_styles/basic/style_cityinfo.css\">");
	}
}
// ********************************************************* //


<!--

// ----------------------------------------------
// StyleSwitcher functions written by Paul Sowden
// http://www.idontsmoke.co.uk/ss/
// - - - - - - - - - - - - - - - - - - - - - - -
// For the details, visit ALA:
// http://www.alistapart.com/stories/alternate/

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;
    }
  }
}

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;
}

window.onload = function(e) {
  var cookie = readCookie("style");
  var title = cookie ? cookie : getPreferredStyleSheet();
  setActiveStyleSheet(title);
}

window.onunload = function(e) {
  var title = getActiveStyleSheet();
  createCookie("style", title, 365);
}

var cookie = readCookie("style");
var title = cookie ? cookie : getPreferredStyleSheet();
setActiveStyleSheet(title);

// Random hp image

function randomImg() {
	var thePics = new Array()

	thePics[1] = "nantucket.jpg"
	thePics[2] = "robot.jpg"
	thePics[3] = "fl_beach.jpg"
	thePics[4] = "az_road.jpg"
	thePics[5] = "train_ride.jpg"
	thePics[6] = "wheat_field.jpg"
	thePics[7] = "birch.jpg"
	thePics[8] = "cactus.jpg"
	thePics[9] = "finish_line.jpg"
	thePics[10] = "fender.jpg"
	
	var rn = Math.floor(Math.random() * thePics.length)
	if (rn == 0) {
	  rn = 1
	}
	document.write("<img src=\"/photos/hp/"+thePics[rn]+"\" width=\"194\" height=\"146\" border=\"0\" />")
}

// MT functions

function OpenTrackback (c) {
    window.open(c,
                    'trackback',
                    'width=480,height=480,scrollbars=yes,status=yes');
}

var HOST = 'www.simplebits.com';

// Copyright (c) 1996-1997 Athenia Associates.
// http://www.webreference.com/js/
// License is granted if and only if this entire
// copyright notice is included. By Tomer Shiran.

function setCookie (name, value, expires, path, domain, secure) {
    var curCookie = name + "=" + escape(value) + ((expires) ? "; expires=" + expires.toGMTString() : "") + ((path) ? "; path=" + path : "/") + ((domain) ? "; domain=" + domain : "") + ((secure) ? "; secure" : "");
    document.cookie = curCookie;
}

function getCookie (name) {
    var prefix = name + '=';
    var c = document.cookie;
    var nullstring = '';
    var cookieStartIndex = c.indexOf(prefix);
    if (cookieStartIndex == -1)
        return nullstring;
    var cookieEndIndex = c.indexOf(";", cookieStartIndex + prefix.length);
    if (cookieEndIndex == -1)
        cookieEndIndex = c.length;
    return unescape(c.substring(cookieStartIndex + prefix.length, cookieEndIndex));
}

function deleteCookie (name, path, domain) {
    if (getCookie(name))
        document.cookie = name + "=" + ((path) ? "; path=" + path : "/") + ((domain) ? "; domain=" + domain : "") + "; expires=Thu, 01-Jan-70 00:00:01 GMT";
}

function fixDate (date) {
    var base = new Date(0);
    var skew = base.getTime();
    if (skew > 0)
        date.setTime(date.getTime() - skew);
}

function rememberMe (f) {
    var now = new Date();
    fixDate(now);
    now.setTime(now.getTime() + 365 * 24 * 60 * 60 * 1000);
    setCookie('mtcmtauth', f.author.value, now, '', HOST, '');
    setCookie('mtcmtmail', f.email.value, now, '', HOST, '');
    setCookie('mtcmthome', f.url.value, now, '', HOST, '');
}

function forgetMe (f) {
    deleteCookie('mtcmtmail', '', HOST);
    deleteCookie('mtcmthome', '', HOST);
    deleteCookie('mtcmtauth', '', HOST);
    f.email.value = '';
    f.author.value = '';
    f.url.value = '';
}

//-->
