// JavaScript Document

 function setFotoName(picnr) {
 	document.getElementById('fotoname').innerHTML = unescape(fotoName[picnr]);
 }




 function NextPhoto (picnr) {
		foto = Pictures[picnr];
		
		if ( foto == void(0) ) {
			picnr = Pictures.length-1;
			foto  = Pictures[picnr]
		}
		
		nextpic = picnr+1;
		prevpic = picnr-1;
		
		//document.getElementById('debugMsg').innerHTML = "p:"+prevpic+" c:"+picnr+" |n:"+nextpic;
		
		var prev_arr_on = '<img src="'+path_corrector+'skin/images/prev_on.gif" style="cursor:pointer;" alt="Previous photo" onclick="NextPhoto('+prevpic+');">';
	    var next_arr_on = '<img src="'+path_corrector+'skin/images/next_on.gif" style="cursor:pointer;" alt="Next photo" onclick="NextPhoto('+nextpic+');">';

		var prev_txt_on = '<span style="cursor: pointer;" onclick="NextPhoto('+prevpic+');">'+prev_text+'</span>';
		var next_txt_on = '<span style="cursor: pointer;" onclick="NextPhoto('+nextpic+');">'+next_text+'</span>';
		
		if ( typeof(Pictures[prevpic]) != "undefined" ) {
			document.getElementById('prevfotolink').innerHTML = prev_arr_on;
			document.getElementById('prev_span').innerHTML    = prev_txt_on;
		} else {
			document.getElementById('prevfotolink').innerHTML = '<img src="'+path_corrector+'skin/images/spacer.gif" width=24 height=28>';
			document.getElementById('prev_span').innerHTML    = '&nbsp;';
		}

		
		if ( typeof(Pictures[nextpic]) != "undefined" ) {
			document.getElementById('nextfotolink').innerHTML = next_arr_on;
			document.getElementById('next_span').innerHTML    = next_txt_on;
		} else {
			document.getElementById('nextfotolink').innerHTML = '<img src="'+path_corrector+'skin/images/spacer.gif" width=24 height=28>';
			document.getElementById('next_span').innerHTML    = '&nbsp;';
		}
		
		document.getElementById('fotolayer').innerHTML='<img src="'+path_corrector+foto+'" alt="" style="border: 1px solid black;" alt="'+fotoName[picnr]+'">';
		
 }

