// vorzuladene Bilder in den neuen Array 'images' schreiben
var images = new Array()

function vorladen() {
  for (i = 0; i < 6; i++) {
    images[i] = new Image();
    images[i].src = "/media/tipps/Nikon_Praxistipps_" + (i+1) + ".jpg";
  }
}

vorladen();
/* function swap(no) {
	document.images["container"].src="./media/Nikon_Praxistipps_" + no + ".jpg"
} */

function swap(img, dir) {
	var x = parseInt(img.src.substr(-5, 1));
	x = (dir == 'next') ? x +1 : x -1;
	img.src = "/media/tipps/Nikon_Praxistipps_" + x + ".jpg";
	document.images['container'].style.height = 'auto'; // '387px'; // 913px
	document.getElementById("dwnld").href = "/doc/tipps/Nikon_Praxistipps_" + x + ".pdf";
	document.getElementById("prev").style.display = (x > 1) ? 'block' : 'none';
	if(x < 6) {
		document.getElementById("next").style.display = 'block';
	}
	if(x == 4) {
		document.images['container'].style.height = '387px';
		document.images['container'].style.width = 'auto';
	}
	if(x == 5 || x == 3) {
		document.images['container'].style.width = '913px';
	}
	if(x == 6) {
		document.getElementById("next").style.display = 'none';
		document.images['container'].style.height = '387px';
		document.images['container'].style.width = 'auto';
	}
}

function nw(url,b,h,fenster){	
	n=window.open(url,fenster,'width='+b+',height='+h+',left=100,screenX=20,menubar=no,toolbar=no');
	n.focus();
}
