var timeout = 4000;

// 7. Die eigentliche Funktion starten.
function Changebannerwechsel (i){
  if(anz-1==i){
  	k=0;
  }
  else{
  	k=i+1;
  }
  
  window.setTimeout ( "Changebannerwechsel("+k+")", timeout );
  document.getElementById ( "banner_bild" ).src = img[i]['src'];
  document.getElementById ( "banner_bild" ).alt = img[i]['title'];
  document.getElementById ( "banner_bild" ).title = img[i]['title'];
  document.getElementById ( "banner_link" ).href = img[i]['href'];
}


//verlassen
function bro_zaehler(wert){
	/*//frage ob wert eingetragen wurde
	if(""!=wert){
		z++;
	}
		
	if(0>z){	
		z=0;
	}
	
	if(6<=z){ //Fehlermeldung
		alert("Nur 5 Broschüren bitte");
		this.value="";
	}
	if(""!=wert){
		z++;
	}
	
	if(5<=z){
		alert("Bitte keinen weiteren Broschüren wählen!");
		z=wert;
		return z;
	}
	return z;*/
}

//auswählen
var t=0;
function bro_anzahl(){
	//alert (t);
	z=0;
	z=z+t;
	for(i=1;i<=23;i=i+2){
		t=0;
		if(document.bestellen.elements[i].value != ''){
			z++;
		}
	}
	
	if(5<=z){
		k=1;
		while(document.bestellen.elements[k].value == ''){
			k=k+2;
		}
		t=-1;
		document.bestellen.elements[k].focus();
		alert("Bitte keinen weiteren Broschüren wählen!\nPlease order no more broschure!");		
		return t;
	}
}

function check(){
	kontrolle=0;
	
	for(i=1;i<=23;i=i+2){
		if(document.bestellen.elements[i].value != ''){
			kontrolle++;
		}
	}

	if (0==kontrolle) {
    alert("Bitte mindestens eine Auswahl treffen!\nPlease select minimum one!!");
    document.bestellen.elements[1].focus();
    return false;
	}
}

p1=false;
function newWin(strURL,strType,strHeight,strWidth) {
	if(p1 && !p1.closed)p1.close();
	var strOptions="";
	if (strType=="bilder") 
		strOptions="toolbar=no,menubar=no,scrollbars=no,resizable=no,location=no,height="+strHeight+",width="+strWidth;
	if (strType=="bilder_scroll") 
		strOptions="toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,height="+strHeight+",width="+strWidth;
	if (strType=="bilder_scroll_quer") 
		strOptions="toolbar=no,menubar=no,scrollbars=yes,resizable=no,location=no,width=700,height="+strHeight;
	
	p1=window.open(strURL, 'newWin', strOptions);
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
function neuFenster(source,name,size)
        {
        var newWindow =
        window.open(source,name,size)
        }
	
function letsGo(i)
   {
   		opener.location = i;
   		window.close();
   }

function open_bro(theURL,winName,features) { //v2.0
	if(p1 && !p1.closed)p1.close();
	p1=window.open(theURL,winName,features);
}

var bilder = new Array();
bilder[0]="aida.jpg";
bilder[1]="aida2.jpg";
bilder[2]="aida3.jpg";
 function wechsel(i){
  document.bild.src="http://www.duesseldorf-tourismus.de/bilder/aida/"+bilder[i];
 }