function aktuellesin()
{
	JSFX.Rollover("iaktuelles",  "/images/kugel_blau_gross.gif");
	JSFX.fadeIn('iaktuelles');
	JSFX.Rollover("iqualitaet",  "/images/kugel_gruen_mittel.gif");
	JSFX.fadeIn('iqualitaet');  
	     
}       
function aktuellesout()
{
	JSFX.fadeOut('iaktuelles');
	JSFX.fadeOut('iqualitaet');
}

function qualitaetin()
{
	JSFX.Rollover("iqualitaet",  "/images/kugel_gruen_gross.gif");
	JSFX.fadeIn('iqualitaet');
	JSFX.Rollover("iaktuelles",  "/images/kugel_blau_mittel.gif");
	JSFX.fadeIn('iaktuelles');          	
	JSFX.Rollover("isortiment",  "/images/kugel_hellgruen_mittel.gif");
	JSFX.fadeIn('isortiment');      
}       
function qualitaetout()
{
	JSFX.fadeOut('iqualitaet');
	JSFX.fadeOut('iaktuelles');   	             	
	JSFX.fadeOut('isortiment');
}

function sortimentin()
{	
	JSFX.Rollover("isortiment",  "/images/kugel_hellgruen_gross.gif");
	JSFX.fadeIn('isortiment');
	JSFX.Rollover("iqualitaet",  "/images/kugel_gruen_mittel.gif");
	JSFX.fadeIn('iqualitaet');          	
	JSFX.Rollover("iernaehrung",  "/images/kugel_gelb_mittel.gif");
	JSFX.fadeIn('iernaehrung');  
	     
}       
function sortimentout()
{
	JSFX.fadeOut('isortiment');
	JSFX.fadeOut('iqualitaet');   	             	
	JSFX.fadeOut('iernaehrung');
}

function ernaehrungin()
{	
	JSFX.Rollover("iernaehrung",  "/images/kugel_gelb_gross.gif");
	JSFX.fadeIn('iernaehrung');
	JSFX.Rollover("isortiment",  "/images/kugel_hellgruen_mittel.gif");
	JSFX.fadeIn('isortiment');          	
	JSFX.Rollover("iservice",  "/images/kugel_orange_mittel.gif");
	JSFX.fadeIn('iservice');          	     
}       
function ernaehrungout()
{
	JSFX.fadeOut('iernaehrung');
	JSFX.fadeOut('isortiment');
	JSFX.fadeOut('iservice');   	             	     	
}

function servicein()
{	
	JSFX.Rollover("iservice",  "/images/kugel_orange_gross.gif");
	JSFX.fadeIn('iservice');
	JSFX.Rollover("iernaehrung",  "/images/kugel_gelb_mittel.gif");
	JSFX.fadeIn('iernaehrung');          	
	JSFX.Rollover("iueberuns",  "/images/kugel_rot_mittel.gif");
	JSFX.fadeIn('iueberuns');          	     
}       
function serviceout()
{
	JSFX.fadeOut('iservice');  
	JSFX.fadeOut('iernaehrung');
	JSFX.fadeOut('iueberuns'); 	             	     	
}

 function ueberunsin()
{	
	JSFX.Rollover("iueberuns",  "/images/kugel_rot_gross.gif");
	JSFX.fadeIn('iueberuns');
	JSFX.Rollover("iservice",  "/images/kugel_orange_mittel.gif");
	JSFX.fadeIn('iservice');          	         	     
}       
function ueberunsout()
{
	JSFX.fadeOut('iueberuns'); 
	JSFX.fadeOut('iservice');    		             	     	
}
                


function ChangeStyle(obj,color)
{
	document.getElementById(obj).style.color = color;
}
                
function myWindowOpen(url,name,width,height,scrollbars)
{
  
  var ScreenX = screen.width;
  var ScreenY = screen.height;
  
  var CenterX = ScreenX/2;
  var CenterY = ScreenY/2;

  var left = CenterX - width/2;
  var top  = CenterY - height/2;
  
  var mywindow=window.open(url,name,'width='+width+',top='+top+',left='+left+',height='+height+',scrollbars='+scrollbars);
  
   return mywindow;
}

function ShowInfo(text,title,width,Height)
{
	var infodoc = myWindowOpen('','infodoc',width,Height,'yes');

	infodoc.document.clear();
	infodoc.document.open();
	infodoc.document.write ('<html><head>');
	infodoc.document.write ('<link rel="stylesheet" type="text/css" media="screen" href="/styles/screen.css" />');
	infodoc.document.write ('<title>tegut... '+title+'</title></head><body style="margin:5px" onLoad=\"self.focus();">'+text);
	infodoc.document.write ('<br><div style="text-align:center"><input type="button" class="button" onClick="window.print();" value="Seite drucken"></div></body></html>');
	infodoc.document.close();

	return false;
}


 function ChangeStyle(obj,color)
 {
   document.getElementById(obj).style.color = color;
 }
 
 function gethtmlcontent()
 {
 	var obj;
 	
 	if (document.getElementById('tegut_content')!=null)
 	{
 		return document.getElementById('tegut_content').innerHTML;
 	}
 	else
 	{
 		return window.parent.tegut_iframecontent.getiframecontent();
 	}
 }
 
function getiframecontent()
{
	return document.body.innerHTML;
}
 
function printme(Area)
{
  var druck = window.frames['tegut_action'];
  druck.document.clear();
  druck.document.open();
  druck.document.write('<html><head>');
  druck.document.write('<link rel="stylesheet" type="text/css" href="/styles/screen.css" />');
  druck.document.write('<link rel="stylesheet" type="text/css" href="/styles/'+Area+'.css" />');
  druck.document.write('<title>Druckansicht</title></head><body onLoad="self.focus(); self.print();">');
  druck.document.write(gethtmlcontent());
  druck.document.write('</body></html>');
  druck.document.close();
  return false;
}



function mailme(urli)
{
	var mailme = window.frames['tegut_action'];
	self.location.href = '/service/mailme.php?urli='+urli;
	return false;
}



function swapImgRestore() 
{ 
	var i,x,a=document.sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
	
function preloadImages() 
{ 
	var d=document; if(d.images){ if(!d.p) d.p=new Array();
	  var i,j=d.p.length,a=preloadImages.arguments; for(i=0; i<a.length; i++)
	  if (a[i].indexOf("#")!=0){ d.p[j]=new Image; d.p[j++].src=a[i];}}
}
	
function findObj(n, d) 
{
	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=findObj(n,d.layers[i].document); return x;
}
	
function swapImage() 
{ 
	var i,j=0,x,a=swapImage.arguments; document.sr=new Array; for(i=0;i<(a.length-2);i+=3)
	 if ((x=findObj(a[i]))!=null){document.sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}


// JavaScript Document
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];}}
}

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_findObj(n, d) { //v4.01
  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 && d.getElementById) x=d.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 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 to walk up document structure from nav roll-over element
//     to determine X-Y coordinates of nav element for DHTML drop-down nav
//     layer positioning
function getNavPosition(elemID) {
	var objNavUp=document.getElementById(elemID);var offsetLeft=0;var offsetTop=0;
	while (objNavUp) { offsetLeft+=objNavUp.offsetLeft;offsetTop+=objNavUp.offsetTop;objNavUp=objNavUp.offsetParent; }
	return {left:offsetLeft, top:offsetTop};
}

// Function to show roll-over state of nav element and 
//     show DHTML drop-down nav layer if it exists
function showNav(elemID) {
	x = getNavPosition("hnav_"+elemID);
	if(elemID!=section) {
		MM_swapImage('hnav_'+elemID,'','/images/hnav_'+elemID+'_over1.gif',1);
	}
	if(elemID == "products"){
        if(section == "home"){
            if(document.getElementById("select1")) {
                document.getElementById("select1").style.visibility = "hidden";
            }
        }
    }
	if(document.getElementById("dNav"+elemID)) {
		if(elemID=="kids") {
			x.left = x.left - 33;
		}
		document.getElementById("dNav"+elemID).style.visibility = "visible";
		document.getElementById("dNav"+elemID).style.left = x.left+"px";
		document.getElementById("dNav"+elemID).style.top = (x.top+31)+"px";
	}
}

// Function to return roll-over state of nav element to original and
//     hide DHTML drop-down nav layer if it exists
function hideNav(elemID) {
	if(elemID!=section) {
		MM_swapImgRestore();
	}
	if(document.getElementById("dNav"+elemID)) {
		document.getElementById("dNav"+elemID).style.visibility = "hidden";
	}
	if(elemID == "products"){
        if(section == "home"){
            if(document.getElementById("select1")) {
                document.getElementById("select1").style.visibility = "visible";
            }
        }
    }
}

// Function to walk up document structure from nav roll-over element
//     to determine X-Y coordinates of nav element for DHTML drop-down nav
//     layer positioning
function getNavPosition(elemID) {
	var objNavUp=document.getElementById(elemID);var offsetLeft=0;var offsetTop=0;
	while (objNavUp) { offsetLeft+=objNavUp.offsetLeft;offsetTop+=objNavUp.offsetTop;objNavUp=objNavUp.offsetParent; }
	return {left:offsetLeft, top:offsetTop};
}

// Function to show roll-over state of nav element and 
//     show DHTML drop-down nav layer if it exists
var menuVisible = 0;

function showMenu(elemID,offx,offy) {
	if(menuVisible) {
		hideMenu(elemID);
	}
	else {
		x = getNavPosition("btn_"+elemID);
		if(document.getElementById("menu"+elemID)) {
			document.getElementById("menu"+elemID).style.visibility = "visible";
			document.getElementById("menu"+elemID).style.left = (x.left+offx)+"px";
			document.getElementById("menu"+elemID).style.top = (x.top+offy)+"px";
		}
		menuVisible = 1;
	}
}

// Function to return roll-over state of nav element to original and
//     hide DHTML drop-down nav layer if it exists
function hideMenu(elemID) {
	if(document.getElementById("menu"+elemID)) {
		document.getElementById("menu"+elemID).style.visibility = "hidden";
	}
	menuVisible = 0;
}

// Function to allow popups

function popUp(url,name,width,height,menubar,scrollbars,resizable,location,status,directories,toolbar){
	window.open(url,name,"width=" + width + ",height=" + height + ",menubar=" + menubar + ",scrollbars=" + scrollbars + ",resizable=" + resizable + ",location=" + location + ",status=" + status + ",directories=" + directories + ",toolbar=" + toolbar)
}




var marked_row = new Array;

/**
 * Sets/unsets the pointer and marker in browse mode
 *
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 *
 * @return  boolean  whether pointer is set or not
 */
 
 
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;

    // 1. Pointer and mark feature are disabled or the browser can't get the
    //    row -> exits
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }

    // 2. Gets the current row and exits if the browser can't get it
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }

    // 3. Gets the current color...
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    // 3.1 ... with DOM compatible browsers except Opera that does not return
    //         valid values with "getAttribute"
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    // 3.2 ... with other browsers
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    } // end 3

    // 4. Defines the new color
    // 4.1 Current color is the default one

    if (currentColor == '' || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    // 4.1.2 Current color is the pointer one
    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 Current color is the marker one
    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. Sets the new color...
    if (newColor) {
        var c = null;
        // 5.1 ... with DOM compatible browsers except Opera
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            } // end for
        }
        // 5.2 ... with other browsers
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    } // end 5

    return true;
} // end of the 'setPointer()' function

