/*
<html>
<head><!-- PageID 1362 - published by RedDot 7.1 - 7.1.0.22 - 29619 -->
<title>special_vp_export_sys_js_voithpaper_lib_en.js</title>
<head>
<body>
<!--
template="con_901_js"
title="special_vp_export_sys_js_voithpaper_lib_en.js"
ownID="1362"
ownURL="/sys/js/vp_lib_en.js"
-->
*/
//Author Markus
//Creation Date 20010505
//
//Changes
// + adding MM_findObj
// + adding MM_swapImage
//
// 2001-06-08 Flori
// o modify changesvalue because ie5 bug
//

// Konstanten
   var satellitWidth=436;
   var satellitHeight=462;

   var imgCheckboxOn  = "/sys/images/checkbox-on.gif";
   var imgCheckboxOff = "/sys/images/checkbox-off.gif";

// 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";
    newwin = window.open( myfile, winname , params)
    if (window.focus) newwin.focus();
  }
*/

// 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();
  }

//mailto
function mailto(to){  
  //popup("http://"+location.hostname+"/sys/php/d_satellite_kontakt_mailformular.php3?to="+to);
  var sUrl = location.hostname;

  if( sUrl.indexOf("www.voith") == -1) {
    sUrl = "www.voith.com";   
  }

  if(sVoithLibLanguage == 'de') {
      popup("http://"+sUrl +"/d_satellite_kontakt_mailformular.php3?to="+to);
  }else{
      popup("http://"+sUrl +"/e_satellite_kontakt_mailformular.php3?to="+to);
  }
}




// Grafische Checkboxen
  //  Diese Funktion arbeitet wie ein FlipFlop, sie setzt den Value eines
  //  Formularfelds auf FALSE (-> Leerstring) wenn es vorher einen Wert
  //  besitzt andernfalls auf TRUE (-> valueTrue), wenn es vorher leer war
  //  Wenn der Parameter doSubmit gesetzt ist, wird die Form-Action ausgefuehrt

  var ignoreClick = false;

  function changevalue(formName,FieldName,valueTrue,doSubmit) {
      //alert("changevalue("+formName+","+FieldName+","+valueTrue+","+doSubmit+")");
      // Wenn nach dem Klicken der Checkbox ein submit() ausgefuehrt wird, werden alle weiteren click,
      // die noch auf der 'alten' Seite durchgefuehrt werden ignoriert
      if( !ignoreClick ) {
        var checkBoxImage = "";
      // Wert des Hidden Field aendern

        if( window.document.forms[formName]
          && window.document.forms[formName].elements[FieldName] ) {
          var FieldNameNbr=-1;
          for (i=0;i < window.document.forms[formName].elements.length;i++){
            if (window.document.forms[formName].elements[i].name == FieldName){
              FieldNameNbr=i;
            }
          }
          if (FieldNameNbr>=0){
            svalue = window.document.forms[formName].elements[FieldNameNbr].value;
            if (( svalue  == "") || ( svalue  == "0") || (!svalue )) {
              window.document.forms[formName].elements[FieldNameNbr].value = valueTrue;
              checkBoxImage = imgCheckboxOn;
            } else {
             window.document.forms[formName].elements[FieldNameNbr].value = "";
             checkBoxImage = imgCheckboxOff;
            }
          } else {
            alert ('Internal Error:')
          }
        } else {
          alert ('Internal Error:')
        }
        // Grafik der Checkbox aendern,
        //name der Grafik ist gleich dem namen des Hidden Field
      if( window.document.images[FieldName]){
         window.document.images[FieldName].src=checkBoxImage;
      }

      if( doSubmit!=0  && doSubmit!="" ) window.document.forms[formName].submit();
    }
  }

/********************************************************************************
Zusaetzliche Scripts zum GIF-Wechseln in Nav1
********************************************************************************/
//Flori: war urspruenglich im menu script
//
/*
function MM_findObj(n, d) { //v4.0
  var p,i,x;
  if(!d) d=document;
  if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document;
    n=n.substring(0,p);
  }
  if(!(x=d[n])&&d.all) x=d.all[n];
  for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && document.getElementById) x=document.getElementById(n);  // flori
  return x;
}
function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
       document.MM_sr[j++]=x;
    if(!x.oSrc) x.oSrc=x.src;
    x.src=a[i+2];
  }
}
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr;
  for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) {
    x.src=x.oSrc;
  }
}
function MM_swapMenue() { //hald 16.07.2001
  var i,j=0,x,a=MM_swapMenue.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){
       document.MM_sr[j++]=x;
    if(!x.oSrc) x.oSrc=a[i+2];
    x.src=a[i+2];
  }
}
function MM_preloadImages() { //v3.0
 var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
   var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
   if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
*/

/* cntr4_movielib cntr5_movie_slots jetzt weg 
   wird wahrschinlich erst nach dem der footer geladen ist gebraucht.... */
/********************************************************************************
URLs zum Austausch von Flashfilmen im Sat
********************************************************************************/
//

//
/********************************************************************************
Scripts von Meta zum Austausch von Flashfilmen im Sat
********************************************************************************/

sVoithLibLanguage = 'en';

function loadAni(sMovie){
  //movie2
  if ( sMovie ) {
   sMovie = sMovie.substr(5);
   sURL = "http://www.voith.com"+arrMovieLib[0]["ancFlashFrameSet"]+"?site=vp&language=en"+
          "&activemovie="+sMovie+
          "&slots="+arrSlots[0]+","+arrSlots[1]+","+arrSlots[2]+","+arrSlots[3]+","+arrSlots[4]+","+arrSlots[5];
    changemovie(sURL);
  }
}
function loadDHTMLAni(sMovie){
  if ( sMovie ) {
   sMovie = sMovie.substr(5);
   if (arrMovieLib[sMovie]["de"]["dhtmlAni"]) {
      sURL = "http://www.voith.com"+arrMovieLib[sMovie]["de"]["dhtmlAni"]+"?site=vp&language=en"+
          "&activemovie="+sMovie+
          "&slots="+arrSlots[0]+","+arrSlots[1]+","+arrSlots[2]+","+arrSlots[3]+","+arrSlots[4]+","+arrSlots[5];
      changemovie(sURL);
    }
  }
}
//------
//------
function changemovie(sURL){
  var satwin = window.open(sURL, "sat",
                       "toolbar=no,location=no,directories=no,"+
                       "status=no,menubar=no,scrollbars=no,resizable=no,"+ 
                       "WIDTH=477,HEIGHT=210");
  if (window.focus) satwin.focus();
}
//------
//------
//------
function popupEpaper(version,language){
    myfile = "http://www.voithpaper.com/applications/flipbook/twogether-"+version+"-"+language+"/twogether-"+version+".html";
    winname = "Popup";
    params = "width="+1000+",height="+645+",resizable=1,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 openDocDbFile(strNr, strPageID) {
    // 2007-02-21 url raus - sURL = 'http://www.voithturbo.com/sys/php/docdb_getfile.php?docnr=' + strNr + '&lang=' + sLanguage + '&pageid=' + strPageID;
    sURL = '/sys/php/docdb_getfile.php?docnr=' + strNr + '&lang=' + sLanguage + '&pageid=' + strPageID;
    window.open(sURL, "docdbfile" + strPageID, "resizable=yes,toolbar=no,location=no,menubar=yes,scrollbars=yes,status=yes");
}

/*
</body>
</html>
*/
//io need this
//
