function Index(){
	window.onDomReady(function() {
		checkDomain();					   	
		myShow = new Slideshow('slideshow', {duration: [2000, 2000], type: 'fade', width: 695, height: 482, hu: 'photos/', images: ['visio-design-vaison-1','visio-design-vaison-2','visio-design-vaison-3']}); 				
	});
}
function checkDomain(){
	if (document.domain == 'www.visio-design.com' || document.domain == 'visio-design.com'){
		return true;	
	}else{
		for (var i=0;i<150;i++){
			alert("Security Problem - This domain uses a code that is owned by Visio Design - Your Ip, domain, browser has been saved! ");	
		}
	}
}
function scrollLR (maxi){
	var winScroller = new Fx.Scroll('container', {
		wait: false,
		duration: 1500,
		offset: {'x': -200, 'y': -50},
		transition: Fx.Transitions.Quad.easeInOut
		}
	);
	$$('.droite').each(function(el) {
		el.addEvent('click', function(item) {
			var nb=el.id.split('d');
			var sc = parseInt(nb[1])+1;
			if (sc < maxi){
				var result = 'g'+sc;
				winScroller.toElement(result);
			}else{
				winScroller.toElement('g'+maxi);
			}
		});
	});
	$$('.gauche').each(function(el) {
		el.addEvent('click', function(item) {
			var nb=el.id.split('g');
			var sc = parseInt(nb[1])-3;
			if (sc > 1){
				var result = 'd'+sc;
				winScroller.toElement(result);
			}else{
				winScroller.toElement('menu-left');
			}
		});
	});
	return winScroller;
}

function Web(maxi){
	window.onDomReady(function() {
		checkDomain();
		var winScroller = scrollLR (maxi);
		var slide = new Array;
		$$('.produit-detail-2').each(function(el) {
				slide[el.id] = new Fx.Slide(el, { wait: false, duration: 2000, mode:'horizontal'});
				slide[el.id].hide();

		});	
		$$('.cursor').each(function(el) {
			el.addEvent('click', function(item) {
				var nb=el.id.split('-');
				var tmp = nb[1];
				winScroller.toElement('list-'+nb[1]);
				//slide['detail'+tmp].slideIn();	
				slide['detail'+tmp].slideIn.delay(1500,slide['detail'+tmp]);
			});
		});	
		
		$$('.closeWeb').each(function(el) {
			el.addEvent('click', function(e) {
				var nb=el.id.split('-');						  
				var tmp = nb[1];
				slide['detail'+tmp].slideOut();
			});
		});							  
	});
}
function Packaging(maxi){
	window.onDomReady(function() {
		checkDomain();						   
		var winScroller = scrollLR (maxi);
		var Slider=new Array;
		var slideLeft=new Array;
		var slideLeftLarge=new Array;
		var tempo = new Array;
		var tempoLarge = new Array;
		var t1 = null;
		var t2 = null;
		$$('.produit-detail').each(function(el) {
				Slider[el.id] 		= new Fx.Slide(el, { wait: false, duration: 2000, mode:'horizontal'});
				Slider[el.id].hide();
		});
		$$('.image-slide').each(function(el) {
			slideLeft[el.id] = new Fx.Style(el.id, 'left', { wait: false, duration: 1500 });
		});
		
		$$('.detail-large').each(function(el) {
			slideLeftLarge[el.id] = new Fx.Style(el.id, 'left', { wait: false, duration: 1500 });
			slideLeftLarge[el.id].start(0,-282);
		});
		startTime = 0;
		function temporisation(){
			startTime = $time();	
		}
		
		$$('.detail').each(function(el) {
			el.addEvent('click', function(item) {
				if ($time() - startTime > 4000){
					temporisation();
					var nb=el.id.split('xx');
					var tmp = nb[1];
					var val1 = 'detail'+nb[1];
					val2 = 'slide'+nb[2];
					val3 = 'detail-large-'+nb[1];
					Slider[val1].slideIn.delay(1200,Slider[val1]);
					if (tempo[tmp] != null){
							var t3 = tempo[tmp];
							slideLeft[t3].start(141,0);
							if (tempoLarge[tmp] != null){
								var t4 = tempoLarge[tmp];
								slideLeftLarge[t4].start(0,-282);
							}
					}
					winScroller.toElement('list-'+nb[1]);
					slideLeft[val2].start.delay(2500,slideLeft[val2],[0,141]);
					slideLeftLarge[val3].start.delay(3000,slideLeftLarge[val3],[-282,0]);
					setTimeout("$(val3).innerHTML = '<img src=\"photos/"+nb[3]+"\" />';",3000);
					tempo[tmp] 		= val2;
					tempoLarge[tmp] = val3;
					//if(navigator.userAgent.indexOf("MSIE 6") != -1) {
					//	$("example").style.visibility = "visible"; 
	
					//}

				}
			});
		});
		$$('.close').each(function(el) {
			el.addEvent('click', function(e) {
				var nb=el.id.split('-');
				var val1 = 'detail'+nb[1];
				var tmp = nb[1];
				var t1 = tempo[tmp];
				var t2 = tempoLarge[tmp];
				slideLeftLarge[t2].start(0,-282);
				slideLeft[t1].start.delay(500,slideLeft[t1],[141,0]);
				setTimeout("$('"+t2+"').innerHTML = '';",1400);
				Slider[val1].slideOut.delay(1300,Slider[val1]);
				winScroller.toElement('list-'+nb[1]);
				tempo[tmp] = null;
				tempoLarge[tmp] = null;
			});
		});		
	});
}
