function startImage(imgID, butID) {

  this.active = false;

  this.nImgSrc = "";
  this.oImgSrc = "";

  this.uImgOver = "";
  this.uImgOut = "";
  
  
  this.cImgID = document.getElementById(imgID);
  
  this.over = startImage_over;
  this.out = startImage_out;

  this.defImg = startImage_def;
  this.defBut = startImage_but;
  
  var _this = this;
  
  var button = document.getElementById(butID);
  
  button.onmouseover = function() {	  
	  _this.over(this);
  }
  
  button.onmouseout = function() {
	  _this.out(this);
  }
  
  /*alert(imgID + ' * ' + this.cImgID);*/

  

}

function startImage_def(nSrc, oSrc) {
  this.uImgOut = nSrc;
  this.uImgOver = oSrc;
}

function startImage_but(nSrc, oSrc) {
  this.nImgSrc = nSrc;
  this.oImgSrc = oSrc;
}

function startImage_over(obj) {
    if (obj.src.indexOf(this.oImgSrc) != -1) {
        this.active = true;
    } else {
        obj.src = this.oImgSrc;
        this.active = false;
    }

    if (this.cImgID.src.indexOf(this.uImgOut) == -1) {
		
        document.activeSrc = this.cImgID.src;
        this.cImgID.src = this.uImgOver;
    } else {
        this.cImgID.src = this.uImgOver;
        document.activeSrc = "";
    }

}

function startImage_out(obj) {
    if (this.active == false) {
        obj.src = this.nImgSrc;

    }

    if (document.activeSrc != "") {
        this.cImgID.src = document.activeSrc;
    } else {
        this.cImgID.src = this.uImgOut;
    }
}

/*************************************************************/
function MM_rowMark(overColor,markedColor,overMarked,onClick)
        {
                /** Properties **/
                this.overColor = overColor;
                this.markedColor = markedColor;
                this.overMarked = overMarked;

                /** Variables **/
                this.oldColor = "";
                this.markedRow = "";

                /** Methods **/
                this.over = MM_rowMark_over;
                this.out = MM_rowMark_out;
                this.click = MM_rowMark_click;

                /** Event Handler **/
                this.onClick = onClick;
        }

function MM_rowMark_over(oRow)
        {
                this.oldColor = oRow.style.backgroundColor;

                if (oRow.style.backgroundColor == this.markedColor)
                        oRow.style.backgroundColor = this.overMarked;
                else
                        oRow.style.backgroundColor = this.overColor;
        }

function MM_rowMark_out(oRow)
        {
                if (oRow.style.backgroundColor == this.markedColor)
                        oRow.style.backgroundColor = this.markedColor;
                else
                        oRow.style.backgroundColor = this.oldColor;
        }

function MM_rowMark_click(oRow)
        {
                if (this.markedRow == "")
                        {
                                oRow.style.backgroundColor = this.markedColor;
                                this.markedRow = oRow;
                                if (this.onClick != "")
                                        eval(this.onClick);
                        }
                else
                        {
                                this.markedRow.style.backgroundColor = this.oldColor;
                                oRow.style.backgroundColor = this.markedColor;
                                this.markedRow = oRow;
                                if (this.onClick != "")
                                        eval(this.onClick);
                        }
        }





/**************************************************\
  © Magnet Media 2001
  Row mark with image rollover

    DO NOT USE WITHOUT PERMISSION!

          myRow = new MM_imgMark(1,2,3,4,5,6)

          1:        Farbe des Over Effekts z.B. "#ff0000" - string
          2:        Farbe des Mark Effeks - string
          3:        Farbe des Over Effeks bei der Marked Row - string
          4:        Pfad des Images z.B. "/images/someImage.gif" - string
          5:        Pfad des Rollover Images - string
          6:  Function die bei onClick aufgerufen wird - string

          <tr class="grau" onMouseOver="myRow.over(this)" onMouseOut="myRow.out(this)" onClick="myRow.click(this)">
                  <td>eine Zeile</td>
                  <td><img src="einbild.gif"></td>
          </tr>
\**************************************************/

function MM_imgMark(overColor,markedColor,overMarked,imgsrc,imgOverSrc,onClick, arrowID) // v1.2 © Magnet Media 2001
        {
                /** Properties **/
                this.overColor = overColor;
                this.markedColor = markedColor;
                this.overMarked = overMarked;
                this.nsrc = imgsrc;
                this.osrc = imgOverSrc;

                /** Variables **/
                this.oldColor = "";
                this.markedRow = "";
                this.image = "";

                /** Methods **/
                this.over = MM_imgMark_over;
                this.out = MM_imgMark_out;
				
				/*
				  var _this = this;
	
				  var arrow = document.getElementById(arrowID);
				  alert(arrow);
				  arrow.onmouseover = function() {	  
					  _this.over(this);
				  }
				  
				  arrow.onmouseout = function() {
					  _this.out(this);
				  }
				*/
				
                this.click = MM_imgMark_click;

                /** Event Handler **/
                this.onClick = onClick;
        }

function MM_imgMark_over(oRow)
        {
                this.image = oRow.getElementsByTagName("IMG");
                this.image[1].src = this.osrc;
                this.oldColor = oRow.style.backgroundColor;

                if (oRow.style.backgroundColor == this.markedColor)
                        oRow.style.backgroundColor = this.overMarked;
                else
                        oRow.style.backgroundColor = this.overColor;
        }

function MM_imgMark_out(oRow)
        {
                this.image = oRow.getElementsByTagName("IMG");
                this.image[1].src = this.nsrc;

                if (oRow.style.backgroundColor == this.markedColor)
                        oRow.style.backgroundColor = this.markedColor;
                else
                        oRow.style.backgroundColor = this.oldColor;
        }

function MM_imgMark_click(oRow)
        {
                if (this.markedRow == "")
                        {
                                oRow.style.backgroundColor = this.markedColor;
                                this.markedRow = oRow;
                                if (this.onClick != "")
                                        eval(this.onClick);
                        }
                else
                        {
                                this.markedRow.style.backgroundColor = this.oldColor;
                                oRow.style.backgroundColor = this.markedColor;
                                this.markedRow = oRow;
                                if (this.onClick != "")
                                        eval(this.onClick);
                        }
        }

/*************************************************************************/


function MM_rollOver(obj,nSrc,oSrc)        {
        this.obj = document.getElementById(obj);
        this.obj.nSrc = nSrc;
        this.obj.oSrc = oSrc;
        this.obj.onmouseover = MM_rollOver_over;
        this.obj.onmouseout = MM_rollOver_out;

}

function MM_rollOver_over()        {
        this.src = this.oSrc;

}

function MM_rollOver_out(){
        this.src = this.nSrc;

}

function switchImage(sImgId, sNewImg, sHead, sText) {
	var imgTag = document.getElementById(sImgId);
	imgTag.src = sNewImg;
	
	var sHeadOld = document.getElementById("head_gallery");
	var sTextOld = document.getElementById("text_gallery");
	
	var sHeadNew = document.getElementById(sHead);
	var sTextNew = document.getElementById(sText);
	
	sHeadOld.innerHTML = sHeadNew.value;
	sTextOld.innerHTML = sTextNew.value;
	
	return false;
	
}

function changeClass(oldClass, newClass){
	
	var old = document.getElementById(oldClass);
	
	for(var i =20; i<26; i++){
		var change = document.getElementById("id_"+i);
		
		if (change != null) {
			change.className = "imgClass";
		}
	}
	old.className = newClass;
	return false;
	
}