﻿/*PopUp window function */
function popUp(page,PWidth,PHeight,id) {
 	eval("popupwin"+id+"=window.open('"+page+"','popupwin1','toolbar=0,scrollbars=0,location=0,status=0,menubars=0,resizable=0,width="+PWidth+",height="+PHeight+"')")
	eval("popupwin"+id+".window.moveTo((screen.width/2)-(PWidth/2),(screen.height/2)-(PHeight/2))")

eval('"popupwin"+id+".location.href="+page+".html"');
}
/*Insert a mailto link */
function InsertMailLink(name,address,domain,subject,text)
{
	emailE=(name + '@' + address + '.' + domain)
	if (text=="") {
		text=emailE
	}
	document.write('<a href="mailto:' + emailE +'?subject=' + subject + '">' + text + '</a>')
}


/*Insert QuickTime movies */
function InsertSpotZweiMovie()
{
document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="240" HEIGHT="200" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
document.write('<param name="SRC" value="spot02.mov" />\n');
document.write('<param name="AUTOPLAY" value="true" />\n');
document.write('<param name="CONTROLLER" value="false" />\n');
document.write('<param name="LOOP" value="true" />\n');
document.write('<param name="PLAYEVERYFRAME" value="true" />\n');
document.write('<EMBED SRC="spot02.mov" PLUGINSPAGE="http://quicktime.apple.com" WIDTH=240 HEIGHT=200 CONTROLLER="false" LOOP="true" AUTOPLAY="true" PLAYEVERYFRAME="true"/>\n');
document.write('</object>\n');
}

function InsertSpot34Movie()
{
document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="480" HEIGHT="360" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
document.write('<param name="SRC" value="spot34.mov" />\n');
document.write('<param name="AUTOPLAY" value="true" />\n');
document.write('<param name="CONTROLLER" value="false" />\n');
document.write('<param name="LOOP" value="true" />\n');
document.write('<param name="PLAYEVERYFRAME" value="false" />\n');
document.write('<EMBED SRC="spot34.mov" PLUGINSPAGE="http://quicktime.apple.com" WIDTH=480 HEIGHT=360 CONTROLLER="false" LOOP="true" AUTOPLAY="true" PLAYEVERYFRAME="false"/>\n');
document.write('</object>\n');
}

function InsertSpot38Movie()
{
document.write('<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" WIDTH="480" HEIGHT="360" CODEBASE="http://www.apple.com/qtactivex/qtplugin.cab">\n');
document.write('<param name="SRC" value="spot38.mov" />\n');
document.write('<param name="AUTOPLAY" value="true" />\n');
document.write('<param name="CONTROLLER" value="false" />\n');
document.write('<param name="LOOP" value="true" />\n');
document.write('<param name="PLAYEVERYFRAME" value="false" />\n');
document.write('<EMBED SRC="spot38.mov" PLUGINSPAGE="http://quicktime.apple.com" WIDTH=480 HEIGHT=360 CONTROLLER="false" LOOP="true" AUTOPLAY="true" PLAYEVERYFRAME="false"/>\n');
document.write('</object>\n');
}

/* 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, ElementList;
  if (DOM) {
    if (Mode.toLowerCase() == "id") {
      Element = document.getElementById(Identifier);
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "name") {
      ElementList = document.getElementsByName(Identifier);
      Element = ElementList[ElementNumber];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "tagname") {
      ElementList = document.getElementsByTagName(Identifier);
      Element = ElementList[ElementNumber];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  if (MSIE4) {
    if (Mode.toLowerCase() == "id" || Mode.toLowerCase() == "name") {
      Element = document.all(Identifier);
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "tagname") {
      ElementList = document.all.tags(Identifier);
      Element = ElementList[ElementNumber];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  if (NS4) {
    if (Mode.toLowerCase() == "id" || Mode.toLowerCase() == "name") {
      Element = document[Identifier];
      if (!Element) {
        Element = document.anchors[Identifier];
      }
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    if (Mode.toLowerCase() == "layerindex") {
      Element = document.layers[Identifier];
      if (!Element) {
        Element = false;
      }
      return Element;
    }
    return false;
  }
  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) {
    Attribute = Element[AttributeName]
    if (!Attribute) {
       Attribute = false;
    }
    return Attribute;
  }
  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 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;
  }
}