

//////////////////////////FUNCTON-NAVIG DESIGN\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

	if (document.images){
		i4off=new Image();i4off.src='img_nav/nav_next_picture.gif';
		i2off=new Image();i2off.src='img_nav/nav_last_picture.gif';
		i3off=new Image();i3off.src='img_nav/nav_main.gif';
		i5off=new Image();i5off.src='img_nav/nav_next_chapter.gif';
		i1off=new Image();i1off.src='img_nav/nav_last_chapter.gif';
//		i7off=new Image();i7off.src='img_nav/nav_sound.gif';
		i6off=new Image();i6off.src='img_nav/nav_diashow.gif';
		i4on=new Image();i4on.src='img_nav/nav_next_picture_on.gif';
		i2on=new Image();i2on.src='img_nav/nav_last_picture_on.gif';
		i3on=new Image();i3on.src='img_nav/nav_main_on.gif';
		i5on=new Image();i5on.src='img_nav/nav_next_chapter_on.gif';
		i1on=new Image();i1on.src='img_nav/nav_last_chapter_on.gif';
//		i7on=new Image();i7on.src='img_nav/nav_sound_on.gif';
		i6on=new Image();i6on.src='img_nav/nav_diashow_on.gif';
		cr=new Image();cr.src='img_nav/copyright.gif';
		}
function iOn(iN){if (document.images){document[iN].src=eval(iN+'on.src')}}
function iOff(iN){if (document.images){document[iN].src=eval(iN+'off.src')}}

var ps=1;
function bb(){
			if (ps==1){iOn('i6');iOff('i1');iOff('i2');iOff('i3');iOff('i4');iOff('i5');iOff('i6');forward();ps=2}
		else if (ps==2){iOn('i6');iOn('i1');ps=3}
		else if (ps==3){iOn('i6');iOn('i1');iOn('i2');ps=4}
		else if (ps==4){iOn('i6');iOn('i1');iOn('i2');iOn('i3');ps=5}
		else if (ps==5){iOn('i6');iOn('i1');iOn('i2');iOn('i3');iOn('i4');ps=6}
		else if (ps==6){iOn('i6');iOn('i1');iOn('i2');iOn('i3');iOn('i4');iOn('i5');ps=7}
		else if (ps==7){iOn('i6');iOn('i1');iOn('i2');iOn('i3');iOn('i4');iOn('i5');iOn('i6');ps=1}
		}

//////////////////////////COLOR-CHANGE FUNCTIONS\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\


function fmChange(myChoise){
document.bgColor=myChoise;
if (document.all){
document.body.style.scrollbarFaceColor=myChoise;
document.body.style.scrollbarHighlightColor=myChoise;
document.body.style.scrollbarShadowColor=myChoise;
document.body.style.scrollbarTrackColor=myChoise;
}
colorset=myChoise;
}

var h = self.location.href.split('?');


var colorset = '#000000';
function read_color() {
	if (h[1] && h[1]!='slidemode'){fmChange(h[1])}
	if (h[2] && h[2]!='slidemode'){fmChange(h[2])}
	else {fmChange(colorset)}
}


if (h[1]=='slidemode'||h[2]=='slidemode'){i6off=new Image();i6off.src='img_nav/nav_diashow_on.gif';}


function read_pmode() {
	if (h[1]=='slidemode'||h[2]=='slidemode'){
			i6off=new Image();i6off.src='img_nav/nav_diashow_on.gif';
			iOff('i6');
			var pmodereaderTimeout;
			pmodereaderTimeout=setTimeout('slide_show()', 4000);
	}
}


//////////////////////////MAIN-NAVIG FUNCTIONS\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function go_home(){
	if (self.name=='fullmode'){
			if (window.opener){
							window.close('fullmode');
							window.opener.parent.window.focus();
							}
				else {
				startwindow=window.open('http://foto.luc.net/', 'startwindow', '');
				startwindow.focus();
				self.close();
				}
		}
		else {window.top.document.location.href='../'}
}


function go_topnav(theLink){
if (window.self == top) {

			if (self.name=='fullmode'){
							window.opener.parent.window.location.href=theLink;
							window.close('fullmode');
							window.opener.parent.window.focus();}
				else {
				startwindow=window.open(theLink,'startwindow','menubar=yes,location=yes,resizable=yes,scrollbars=yes,status=yes');
				startwindow.focus();
				self.close();}
				}
else {window.top.location.href=theLink;}
	}

//////////////////////////CHANGE CHAPTER FUNCTION

var c=eval(h[0].substr((h[0].lastIndexOf('_')+1),2));
var chapt;



function last_chapter(){
chapt=eval(c+1);
document.location.href='pset_'+chapt+'.asp?'+colorset;
	}
function next_chapter(){
chapt=eval(c-1);
document.location.href='pset_'+chapt+'.asp?'+colorset;
}
	
function jump_chapterbb(){
chapt=eval(c+1);
document.location.href='pset_'+chapt+'.asp?slidemode?'+colorset;
}
function jump_chapterff(){
chapt=eval(c-1);
document.location.href='pset_'+chapt+'.asp?slidemode?'+colorset;
}

//////////////////////////CHANGE PICTURE FADE\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function changeOpac(opacity, id) { 
    var object = document.getElementById(id).style;
    object.MozOpacity = (opacity / 100);
    object.opacity = (opacity / 100); 
    object.KhtmlOpacity = (opacity / 100); 
    object.filter = "alpha(opacity=" + opacity + ")"; 
} 

var fade_started=0;
var faderTimeout;
var faderStop;

function fadeTransComplete(){fade_started=0;}

function blendimage(divid, imageid, imagefile, millisec) {

if (fade_started==0){
				fade_started=1;
    var speed = Math.round(millisec / 100);
    var timer = 0; 
    document.getElementById(divid).style.backgroundImage = "url(" + document.getElementById(imageid).src + ")"; 
    changeOpac(0, imageid); 
    document.getElementById(imageid).src = imagefile;
    for(i = 0; i <= 100; i++) { 
        faderTimeout = setTimeout("changeOpac(" + i + ",'" + imageid + "')",(timer * speed)); 
        timer++; 
    } 
   faderStop = setTimeout("fadeTransComplete()",1000);
    }
    else {
    clearTimeout(faderTimeout);
    document.getElementById('FotoImg').src=p[w];
    document.getElementById('LegendDivH2').innerHTML=legend[w];
    }
}

//////////////////////////CHANGE PICTURE FUNCTION

var w=0;
function backward(){
if (w==1)
		{if (sliding==0){last_chapter();}
			else {jump_chapterbb();}
		}
	else {
	if (w>1){
		w--; 
		document.getElementById('LegendDivH2').innerHTML=legend[w];
		document.getElementById('FotoImg').title=legend[w];
		blendimage('FotoDiv','FotoImg',p[w],1000);
		}
	else{w=p.length-1;
		blendimage('FotoDiv','FotoImg',p[w],1000);
	}
	}
}

function forward(){
	if (w==(p.length-1)){
		if (sliding==0){next_chapter();}
	else {jump_chapterff();}
		}
	else {
		if (w<p.length-1){
		w++;
		
				if (navigator.appName.indexOf("Netscape") != -1 && sliding == 1){
				document.getElementById('FotoImg').src=p[w];
				}
				else {blendimage('FotoDiv','FotoImg',p[w],1000);}

		document.getElementById('LegendDivH2').innerHTML=legend[w];
		document.getElementById('FotoImg').title=legend[w];
	}
	else{
		w=1;
		blendimage('FotoDiv','FotoImg',p[w],1000);
	}
	}
}

//////////////////////////SLIDESHOW FUNCTION
var p_s=1;
var sliding=0;
var ptimer;
function slide_show(){
if (sliding==0){
	if (p_s>3){
		i6off=new Image();i6off.src='img_nav/nav_diashow_on.gif';
		ptimer=window.setInterval('forward()',4000);
// ptimer=window.setInterval('bb()',500);
		sliding=1;
//		pl=2;
		}
	else {alert('Not enought Images preloaded. Please wait...')}
	}
else{
	i6off=new Image();i6off.src='img_nav/nav_diashow.gif';
	window.clearInterval(ptimer);
//	iOff('i6');iOff('i1');iOff('i2');iOff('i3');iOff('i4');iOff('i5');iOff('i6');
	sliding=0;
	}
}

//////////////////////////BACKGROUND-COLOR FUNCTION

function colorbutani_over(el_big) {
	el_big.style.margin='0px';
	el_big.style.width='17px';
	el_big.style.height='17px';
	el_big.style.padding='0px';
	el_big.style.borderColor='white';
}

function colorbutani_out(el_normal) {
	el_normal.style.margin='2px'
	el_normal.style.width='13px';
	el_normal.style.height='13px';
	el_normal.style.padding='0px';
	el_normal.style.borderColor='#999999';
}

//////////////////////////THUMBNAIL FUNCTION\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

function thb_choise(i) {
document.getElementById('FotoImg').src=p[i];
w=i;
document.getElementById('LegendDivH2').innerHTML=legend[w];
}



function write_thumbs(){
document.write('<ul id="thumb_menu">');
	for(i=1;i<p.length;i++){
			document.write('<li><a title="'+legend[i]+'" OnMouseOver="window.status=\'Show this picture!\';return true;" OnMouseOut="window.status=\'\';return true;" OnClick="thb_choise('+i+');">');
			document.write('<img class="thb_img" name="thb_img" alt="'+legend[i]+'" src="'+p[i]+'" border="0" width="'+mythbwidth+'" height="'+mythbheight+'" onload="p_s=p_s+1"><\/a><\/li>');
			}
document.write('<\/ul>');
	}


function thumb_init() {
		var animElements = document.getElementsByName('thb_img');
		for(var i=0; i<animElements.length; i++) {
			var y = animElements[i];
			y.style.marginLeft = thumbmenu.startPositionLeft+'px';
			y.style.marginTop = thumbmenu.startPositionTop+'px';
			y.style.width = thumbmenu.startSizeWidth+'px';
			y.style.height = thumbmenu.startSizeHeight+'px';
			animElements[i].onmouseover = changeSize;
			animElements[i].onmouseout = restoreSize;
		}
		function changeSize() {
			this.style.marginLeft = thumbmenu.endPositionLeft+'px';
  	this.style.marginRight = '0px';
			this.style.marginTop = thumbmenu.endPositionTop+'px';
			this.style.width = thumbmenu.endSizeWidth+'px';
			this.style.height = thumbmenu.endSizeHeight+'px';
		}

			function restoreSize() {
			this.style.marginLeft = thumbmenu.startPositionLeft+'px';
			this.style.marginRight = '0px';
			this.style.marginTop = thumbmenu.startPositionTop+'px';
			this.style.width = thumbmenu.startSizeWidth+'px';
			this.style.height = thumbmenu.startSizeHeight+'px';
		}
}




//////////////////////////RIGHT-CLICK DEARM FUNCTION\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\\

var message="Please respect the copyright!\nFeel free to loop to luc@luc.net for all inquiries...";
function clickIE4(){if (event.button==2){return false;}}
function clickNS4(e){if (document.layers||document.getElementById&&!document.all){
if (e.w1==2||e.w1==3){return false;}}}
if (document.layers){document.captureEvents(Event.MOUSEDOWN);document.onmousedown=clickNS4;}
else if (document.all&&!document.getElementById){document.onmousedown=clickIE4;}
document.oncontextmenu=new Function("return false")


