
/*********************************************************************
swapContent() changes the Map as well as the address content
*********************************************************************/

function swapContent(fieldId, mainImg) {

for(var i = 0; i < document.formDistribution.elements[0].length; i++)
  {
  if(document.getElementById(document.formDistribution.elements[0].options[i].value))
    {
    if(document.formDistribution.elements[0].options[i].value == fieldId)
      {
	  if(mainImg == 1)
	    {
		var imgSet = 1;
		}
      else
	    {
	    var imgSet = 1;
        document.getElementById('Karte').src = "../assets/" + document.formDistribution.elements[0].options[i].value + ".gif";
		}
      document.getElementById(document.formDistribution.elements[0].options[i].value).style.display = 'block';
      }
    else
      {
      document.getElementById(document.formDistribution.elements[0].options[i].value).style.display = 'none';
      }
    }
  }
if(imgSet != 1)
  {
  document.getElementById('Karte').src = mapMainImg;
  }
if(document.getElementById(fieldId))
  {
  document.getElementById(fieldId).style.display = 'block';
  }
}


function swapImg(fieldId, pathGiven) {
  if(pathGiven == 0)
    {
    document.getElementById('Karte').src = fieldId;
    }
  else if(pathGiven == 1)
    {
    document.getElementById('Karte').src = "../assets/" + fieldId + ".gif";
    }
}

function openWindow(winsource,width,height) {
var scroll = false;

  if(scroll) {
    scroll = ", scrollbars";
    }
  NeuesFenster = window.open(winsource,"fenster","width="+width+", left=100, top=100, height="+height+", locationbar=no, menubar=no,statusbar=no,toolbar=no,resizable=no"+scroll);
}

function switchLanguage(form){
var URL = document.Sprachwahl.Sprache.options[document.Sprachwahl.Sprache.selectedIndex].value;
window.location.href = URL;
}

function switchProduct(form){
var URL = document.Produkt.products.options[document.Produkt.products.selectedIndex].value;
window.location.href = URL;
}

var logo;
var oldScroll = -10;
var oldHeight = 0;
var oldWidth = 0;
var browser = navigator.appVersion;
var macnoscroll = 0;

function init() {
  logo = new getObj('logo');
  movemenu();
}

function movemenu() {

  if (window.innerHeight) {  //Netscape Version
	  winHeight = window.innerHeight;
		winWidth  = document.width;
    posScroll = window.pageXOffset;
  }
  else if (document.body) {  //IE Version
	  winHeight = document.body.clientHeight;
		winWidth  = document.body.clientWidth;
    posScroll = document.body.scrollLeft;
  }

	if(winHeight < 420){
	  winHeight = 420;
	}

    logo.style.left  = posScroll + winWidth - 179;

	oldHeight = winHeight;
	oldWidth  = winWidth;
 oldScroll = posScroll;

  temp = setTimeout('movemenu()',1000);
  }

function getObj(name) {
  if (document.getElementById) {
        this.obj = document.getElementById(name);
        this.style = document.getElementById(name).style;
  }
  else if (document.all) {
        this.obj = document.all[name];
        this.style = document.all[name].style;
  }
  else if (document.layers) {
        this.obj = document.layers[name];
        this.style = document.layers[name];
  }
}