/* --------------------------------------------------------- */
/* Antispam E-Mail                                           */
/* --------------------------------------------------------- */

var tld = '&#100;&#101;'; //'de';
var sld = '&#112;&#115;&#45;&#105;&#110;&#116;&#101;&#114;&#110;&#97;&#116;&#105;&#111;&#110;&#97;&#108;'; //'ps-international';

var rln = new Array(
	'&#100;&#46;&#101;&#118;&#101;&#114;&#100;&#105;&#110;&#103;', //'d.everding'
	'&#97;&#46;&#115;&#99;&#104;&#110;&#101;&#105;&#100;&#101;&#114;', //'a.schneider'
	'&#118;&#100;&#112;', //'vdp(Edgar van der Puetten)'
	'&#105;&#46;&#101;&#98;&#98;&#105;&#110;&#103;&#104;&#97;&#117;&#115;', //'i.ebbinghaus'
	'&#109;&#46;&#101;&#114;&#108;&#105;&#110;&#103;&#104;&#97;&#103;&#101;&#110;', //'m.erlinghagen'
	'&#100;&#046;&#097;&#108;&#098;&#114;&#105;&#099;&#104;', //'d.albrich'
	'&#97;&#46;&#108;&#105;&#101;&#114;&#109;&#97;&#110;&#110;', //'a.liermann'
	'&#104;&#46;&#109;&#111;&#114;&#103;&#101;&#110;&#116;&#104;&#97;&#108;', //'h.morgenthal'
	'&#97;&#46;&#103;&#108;&#97;&#101;&#115;&#101;&#114;', //'a.glaeser'
	'&#112;&#46;&#98;&#105;&#115;&#115;&#111;&#107;', //'p.bissok'
	'&#108;&#46;&#103;&#101;&#105;&#103;&#101;&#114;', //'l.geiger'
	'&#98;&#46;&#115;&#105;&#101;&#110;&#101;&#114;&#116;&#104;', //'b.sienerth'
	'&#105;&#46;&#109;&#105;&#108;&#108;&#101;&#114;', //'i.miller'
	'&#117;&#46;&#114;&#111;&#101;&#115;&#110;&#101;&#114;', //'u.roesner'
	'&#107;&#46;&#109;&#97;&#103;&#97;&#110;&#105;&#99;&#101;', //'k.maganice'
	'&#115;&#46;&#119;&#105;&#110;&#116;&#101;&#114;&#115;&#99;&#104;&#108;&#97;&#100;&#101;&#110;', //'s.winterschladen'
	'&#109;&#046;&#104;&#101;&#099;&#107;', //'m.heck'
	'&#106;&#97;&#110;', //'jan'
	'&#98;&#46;&#114;&#97;&#116;&#104;', //'b.rath'
	'&#107;&#46;&#106;&#117;&#110;&#103;&#98;&#108;&#117;&#116;&#104;', //'k.jungbluth'
	'&#98;&#46;&#106;&#97;&#110;&#117;&#115;', //'b.janus'
	'&#109;&#046;&#114;&#097;&#117;&#112;&#097;&#099;&#104;', // m.raupach
	'&#098;&#046;&#107;&#097;&#117;&#102;&#109;&#097;&#110;&#110;', // b.kaufmann
	'&#107;&#046;&#114;&#097;&#109;&#115;&#101;&#114;', // k.ramser
	'&#098;&#046;&#114;&#105;&#101;&#099;&#104;&#101;&#114;&#115;', // b.riechers
	'&#097;&#046;&#115;&#099;&#104;&#109;&#105;&#116;&#122;', // a.schmitz
	'&#109;&#046;&#114;&#101;&#112;&#109;&#097;&#110;&#110;', // m.repmann
	'&#105;&#110;&#102;&#111;', // info
	'&#099;&#046;&#101;&#110;&#103;&#101;&#108;', // c.engel
	'&#104;&#046;&#119;&#105;&#108;&#115;&#099;&#104;', // h.wilsch
	'&#098;&#046;&#107;&#097;&#117;&#102;&#109;&#097;&#110;&#110;', // b.kaufmann
	'&#119;&#046;&#122;&#101;&#114;&#098;&#101;', // w.zerbe
	'&#109;&#046;&#118;&#097;&#110;&#100;&#101;&#114;&#097;&#097;', // m.vanderaa
	'&#109;&#046;&#098;&#101;&#108;&#108;&#105;&#110;&#103;&#114;&#111;&#100;&#116;', // m.bellingrodt
	'&#117;&#046;&#115;&#099;&#104;&#110;&#105;&#116;&#122;&#108;&#101;&#114;', // u.schnitzler
	'&#108;&#046;&#107;&#114;&#097;&#101;&#109;&#101;&#114;', // l.kraemer
	'&#118;&#046;&#122;&#101;&#105;&#115;&#101;&#114;', //v.zeiser
	'&#107;&#046;&#114;&#097;&#109;&#115;&#101;&#114;', //k.ramser
	'&#109;&#046;&#107;&#117;&#114;&#107;&#111;&#118;', //m.kurkov
	'&#116;&#046;&#108;&#111;&#101;&#119;&#101;&#110;', //t.loewen
	'&#106;&#046;&#115;&#105;&#108;&#108;&#101;&#114;', //j.siller
	'&#114;&#046;&#102;&#105;&#115;&#099;&#104;&#101;&#114;', //r.fischer
	'&#097;&#046;&#098;&#105;&#101;&#115;&#115;&#109;&#097;&#110;&#110;' //a.biessmann
	
);

var AussenGUS = '&#115;&#112;&#97;&#114;&#105;&#115;&#99;&#104;&#64;&#098;&#110;&#046;&#098;&#121;'; // sparisch(at)bn.by
var AussenPOL = '&#101;&#116;&#097;&#112;&#050;&#112;&#115;&#064;&#103;&#109;&#097;&#105;&#108;&#046;&#099;&#111;&#109;'; // etap2ps(at)gmail.com
var AussenNORD = '&#109;&#097;&#110;&#102;&#114;&#101;&#100;&#095;&#097;&#114;&#110;&#100;&#116;&#064;&#116;&#045;&#111;&#110;&#108;&#105;&#110;&#101;&#046;&#100;&#101;'; // Manfred_Arndt(at)t-online.de
var AussenOrient = '&#114;&#101;&#122;&#097;&#046;&#122;&#097;&#110;&#100;&#105;&#101;&#104;&#064;&#122;&#101;&#116;&#099;&#046;&#100;&#101;'; //reza.zandieh(at)zetc.de
var FrankreichNWParis ='&#113;&#117;&#101;&#110;&#101;&#101;&#116;&#104;&#111;&#115;&#097;&#099;&#064;&#097;&#111;&#108;&#046;&#099;&#111;&#109;'; //queneethosac(at)aol.com
var FrankreichNO ='&#106;&#101;&#097;&#110;&#045;&#108;&#117;&#099;&#046;&#109;&#097;&#116;&#101;&#106;&#105;&#099;&#101;&#107;&#064;&#119;&#097;&#110;&#097;&#100;&#111;&#111;&#046;&#102;&#114;'; //jean-luc.matejicek(at)wanadoo.fr
var FrankreichSW = '&#114;&#101;&#098;&#111;&#117;&#108;&#108;&#111;&#114;&#064;&#097;&#111;&#108;&#046;&#099;&#111;&#109;'; //Reboullor(at)aol.com
var FrankreichSO = '&#099;&#104;&#114;&#105;&#115;&#116;&#105;&#110;&#101;&#046;&#114;&#101;&#100;&#111;&#110;&#110;&#101;&#116;&#051;&#052;&#064;&#111;&#114;&#097;&#110;&#103;&#101;&#046;&#100;&#101;'; // Christine.redonnet34(at)orange.de

var infoAlina = '&#105;&#110;&#102;&#111;&#064;&#097;&#108;&#105;&#110;&#097;&#046;&#100;&#101;'; // info_at_alina

function WriteLink( adrNum, adrText )
{
	document.write('<a href="mail');
	
	if( adrNum >= 0 )
	{
		document.write('to:' + rln[adrNum] + '@');
		document.write(sld + '.' + tld + '">' + rln[adrNum] + '@' + sld + '.' + tld + '</a>');
	}
	else
	{
		document.write('to:' + adrText );
		document.write('">' + adrText + '</a>');
	}
}

/* --------------------------------------------------------- */
/* Sprachwahl in Weblication                                 */
/* --------------------------------------------------------- */
function AppendLang( pUrl, pLang )
{
	
	var _Url = pUrl
	_Url = _Url.replace(/LANG=[A-Za-z][A-Za-z]/, '');
	if( _Url.indexOf('?') < 0 )
	{
		_Url += '?';
	}
	else
	{
		_Url += '&';
	}
	_Url = _Url + 'LANG=' + pLang;
	return _Url;
}

/* --------------------------------------------------------- */
/* DHTML-Bibliothek                                          */
/* --------------------------------------------------------- */

var DHTML = false, DOM = false, MSIE4 = false, NS4 = false, OP = false;

if (document.getElementById) {
  DHTML = true;
  DOM = true;
} else {
  if (document.all) {
    DHTML = true;
    MSIE4 = true;
  } else {
    if (document.layers) {
      DHTML = true;
      NS4 = true;
    }
  }
}
if (window.opera) {
  OP = true;
}

function getElement (Mode, Identifier, ElementNumber) {
  var Element;
  if (DOM) {
    if (Mode.toLowerCase() == "id") {
      if (typeof document.getElementById(Identifier) == "object") {
        Element = document.getElementById(Identifier);
      } else {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "name") {
      var ElementList = document.getElementsByName(Identifier);
      if (typeof ElementList == "object" || (OP && typeof ElementList == "function")) {
        Element = ElementList[ElementNumber];
      } else {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "tagname") {
      var ElementList = document.getElementsByTagName(Identifier);
      if (typeof ElementList == "object" || (OP && typeof ElementList == "function")) {
        Element = ElementList[ElementNumber];
      } else {
        Element = false;
      }
      return Element;
    }
    return null;
  }
  if (MSIE4) {
    if (Mode.toLowerCase() == "id") {
      if (typeof document.all[Identifier] == "object") {
        Element = document.all[Identifier];
      } else {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "tagname") {
      if (typeof document.all.tags(Identifier) == "object") {
        Element = document.all.tags(Identifier)[ElementNumber];
      } else {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "name") {
      if (typeof document[Identifier] == "object") {
        Element = document[Identifier];
      } else {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  if (NS4) {
    if (Mode.toLowerCase() == "id" || Mode.toLowerCase() == "name") {
      if (typeof document[Identifier] == "object") {
        Element = document[Identifier];
      } else {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "index") {
      if (typeof document.layers[Identifier] == "object") {
        Element = document.layers[Identifier];
      } else {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  return false;
}

function getContent (Mode, Identifier, ElementNumber) {
  var Content;
  var Element = getElement(Mode, Identifier, ElementNumber);
  if (!Element) {
    return false;
  }
  if (DOM && Element.firstChild) {
    if (Element.firstChild.nodeType == 3) {
      Content = Element.firstChild.nodeValue;
    } else {
      Content = "";
    }
    return Content;
  }
  if (MSIE4) {
    Content = Element.innerText;
    return Content;
  }
  return false;
}

function getAttribute (Mode, Identifier, ElementNumber, AttributeName) {
  var Attribute;
  var Element = getElement(Mode, Identifier, ElementNumber);
  if (!Element) {
    return false;
  }
  if (DOM || MSIE4) {
    Attribute = Element.getAttribute(AttributeName);
    return Attribute;
  }
  if (NS4) {
    if (typeof Element[ElementNumber] == "object") {
      Attribute = Element[ElementNumber][AttributeName];
    } else {
      Attribute = Element[AttributeName]
    }
    return Attribute;
  }
  return false;
}

function setContent (Mode, Identifier, ElementNumber, Text) {
  var Element = getElement(Mode, Identifier, ElementNumber);
  if (!Element) {
    return false;
  }
  if (DOM && Element.firstChild) {
    Element.firstChild.nodeValue = Text;
    return true;
  }
  if (MSIE4) {
    Element.innerText = Text;
    return true;
  }
  if (NS4) {
    Element.document.open();
    Element.document.write(Text);
    Element.document.close();
    return true;
  }
}

/* --------------------------------------------------------- */
/* Allgemeine Hilfsfunktionen fuer P+S                       */
/* --------------------------------------------------------- */
function setUpperImage()
{
	var imgSrc = getCookie( "upperImage" );
	if ( imgSrc == null )
	{
		// 5 verschiedenen Bilder stehen zur Auswahl
		var imgNumber = Math.ceil( Math.random()*5 );
		imgSrc = "upper" + imgNumber;
		setCookie( "upperImage", imgSrc, null, "/" );
	}
	var _img = getElement( "id", "upper" );
	var _oldsrc = _img.src;
	_img.src = _oldsrc.replace(/upper\d/, imgSrc );
}

function openCenterWindow(sURL, winName, winWidth, winHeight, features)
{
	var winLeft = (screen.width - winWidth) / 2;
	var winTop = (screen.height - winHeight) / 2;
	var winFeatures = 'height='+winHeight+',width='+winWidth+',top='+winTop+',left='+winLeft+','+features;
	myNewWindow = window.open(sURL, winName, winFeatures);
	myNewWindow.focus();
}


/* Prüfungen für Infoanforderung */
function checkDataInfo()
{
 if (document.signup.Firma.value == "")
 {
  alert("Bitte geben Sie Ihren Firmennamen an.")
  document.signup.Firma.focus()
  return false
 }
 if (document.signup.Ansprechpartner.value == "")
 {
  alert("Bitte geben Sie Ihren Namen an.")
  document.signup.Ansprechpartner.focus()
  return false
 }
 if (document.signup.PLZ.value == "")
 {
  alert("Bitte geben Sie Ihre PLZ an.")
  document.signup.PLZ.focus()
  return false
 }
 if (document.signup.Ort.value == "")
 {
  alert("Bitte geben Sie Ihren Ort an.")
  document.signup.Ort.focus()
  return false
 }
 if (document.signup.Telefon.value == "")
 {
  alert("Bitte geben Sie Ihre Telefon-Nr an.")
  document.signup.Telefon.focus()
  return false
 }
 else return window.confirm("Sind alle Angaben korrekt?");
 }

 
/* --------------------------------------------------------- */
/* Funktionen fuer die Verwaltung von Cookies                */
/* --------------------------------------------------------- */

// name - name of the cookie
// value - value of the cookie
// [expires] - expiration date of the cookie (defaults to end of current session)
// [path] - path for which the cookie is valid (defaults to path of calling document)
// [domain] - domain for which the cookie is valid (defaults to domain of calling document)
// [secure] - Boolean value indicating if the cookie transmission requires a secure transmission
// - an argument defaults when it is assigned null as a placeholder
// - a null placeholder is not required for trailing omitted arguments
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;
}

// name - name of the desired cookie
// - return string containing value of specified cookie or null if cookie does not exist
function getCookie( name )
{
	var dc = document.cookie;
	var prefix = name + "=";
	var begin = dc.indexOf("; " + prefix);
	if (begin == -1)
	{
		begin = dc.indexOf(prefix);
		if (begin != 0) return null;
	}
	else
	{
		begin += 2;
	}
	var end = document.cookie.indexOf(";", begin);
	if (end == -1) end = dc.length;
	return unescape(dc.substring(begin + prefix.length, end));
}

// name - name of the cookie
// [path] - path of the cookie (must be same as path used to create cookie)
// [domain] - domain of the cookie (must be same as domain used to create cookie)
// - path and domain default if assigned null or omitted if no explicit argument proceeds
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";
	}
}