	var bild;
	var divtag=null;
        var index=0;
	var urlArray = new Array();
	var counter=0;

	var imgpath="http://www.stadttheater-bremerhaven.de/web/__sys/spics";
var imgpath_mo="http://www.stadttheater-bremerhaven.de/web/__sys/spics_on";
<b><font color=red>Script error in scope 'js_vars' at line 40: com.nodevision.cms.kernel.KernelException: APobject.checkKnownAttributes: Attribute(s) 'Typ' unknown for object-id '21470'!</font></b>

	function firstBannerLoop(pick,konzChoice) {
		var tmp_fname = imgpath+"/"+totArray[pick][0];
		bild = konzArray[konzChoice];

		url = totArray[pick][1]; // url is set to respective sponsor url					
		pic_on = imgpath_mo+"/"+totArray[pick][2];
		pic_off = tmp_fname;
		totArray.splice(pick,1);
		
		//filling new 2d array with 'a href' reference filename and sponsor url. in effect linking sponsors to their urls as more than on  a href exists for konzert list pages 
		urlArray[counter] = new Array(4);
		urlArray[counter][0] = bild;
		urlArray[counter][1] = url;
		urlArray[counter][2] = pic_on;
		urlArray[counter][3] = pic_off;
		counter++;

		if (document.images) {
			if (document.layers && divtag!=null) {	
				try{
					// for netscape browsers
					eval('document.'+divtag+'.document.images["'+bild+'"].src = '+tmp_fname);
					
				}catch(er){  }
			} else {
				try{
					document [bild].src = tmp_fname;
				}catch(er){  }
			}
		}
	}

	function jump(fname){
		fname = "x_" + fname;
		for(p=0;p<urlArray.length;p++){
			if(urlArray[p][0]==fname){
				url=urlArray[p][1];
			}
		}

		// opens a new webpage with the following properties and the url of the respective sponsor
 		//if(url != "nopage") new_window=window.open(url,"new_win","toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=740,height=580");
		if(url != "nopage") window.location.href = url;
	}

	function rotate(){
		if(totArray.length>0){
			rand=(totArray.length-1)*Math.random();
			pick=Math.round(rand);
			firstBannerLoop(pick,index);
		}else if(totArray.length==0){
			for(q=0;q<banners.length;q++){
				totArray[q] = banners[q];
			}
			rand=(totArray.length-1)*Math.random();
			pick=Math.round(rand);
			firstBannerLoop(pick,index);
		}

		if(index<konzArray.length){
			index++;
			rotate();
			// fills in all sponsors, by recalling itself 
		}
	}

	function switch_img_on(fname) {
 	    if (document.images) {
		var pic_on = new Image();
		var pic_off = new Image();
		fname = "x_" + fname;
		for(p=0;p<urlArray.length;p++){
			if(urlArray[p][0]==fname){
				pic_on.src=urlArray[p][2];
				//alert(urlArray[p][0] + " " + urlArray[p][1] + " " + urlArray[p][2] + " " + urlArray[p][3])
			}
		}
		eval("document.images[fname].src = pic_on.src");
	    }
	  	
	}
	function switch_img_off(fname) {
		var pic_on = new Image();
		var pic_off = new Image();
		fname = "x_" + fname;
		for(p=0;p<urlArray.length;p++){
			if(urlArray[p][0]==fname){
				pic_off.src=urlArray[p][3];
			}
		}
		eval("document.images[fname].src = pic_off.src");
	}
	
	
