// ==============================================// Copyright 2007 by Paolo 'gentax' Genta// // Author: gentax - http://www.gentax.it// Free for all; but please leave in the header.// ==============================================function acaso(){	whichImage = Math.round(Math.random()*(contatore-1));	return whichImage;	}	function length(oggetto){	var c=0;	for (var prop in oggetto){c++;}	return c;	}// show random image in the header of the page, adding the reflex effectsfunction showImage(counter,percorso,home){	contatore = counter;		while (length(obj)<=0){		obj[acaso()] = whichImage + ".jpg";	}		percorso = "http://www.gentax.it/header/";		for (var contenuto in obj){		if(home) 			document.write('<img src="'+percorso+contenuto+'.jpg" alt="Foto di Paolo Genta" /></a>') 		else 			document.write('<img src="'+percorso+contenuto+'.jpg" alt="Foto di Paolo Genta" class="reflex itiltnone iheight20"  width="100%"/></a>');	}} // slide image in the home pagefunction slideHome(){	Array.prototype.shuffle = function() {		function randOrd(){return (Math.round(Math.random())-0.5); }		this.sort( randOrd );	}		var obj={};	var myPics = [0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17];	myPics.shuffle();		$('#immagine').crossSlide({		  sleep: 4,  //sec		  fade: 2    //sec		}, [		  { src: 'immagini/home/'+myPics[0]+'.jpg' },		  { src: 'immagini/home/'+myPics[1]+'.jpg' },		  { src: 'immagini/home/'+myPics[2]+'.jpg' },		  { src: 'immagini/home/'+myPics[3]+'.jpg' },		  { src: 'immagini/home/'+myPics[4]+'.jpg' },		  { src: 'immagini/home/'+myPics[5]+'.jpg' },		  { src: 'immagini/home/'+myPics[6]+'.jpg' },		  { src: 'immagini/home/'+myPics[7]+'.jpg' },		  { src: 'immagini/home/'+myPics[8]+'.jpg' },		  { src: 'immagini/home/'+myPics[9]+'.jpg' },		  { src: 'immagini/home/'+myPics[10]+'.jpg' },		  { src: 'immagini/home/'+myPics[11]+'.jpg' },		  { src: 'immagini/home/'+myPics[12]+'.jpg' },		  { src: 'immagini/home/'+myPics[13]+'.jpg' },		  { src: 'immagini/home/'+myPics[14]+'.jpg' },		  { src: 'immagini/home/'+myPics[15]+'.jpg' },		  { src: 'immagini/home/'+myPics[16]+'.jpg' },		  { src: 'immagini/home/'+myPics[17]+'.jpg' }		]);}// bind the keyboard arrows to the next & prev arrow in the pictures galleryfunction arrows(){	$(document)	.bind('keydown', 'right', function(){		var whereR = $('a.ui-icon-right').attr('href');		if(whereR != undefined) window.location.href=whereR;	})	.bind('keydown', 'left',function(){		var whereL = $('a.ui-icon-left').attr('href');		if(whereL != undefined) window.location.href=whereL;	});}// fix the links in the gallery breacrumbs// plus call the arrows functionfunction breadcrumbs() {	$(".g-breadcrumbs li:first a")		.text('Fotografie')		.attr("href","/fotografie.php");				if($("a.BreadCrumb-2").text()=='\nSud Africa'){		$("a.BreadCrumb-2").attr("href","/fotografie.php");	}	else 	if( ($("a.BreadCrumb-2").text()=='\nMatrimoni2007') || ($("a.BreadCrumb-2").text()=='Matrimoni2007') ){		$("a.BreadCrumb-2").attr("href","/fotografieMatrimoni2007.php");	}	arrows();}$(function() {	if($('#gallery3').length > 0){		breadcrumbs();	} else {	// show the bottom div, adding a 'fade' behaviour		$("#bottomLine").show();		$("#bottomLine .box").css('opacity',"0.4");		$('#bottomLine .box').each(function(){			$(this).hover(function() {				$(this).css('opacity',"0.8");			}, function() {				$(this).css('opacity',"0.4");			});		});		// add click --> go home to the h2.paologenta text		$('h2.paoloGenta')		.hover(function() {			$(this).css('cursor', 'pointer');		}, function() {		})		.click(function() {			window.location.href = '/index.php';		});				//if($('#home').length > 0) slideHome();		slideHome();		}})
