//<html>
//<head><!-- PageID 14 - published by RedDot 7.1 - 7.1.0.22 - 16807 -->
//<title></title>
//template="con_901_source_js"
//RD_title="ca_jslib.js"
//RD_ownID="14"
//RD_ownURL="/ca_sys/js/ca_jslib.js"
//</head>
//<body>


// Konstanten
   var satellitWidth=436;
   var satellitHeight=462;
// Parameter fuer window.open
   arrSatParams = new Array();
   arrSatParams["newwindow"]     = "";
   arrSatParams["sat_standard"]     = "width=436,height=462,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0 ";
   arrSatParams["sat_wide"]         = "width=740,height=500,resizable=1,status=1,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0 ";
   arrSatParams["sat_wide_toolbar"] = "width=740,height=500,resizable=1,status=1,scrollbars=1,toolbar=1,location=0,directories=0,menubar=0 ";
   arrSatParams["sat_wide_menue"]   = "width=740,height=500,resizable=1,status=1,scrollbars=1,toolbar=0,location=0,directories=0,menubar=1 ";
   arrSatParams["sat_size_510"]   = "width=510,height=420,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0 ";
// arrHandleLink[] wird im Standard Content Template definiert:
function handleLink( iLinkNum ) {
     iLinkNum = iLinkNum + "";
     // Open page int his window
     if( arrHandleLink[iLinkNum]["mode"] == "self" || arrHandleLink[iLinkNum]["mode"] == "" ) {
          self.location = arrHandleLink[iLinkNum]["url"];
     }
     // Open page in popup window
     else {
          sParams = arrSatParams[ arrHandleLink[iLinkNum]["mode"] ];
          sUrl = arrHandleLink[iLinkNum]["url"];
          newwin = window.open( sUrl, "sat", sParams)
          if(window.focus) newwin.focus();
     }
}
// Satellit oeffnen
function popup( myfile){
    winname = "PopUp"
    params = "width="+satellitWidth+",height="+satellitHeight+
                            ",resizable=0,status=0,toolbar=0,location=0,directories=0,menubar=0,scrollbars=1";
    if (myfile.substr(0,6) == "/http:"){
      myfile = myfile.substr(1);
    }
    newwin = window.open( myfile, winname , params)
    if (window.focus) newwin.focus();
}
function openImprint() {
  if(sLanguageGUID == "DEU") {
  file  = "http://www.voith.de/4968.htm";
  }else{
  file  = "http://www.voith.de/e_satellite_kontakt_impressum.htm";
  }
  winname = "kontakt";
  params  = "width=436,height=462,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0 ";
  kontaktWin = window.open( file, winname , params);
  if(window.focus) setTimeout("kontaktWin.focus()",100);  // ohne setTimeout klappt das auf IE5 nicht!
}
function openSitemap() {
  if(sLanguageGUID == "DEU") {
  file  = "/sat_de_sitemap.php";
  }else{
  file  = "/sat_en_sitemap.php";
  }
  winname = "sitemap";
  params  = "width=436,height=462,resizable=1,status=0,scrollbars=1,toolbar=0,location=0,directories=0,menubar=0 ";
  sitemapWin = window.open( file, winname , params);
  if(window.focus) setTimeout("sitemapWin.focus()",100);  // ohne setTimeout klappt das auf IE5 nicht!
}
function addEntry(objSelect, strValue, strText) {
 var i = objSelect.options.length;
 objSelect.options.length++;
    objSelect.options[i].text = strText;
    objSelect.options[i].value = strValue;
}
function selectValue(objSelect, strValue) {
 for(var i=0; i<objSelect.options.length; i++) {
  if(objSelect.options[i].value == strValue) objSelect.selectedIndex = i;
 }
}

function fillSelection1() {
 // Zuruecksetzen
 objSel1.options.length = 0;
 // Erster Eintrag
 addEntry(objSel1, "", arrNameTable[sLanguageGUID]["titles"]["selection1"]);
 // Trennzeichen
 addEntry(objSel1, "", arrNameTable[sLanguageGUID]["titles"]["spacer"]);
 // Alle Eintraege hinzufuegen
 for(var thisEntry in arrNameTable[sLanguageGUID]["chapters"]) {
  addEntry(objSel1, thisEntry, arrNameTable[sLanguageGUID]["chapters"][thisEntry]);
 }
}

function fillSelection2(bolChangedSelection1, bolChangedSelection3) {
 var strOldValue = objSel2.options[objSel2.selectedIndex].value;
 var strChapter = objSel1.options[objSel1.selectedIndex].value;
 if(strChapter == '') strChapter = 'all';
 // Zuruecksetzen
 objSel2.options.length = 0;
 // Erster Eintrag
 addEntry(objSel2, "", arrNameTable[sLanguageGUID]["titles"]["selection2"]);
 // Trennzeichen
 addEntry(objSel2, "", arrNameTable[sLanguageGUID]["titles"]["spacer"]);
 if((bolChangedSelection1 && objSel1.options[objSel1.selectedIndex].value != "") || (bolChangedSelection3 && objSel3.options[objSel3.selectedIndex].value != "")) {
  // Nur die Eintraege abhaengig vom gewaehlten Chapter anzeigen
  if(bolChangedSelection1) {
   thisArray = arrLinkTable[strChapter]["functions"];
   for(var thisEntry in thisArray) {
    addEntry(objSel2, thisEntry, arrNameTable[sLanguageGUID]["functions"][thisEntry]);
   }
  }
  // Nur die Eintraege abhaengig vom gewaehlten Land anzeigen
  if(bolChangedSelection3) {
   thisArray = arrLinkTable[strChapter]["countries"][objSel3.options[objSel3.selectedIndex].value];
   for(i=0; i<thisArray.length; i++) {
    addEntry(objSel2, thisArray[i], arrNameTable[sLanguageGUID]["functions"][thisArray[i]]);
   }
  }
 }else{
  // Alle Eintraege hinzufuegen
  for(var thisEntry in arrLinkTable["all"]["functions"]) {
   addEntry(objSel2, thisEntry, arrNameTable[sLanguageGUID]["functions"][thisEntry]);
  }
 }
 // Den alten Wert wieder auswaehlen
 if(strOldValue != "") selectValue(objSel2, strOldValue);
}
function fillSelection3(bolChangedSelection2) {
 var strOldValue = objSel3.options[objSel3.selectedIndex].value;
 var strChapter = objSel1.options[objSel1.selectedIndex].value;
 if(strChapter == '') strChapter = 'all';
 // Zuruecksetzen
 objSel3.options.length = 0;
 // Erster Eintrag
 addEntry(objSel3, "", arrNameTable[sLanguageGUID]["titles"]["selection3"]);
 // Trennzeichen
 addEntry(objSel3, "", arrNameTable[sLanguageGUID]["titles"]["spacer"]);
 if(bolChangedSelection2 && objSel2.options[objSel2.selectedIndex].value != "") {
  // Nur die Eintraege abhaengig von der gewaehlten Funktion anzeigen
  thisArray = arrLinkTable[strChapter]["functions"][objSel2.options[objSel2.selectedIndex].value];
  for(i=0; i<thisArray.length; i++) {
   addEntry(objSel3, thisArray[i], arrNameTable[sLanguageGUID]["countries"][thisArray[i]]);
  }
 }else{
  // Alle Eintraege hinzufuegen
  for(var thisEntry in arrLinkTable[strChapter]["countries"]) {
   addEntry(objSel3, thisEntry, arrNameTable[sLanguageGUID]["countries"][thisEntry]);
  }
 }
 // Den alten Wert wieder auswaehlen
 if(strOldValue != "") selectValue(objSel3, strOldValue);
}
// INITIALISIERUNG JOBDATA
function fillJobDataDropDowns() {
 if(bolJobDataLibLoaded) {
  // Erstes DropDown befuellen
  fillSelection1();
  // Erstes DropDown vorbelegen
  if(window.sCareerChapter && sCareerChapter != "") selectValue(objSel1, sCareerChapter);
  // Zweites und drittes DropDown befuellen
  if(objForm.restoreValue1.value != "") {
   selectValue(objSel1, objForm.restoreValue1.value);
  }
  fillSelection2(true, false);
  fillSelection3(true);
  if(objForm.restoreValue2.value != "") selectValue(objSel2, objForm.restoreValue2.value);
  if(objForm.restoreValue3.value != "") selectValue(objSel3, objForm.restoreValue3.value);
 }else{
  setTimeout("fillJobDataDropDowns()", 500);
 }
}
function openInitiativ() {
 if(bolJobDataLibLoaded) {
  newWin = window.open( arrNameTable[sLanguageGUID]["urls"]["initiativ"], 'newWin' , '');
 }else{
  setTimeout("fillJobDataDropDowns()", 500);
 }
}
function openJob(id) {
 objForm.id.value = id;
 objForm.submit();
}
// fuer standorte:
// Satellit fuer Wegbeschreibung oeffnen
  function routing(myfile){
    winname = "routing"
    params = "width=600,height="+satellitHeight+
  ",resizable=1,status=0,toolbar=0,location=0,directories=0,menubar=1,scrollbars=1";
    newwin = window.open( myfile, winname , params)
    if (window.focus) newwin.focus();
  }
var gright = 750;
var gbottom = 30;
bolJsLibLoaded = true;
function etracker_trim_pagename(strTitle) {
 // Leerzeichen entfernen
 strTitle = strTitle.replace(/ /g, '');
 // Auf 60 Zeichen begrenzen
 if(strTitle.length > 60) {
  // Testen, ob ein Umlaut in den letzten 7 Zeichen vorhanden ist, wenn ja, dann davor abschneiden
  intUndPos = strTitle.lastIndexOf("&");
  intSpacePos = strTitle.lastIndexOf(" ");
  if(intUndPos > 53 && intUndPos > intSpacePos) {
    strTitle = strTitle.substr(0, intUndPos);
  }
  strTitle = strTitle.substr(0, 59);
  strTitle += ')';
 }
 return strTitle;
}
// eTracker Funktion fuer die korrekte Schreibweise des Bereichs
function etracker_trim_pagearea(strText) {
 strText = strText.replace(/\&amp;/,"");
 strText = strText.replace(/,/," ");
 strText = strText.replace(/  /," ");
 strText = strText.replace(/\+/,"");
 return strText;
}

// -----------------------------------------------------------------
// Erzeugt Hit in eTracker
function trackDownload(strFile,strID,strLanguage) {
   var strThisFile = extractFileName(strFile);
    streTrackerName = etracker_trim_pagename("Download:" + strThisFile + "(" + strID + ":" + strLanguage + ")");
    streTrackerHitUrl = "http://www.etracker.de/cnt.php?" +
                        "et=" + strEtrackercode +
                        "&java=n"+
                        "&et_easy=0"+
                        "&et_pagename="+streTrackerName+
                        "&et_areas=all/downloads/"+
                        "&et_ilevel=0"+
                        "&et_target=,,,0&et_lpage=&et_trig=";
    document.eTrackerLoadTarget.src = streTrackerHitUrl;
    openWinDownload(strFile);
    return false;
}
function openWinDownload(strUrl){
  params = "";
  var now=new Date();  winname="a" + now.getTime();
  newwin = window.open( strUrl, winname , params)
  if( window.focus ) newwin.focus();
}
// extractFileName
function extractFileName(fullPath) {
  var lastSlash // the position of the last slash in the path
  var fileName  // the name of the file
  lastSlash = fullPath.lastIndexOf("/")
  fileName = fullPath.substring(lastSlash+1,fullPath.length)
  return fileName
}

//</body>
//</html>
// reddot needs this:
//