
/**
 * Dieses Array wird gebraucht, um  sich den Status jeder Reihe einer Tabelle zu merken
 */
var marked_row = new Array;
/**
 * Setzt den pointer and marker 
 *
 * @param   object    die Reihe einer Tabelle 
 * @param   interger  die Nummer einer Reihe
 * @param   string    Aktion(over, out or click)
 * @param   string    DEFAULT Farbe ( background)
 * @param   string    Farbe fuer den MouseOver-Effekt
 * @param   string    Farbe fuer die markierte Reihe
 *
 * @return  boolean  Ob pointer gesetzt ist oder nicht
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    
    var theCells = null;
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. liefert die aktuelle Reihe und setzt true, wenn der Browser dies kann
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Liefert die akutelle Farbe....
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... mit DOM kompatible Browsers, ausgenommen Opera,der liefert keinen "valid" Wert mit "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... mit anderen Browsern
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Definiert die neue Farbe
    // 4.1 akutelle Farbe ist der DEFAULT Wert
        if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
        }
    }
    // 4.1.2 aktuelle Farbe ist der pointer 
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.3 aktuelle Farbe ist markiert
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    } // end 4

    // 5. Setzt die neue Farbe...
    if (newColor) {
        var c = null;
        // 5.1 ... mit DOM kompatible Browsers, ausgenommen Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... mit anderen Browsern
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

// ROLLOVER EFFEKT
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_preloadImages() { //v3.0
  var d=document; if(d.img){ 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];}}
}

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);  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 selectPage(systemland,func)
{
  var Land="D";
  Land=document.land.typnr[document.land.typnr.selectedIndex].value;
  parent.location.href='index.php?lang='+systemland+'&func='+func+'&typnr='+Land;
}

function selectPageStart(systemland,func)
{
  var Land="D";
  Land=document.landstart.typnr[document.landstart.typnr.selectedIndex].value;
  parent.location.href='index.php?lang='+systemland+'&func='+func+'&typnr='+Land;
}


function selectKabelzube(path)
{
  Anker=document.anker.typnr[document.anker.typnr.selectedIndex].value;
  parent.location.href=''+path+''+Anker;
}

function selectProdsearch(systemland,func,parentid,step,anfrageid,generatorid,searchid)
{
 
  auswahl=document.auswahl.typnr[document.auswahl.typnr.selectedIndex].value;
  parent.location.href='index.php?lang='+systemland+'&func='+func+'&parentid='+parentid+'&uparentid=showmore&step='+step+'&aid='+anfrageid+'&generatorid='+generatorid+'&sid='+searchid+'#'+auswahl;
}

function selectPageAktuelles(systemland,func)
{

  jahr=document.land.uparentid[document.land.uparentid.selectedIndex].value;
  parent.location.href='index.php?lang='+systemland+'&func='+func+'&uparentid='+jahr;
}



function Bildwechsel(Bildnr,Bildobjekt) {
	
 window.document.images[Bildnr].src = "../img/"+Bildobjekt;
}

function StartBild(Bildnr,Bildobjekt,Position,Lang) {
 
 window.document.images[Bildnr].src = "../img/einst/"+Bildobjekt;
 if(Position == 'ohne'){

 	window.document.images["oben"].src = "img/pix.gif";
	
 }
 else{
 	if(Lang == 'de')
 		window.document.images[Position].src = "img/einst/TEXT"+Bildobjekt;
 	else if(Lang == 'en')
 		window.document.images[Position].src = "img/einst/ENTEXT"+Bildobjekt;
 	else if(Lang == 'fr')
 		window.document.images[Position].src = "img/einst/FRTEXT"+Bildobjekt;
 	else 
 		window.document.images[Position].src = "img/einst/TEXT"+Bildobjekt;

 }
}

function AutomaticStartBild(Bildnr,Bildobjekt,Position,Lang) {
 
 window.document.images[Bildnr].src = "img/einst/"+Bildobjekt;
 if(Position == 'ohne'){

 	window.document.images["oben"].src = "img/pix.gif";
	
 }
 else{
 	if(Lang == 'de')
 		window.document.images[Position].src = "img/einst/TEXT"+Bildobjekt;
 	else if(Lang == 'en')
 		window.document.images[Position].src = "img/einst/ENTEXT"+Bildobjekt;
 	else if(Lang == 'fr')
 		window.document.images[Position].src = "img/einst/FRTEXT"+Bildobjekt;
 	else 
 		window.document.images[Position].src = "img/einst/TEXT"+Bildobjekt;

 }
}
function GetPos(lyr,lid)
{
 
 var xx = 0, yy = 0;
 
 var xx = 0, yy = 0;
  //if (name=='Netscape')
  if(document.layers){
     xx = document.images[lyr].x;
     yy = document.images[lyr].y;
  }
  else{
     obj = (document.all) ? document.all.item(lid) : document.getElementById(lid);
     while(obj)
     {
      xx += obj.offsetLeft;
      yy += obj.offsetTop;
      obj = obj.offsetParent;
     }
  }
  return (xx+1);
 
}

function undermenu(lyr,lid)
{
    var xx = 0, yy = 0;
    if(document.layers){
     xx = document.images[lyr].x;
     yy = document.images[lyr].y;
    }
    else{
     obj = (document.all) ? document.all.item(lid) : document.getElementById(lid);
     while(obj)
     {
      xx += obj.offsetLeft;
      yy += obj.offsetTop;
      obj = obj.offsetParent;
     }
    }
  return (yy+3);
}

function Banner()
{ 
   popwin=window.open("weihnachten.php","HELUKABEL","width=400,height=300, status=no, resizable=no, scrollable=no, dependent=yes"); 
   popwin.moveTo(screen.width-890,screen.height-550);popwin.focus();
}


function Kabelkonfigurator(systemland,func)
{
	

	

 
  alert("Hier der wert "+Land);
  //parent.location.href='index.php?lang='+systemland+'&func='+func+'&typnr='+Land;
}



function datasheet()
{ 

   popwin=window.open("datasheet.php","","width=550,height=400,scrollbars,resizeable");
   popwin.moveTo(screen.width-890,screen.height-550);popwin.focus(); 
  
}




