
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}

MM_reloadPage(true);

function changeLanguage()
{
  var source = document.URL;
  var pathElements = source.split('/');
  var target = 'http:/';
  var anzahl = pathElements.length;
  
  // get current language directory
  var oldLang = '';
  
  var newLang = '';

  // get from form which language was selected
  // Note: the language directory must have the same abbreviation as the corresponding language
  for (var i=0; i < document.formLangOpts.langOpts.length; i++) {
    if (document.formLangOpts.langOpts.options[i].selected == true) {
      newLang = document.formLangOpts.langOpts[i].value;
    }
  }


  if (anzahl == 3) {
       target = target + '/' + pathElements[2] + '/' + newLang + '/';}
  else {
  // build that part of the URL which is before the language directory   
  for (var i=2; i < anzahl; i++) {
    if (pathElements[i] == 'de' || pathElements[i] == 'en') {
       oldLang = pathElements[i];
       target = target + '/' + newLang;}
    else {
       target = target + '/' + pathElements[i];
    }
  }
  }

  // set the action param on the form to the new URL of target page
  // submit the current page to the server to cause the redirection to the new URL
  document.formLangOpts.langOpts.value = oldLang;
  document.formLangOpts.action = target;
  document.formLangOpts.submit();
}

var changelinks=new Array()



function changeSection()
{
  var value = ''
  var source = document.URL;
  var pathElements = source.split('/');
  var anzahl = pathElements.length;
  var target = '';

  // get links
  for (i=0;i<changeSection.arguments.length;i++)
  changelinks[i]=changeSection.arguments[i]


  // get from form which new target was selected
  for (var i=0; i < document.formSections.newSections.length; i++) {
    if (document.formSections.newSections.options[i].selected == true) {
      value = document.formSections.newSections[i].value;
    }
  }

  // build the URL for the new target  
  

    switch (value) {
	case "0" :
target = target + 'http://www.maccurl.de/de/index.html';
break;
case "1" :
target = target + 'http://www.maccurl.de/de/index.html';
break;
case "2" :
target = "";
break;
case "3" :
target = "";
break;
default : target = "";
	 }

 
  // set the action param on the form to the URL of the new target
  // submit the current page to the server to cause the redirection to the new target page
  if (value != "(no selection)") {
    document.formSections.action = target;
    document.formSections.submit();
  }

}

function writeElement()
{
   str = "<option value=" + this.index + " >" + this.text + "</option>"	
   document.write(str); 
}

function listElement(i, t, u, z)
{
	this.index = i;
	this.myurl = u;
	this.text = t;
	this.ziel = z;
    this.writeElement=writeElement;
}

function callPage()
{
	i = document.formSections.newSections.value;
	if ( i == "" ) return;
	z = la[i].ziel;
	if ( z == 0 ) 
	{
          window.location=la[i].myurl;
    	}
	else {
	if (!window.www||www.closed)
    	  www=window.open(la[i].myurl)
	else
	  www.location=la[i].myurl
	  www.focus()
    	}
    
}	

