function initImg(N, iTot, iCurr){
	var pic_width=770;
	var pic_height=350;
	nrImgAct=iCurr;
	nrImgTot=iTot;
	imgName=N;
	listImg= new Array();
	if (document.images)
	 {
		for (var i = 1; i <= nrImgTot; i++){
			document['img'+i]= new Image(pic_width,pic_height);
			document['img'+i].src='fileadmin/templates/images/top/pl_' +imgName+ '_'+i+'.jpg';
			listImg[i]=document['img'+i].src
		}
	 }
	 
	newImg= listImg[1];
	document["imglargeswap"].src =newImg.toString();

	
	window.document.getElementById("imgLnavback").innerHTML='<p class="inactiveB">previous</p>';
	
	if(nrImgTot<=1){
		window.document.getElementById("imgLnavforward").innerHTML='<p class="inactiveB">next</p>';
	}else{
		window.document.getElementById("imgLnavforward").innerHTML='<p class="activeB"><a href="#" onClick="DoChange(\'forward\'); return false">next</a></p>';
	}
	window.document.getElementById("imgLnavnr").innerHTML='<b>'+nrImgAct+'</b> / '+nrImgTot ;
	
	
}

function DoChange(act) {
	if (act == 'forward' && nrImgAct < nrImgTot ){
		//alert(act);
		nrImgAct++;
		newImg= listImg[nrImgAct];
		document["imglargeswap"].src =newImg.toString();
	
	} else if (act == 'back' && nrImgAct > 1 ){
		nrImgAct--;
		newImg= listImg[nrImgAct];
		document["imglargeswap"].src =newImg.toString();
	}
	
	//if active image is first image
	if (nrImgAct == 1){
		//disable back button
		document.getElementById("imgLnavback").innerHTML='<p class="inactiveB">previous</p>';
	} else{
		document.getElementById("imgLnavback").innerHTML='<p class="activeB"><a href="#" onClick="DoChange(\'back\'); return false">previous</a></p>';
	}

	//if active image is last image
	if (nrImgAct == nrImgTot  ){
		//disable forward button
		document.getElementById("imgLnavforward").innerHTML='<p class="inactiveB">next</p>';
	}else{
		document.getElementById("imgLnavforward").innerHTML='<p class="activeB"><a href="#" onClick="DoChange(\'forward\'); return false">next</a></p>';
	}

	//change nr
	document.getElementById("imgLnavnr").innerHTML='<b>'+nrImgAct+'</b> / '+nrImgTot;
}

