/**********************************************
 	Copyright 2002
 	Author VOMAR - Mary Vokicic
***********************************************/

function defPictureArray()
{
	this.picture = new Array()
	this.quantity=0 ;
	this.on = on;
	this.off = off;
	this.allOff = allOff;
	this.loadP = loadP;
}

function on(newP, changeP)
{
      if ( typeof this.picture !="undefined")
	  { 
          for ( i = 0; i < this.quantity ; i++)
         {
		
             if (newP == this.picture[i][1] ) 
                           changeP.src = this.picture[i][0].src;
          } 
		}
}


function off(newP, changeP)
{
      if ( typeof this.picture !="undefined") 
     {
         for (i = 0; i < this.quantity; i++)
                  if ((changeP != null) && (newP == this.picture[i][1])) 
                         changeP.src = this.picture[i][0].src;
      }
}

function allOff()
{
     if ( typeof this.picture !="undefined") 
     {
         for (i = 0; i < this.quantity; i++){
		 	for (j = 0; j < document.images.length; j++){
						if (document.images[j].name == this.picture[i][1])
                         document.images[j].src = this.picture[i][0].src;
      			}							
			}
	  }
}


function loadP(name, adr)
{  
     this.picture[this.quantity] = new Array(2);
     this.picture[this.quantity][0] = new Image();
     this.picture[this.quantity][0].src = adr;
     this.picture[this.quantity][1] = name;
     this.quantity++;
     return this.quantity;
}






/* OPEN NEW WINDOW*/
function newWindow(windowName,adress,windowOptions, x, y)
{
	var sepWindow=window.open('',windowName,windowOptions); 
    sepWindow.moveTo(x,y);
    sepWindow.document.location.href=getLocation(adress);
    sepWindow.focus();
   }
/* OPENNEW WINDOW*/


/*liefert die Parameter in geeigneter Form zur Übermittlung */
function getLocation(Adresse){
	var ap='';
	var param, adr;
	var pos_gleich,pos_next;
	
	/*Adresse und Parameter trennen, wenn ? vorhanden ansonsten returnn Adresse*/
	if (Adresse.indexOf('?', 0) == -1) return Adresse;
	
	adr = Adresse.substring(0,Adresse.indexOf('?',0));
	param = Adresse.substring(Adresse.indexOf('?',0)+1, Adresse.length);
	pos_gleich = param.length-1;
	pos_next = param.length;
	/*ENDE: Adresse und Parameter trennen */

	for (pos_gleich; pos_gleich > 0 && pos_next > 0; pos_gleich--){
		pos_gleich = param.lastIndexOf('=',pos_gleich);
		pos_und = param.lastIndexOf('&', pos_gleich);
		if (ap == '')
			ap = param.substring(pos_und+1, pos_next).replace( '&', '%26');
		else
			ap =ap + '&' + param.substring(pos_und+1, pos_next).replace( '&', '%26');
		pos_next = pos_und;
	}
	return adr + '?' + ap;
}
/*ENDE: liefert die Parameter in geeigneter Form zur Übermittlung */






