//------------------------------------------------------------------------------
//  JavaScript Common Functions 1.0
//  Common Unit (common.js)
//  Copyright 1997-2003 Imediacom AG. All rights reserved.      www.imediacom.ch
//------------------------------------------------------------------------------

window.onerror = stopErrors;

browserType = navigator.appName;
browserVers = parseInt(navigator.appVersion);

if (location.pathname.indexOf('index_') == -1 && location.pathname.indexOf('search_') == -1) {
  if (location.pathname.indexOf('.asp') != -1) {
    if (location.protocol != 'http:') {
      if (location.pathname.indexOf('de.') != -1) {
        alert('Fehler: ASP Webserver benötigt!');
      }
      else {
        alert('Error: ASP web server required!');
      }
    }
  }
}

//------------------------------------------------------------------------------
function stopErrors() {
//------------------------------------------------------------------------------

  //return true;
}

//------------------------------------------------------------------------------
//function changeLanguage() {
//------------------------------------------------------------------------------

//  intTemp = top.location.href.indexOf('.htm');
  //alert(intTemp)
//  if (intTemp == -1) {
//    intTemp = top.location.href.indexOf('.asp');
//  }
//  strLangA = top.location.href.substring(intTemp + 1, intTemp - 2);
//  strLangB = document.lang.lang.options[document.lang.lang.selectedIndex].value;
//  strTemp = replaceString(top.location.href, strLangA, strLangB);
//  strTemp = replaceString(strTemp, "musikantde", "musikanten");
//  window.location.href = strTemp;
//}

//------------------------------------------------------------------------------
function CMI(Indent, PAR, URL, Target, Text) {
//------------------------------------------------------------------------------
 
  if (location.href.indexOf(URL) == -1) {
    Class = 'L03';
    Img = '.gif';
  }
  else {
    Class = 'L04';
    if (URL != '-') {
      Img = 'hl.gif';
    }
    else {
      Img = '.gif';
    } 
  }

  if (location.href.indexOf(PAR) != -1) {

    if (Text != '-') {
      document.write('<img border="0" src="ressourcen/menuitem' + Indent + Img + '"');
      document.write(' hspace="3">');
    }
    else {
      Text = '';
    }

    if (URL != '-') {
//      document.write('<a class="' + Class + '" href="ressourcen/' + URL);
      document.write('<a class="' + Class + '" href="' + URL);
      document.write('" target="' + Target);
      document.write('">');  
    }

    document.write(Text);
    document.write('</a><br>');
  }
}

//------------------------------------------------------------------------------
function mailto(user, domain1, domain2, subject, body) {
//------------------------------------------------------------------------------

  window.location = 'mailto:' + user + '@' + domain1 + '.' + domain2 + 
    '?subject=' + subject + '&body=' + body;  
}


//------------------------------------------------------------------------------
function onPageLoaded() {
//------------------------------------------------------------------------------

}

//------------------------------------------------------------------------------
function onPageResize() {
//------------------------------------------------------------------------------

}

//------------------------------------------------------------------------------
function replaceString(str1, str2, str3) {
//------------------------------------------------------------------------------

   var strLength = str1.length;
   var txtLength = str2.length;

   if ((strLength == 0) || (txtLength == 0)) {
     return str1;
   }

   var i = str1.indexOf(str2);

   if ((!i) && (text1 != str1.substring(0, txtLength))) {
     return str1;
   }

   if (i == -1) {
     return str1;
   }

   var newstr = str1.substring(0, i) + str3;

   if (i + txtLength < strLength) {
      newstr += replaceString(str1.substring(i+txtLength, strLength), str2, str3);
   }
   return newstr;
}

//------------------------------------------------------------------------------
function showPageTitle() {
//------------------------------------------------------------------------------

  document.write('<b>' + document.title + '</b><br>');
  document.write('<img border="0" src="ressourcen/line610.gif"');
  document.write(' width="440" height="7"><br><br>');

}

//------------------------------------------------------------------------------
