// JavaScript Document
function pageIndex(loc) {
	var fileN, iPos;
	alert(loc);
	iPos = loc.indexOf("/");
	fileN = loc.substring(iPos);
	return (fileN == "/" || fileN == "index.php" );
	}

function reDirectTo (where) {
	switch (where) {
		case 0 : 
		window.location = "orteil.php";
		break;
		
		case 1 : 
		window.location = "jadieu.php";
		break;
		
		case 2 : 
		window.location = "petit_rocher.php";
		break;
		
		case 3 : 
		window.location = "wigwam.php";
		break;
		
		case 4 : 
		window.location = "famille_pepin.php";
		break;
		
		case 5 : 
		window.location = "projet_pupitre.php";
		break;
		
		case 6 : 
		window.location = "variation_S.php";
		break;
		
		case 7 : 
		window.location = "felicite.php";
		break;
		
		case 8 : 
		window.location = "cabaret.php";
		break;

		case 9 : 
		window.location = "banquise.php";
		break;

		case 10 : 
		window.location = "hima.php";
		break;
	
		case 11 : 
		window.location = "hikikomori.php";
		break;
		
		case 12 : 
		window.location = "chant.php";
		break;
		
		case 13 : 
		window.location = "lune.php";
		break;

		}
}
// Call on jQuery to reliquish DOLLAR SIGN as Variable of function call. Prevent conflict with MooTools
  $.noConflict();
  jQuery(document).ready(function($) {
 //$(document).ready(function(){
// $(window).load(function() {
	
	$('#slider').nivoSlider({
		effect:'slideInRight', // Specify sets like: 'fold,fade,sliceDown'
		// effect:'random', // Specify sets like: 'fold,fade,sliceDown'
		// slices:15, // For slice animations
		// boxCols: 8, // For box animations
		// boxRows: 4, // For box animations
		animSpeed:300, // Slide transition speed
		pauseTime:110000, // How long each slide will show
		//Integrate show number and compare to slide.
		
		startSlide:slideno, // Set starting Slide (0 index)
		
		directionNav:true, // Next & Prev navigation
		directionNavHide:false, // Only show on hover
		controlNav:true, // 1,2,3... navigation
		controlNavThumbs:false, // Use thumbnails for Control Nav
		controlNavThumbsFromRel:false, // Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', // Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
		keyboardNav:true, // Use left & right arrows
		pauseOnHover:true, // Stop animation while hovering
		manualAdvance:true, // Force manual transitions - Forcer une transition manuelle
		captionOpacity:0.5, // Universal caption opacity
		prevText: '<<<<', // Prev directionNav text
		nextText: '>>>>', // Next directionNav text
		beforeChange: function(){}, // Triggers before a slide transition
		afterChange: function(){
			if (!(accueil=="oui")){
				reDirectTo (slideno+1);		  
				} else {
				slideno++;
				//alert(slideno);
				$('img#change').attr('src', '../fr/res-gfx/interface/cal_'+slideno+'.png');
				//document.getElementById.('change').src="abc";
				
				}
			}, // Triggers after a slide transition
		slideshowEnd: function(){}, // Triggers after all slides have been shown
		lastSlide: function(){}, // Triggers when last slide is shown
		afterLoad: function(){} // Triggers when slider has loaded
	});
	
	$('#cal').nivoSlider({
		effect:'slideInRight', // Specify sets like: 'fold,fade,sliceDown'
		// effect:'random', // Specify sets like: 'fold,fade,sliceDown'
		// slices:15, // For slice animations
		// boxCols: 8, // For box animations
		// boxRows: 4, // For box animations
		animSpeed:300, // Slide transition speed
		pauseTime:5000, // How long each slide will show
		//Integrate show number and compare to slide.
		
		startSlide:slideno, // Set starting Slide (0 index)
		
		directionNav:true, // Next & Prev navigation
		directionNavHide:true, // Only show on hover
		controlNav:true, // 1,2,3... navigation
		controlNavThumbs:false, // Use thumbnails for Control Nav
		controlNavThumbsFromRel:false, // Use image rel for thumbs
		controlNavThumbsSearch: '.jpg', // Replace this with...
		controlNavThumbsReplace: '_thumb.jpg', // ...this in thumb Image src
		keyboardNav:true, // Use left & right arrows
		pauseOnHover:true, // Stop animation while hovering
		manualAdvance:true, // Force manual transitions
		captionOpacity:0.5, // Universal caption opacity
		prevText: '<<<<', // Prev directionNav text
		nextText: '>>>>', // Next directionNav text
		beforeChange: function(){}, // Triggers before a slide transition
		afterChange: function(){
			if (!(accueil=="oui")){
				reDirectTo (slideno+1);		  
				} else {
				slideno++;
				//alert(slideno);
				$('img#change').attr('src', '../fr/res-gfx/interface/cal_'+slideno+'.png');
				//document.getElementById.('change').src="abc";
				
				}
			}, // Triggers after a slide transition
		slideshowEnd: function(){}, // Triggers after all slides have been shown
		lastSlide: function(){}, // Triggers when last slide is shown
		afterLoad: function(){} // Triggers when slider has loaded
	});
	
/*** Added then commented out debug for assignment for all z-indexs (for IE7) -- Can be useful but in this case reaks havok with layout (bd) **
$(function() {
	var zIndexNumber = 1000;
	$('div').each(function() {
		$(this).css('zIndex', zIndexNumber);
		zIndexNumber -= 10;
	});
});*/	

	$('div#photos a').attr('title', function(i, val) {
	  var prefix = 'Photo © ';
	  return prefix + val
	});
});



