var nomnav = navigator.appName;

if (nomnav == 'Microsoft Internet Explorer'){  ///////////////////////////////////////////////////// POUR IE
	left_X=new Array("0","184","204","293","391","515","631","746","827");
	width_X=new Array("0","20","90","98","122","114","114","80","58");
} else { ///////////////////////////////////////////////////////////////////////////////////////////// POUR MAC
	left_X=new Array("0","184","205","297","396","437","588","693","773");
	width_X=new Array("0","20","90","98","40","153","106","80","58");
};

////////////////////////////////////////////////////////////////// MENU

mouvement=function(e){
	$("#indicateur").stop().animate({
    	left: left_X[e],
    	width: width_X[e]
    });
};

retour=function(e){
	if(e!=posit){
		$("#indicateur").stop().animate({
    		left: left_X[posit],
    		width: width_X[posit]
    	});
    };
};

////////////////////////////////////////////////////////////////// switch

pages=new Array("","index.php","presentation.php","nos-solutions.php","videosurveillance.php","telesurveillance.php","controle-d-acces.php","references.php","contact.php");

function switch_lang(){
	
	window.location.href="../FR/"+pages[posit];
	
}

////////////////////////////////////////////////////////////////// DEVIS


devis=new Object();
devis.init=function(){
	$('#bt_devis').css("cursor","pointer");
	$('#bt_devis').mouseover(function() {
		$("#devis").stop().animate({left: "35"});
	});
	$('#bt_devis').mouseout(function() {
		$("#devis").stop().animate({left: "15"});
	});
	$('#bt_devis').click(function() {
		window.location.href="mailto:sav@ses-video.com?subject=demande de SAV a partir du site internet";
	});
};

////////////////////////////////////////////////////////////////// INDIC


indic=new Object();
indic.init=function(){
	$('#indicateur').css("left",left_X[posit]+"px");
	$('#indicateur').css("width",width_X[posit]+"px");
};


////////////////////////////////////////////////////////////////// INDIC
focussur = new Object;
focussur.init = function() {
	
	p=-1;
	
	var rotator = setInterval(function rot() { 
		
		p++;
		if(p>=6){
			p=0;
		};
		
		pos=p*-205;
		$("#refs").stop().animate({top: pos});
	  
   	}, 2000); 
	
	
	$('#flD').click(function() {
		clearInterval(rotator);
		
		p++;
		if(p>=6){
			p=0;
		};
		
		pos=p*-205;
		$("#refs").stop().animate({top: pos});
		
	});
	
	$('#flG').click(function() {
		clearInterval(rotator);
		
		p--;
		if(p<0){
			p=5;
		};
		
		pos=p*-205;
		$("#refs").stop().animate({top: pos});
		
	});
	
};

///////////////////////////////////////////////////////////////// DOM READY

$(document).ready(function(){
	
		$.localScroll({
	 	hash:true,
		easing:'easeInOutExpo'
		});
		
		$('#homer').css("cursor","pointer");
		$('#homer').click(function() {
			window.location.href="index.php";
		});
		
		devis.init();
		indic.init();
		
		page=document.URL;
		page=page.split("/" ); 
		page=page[3];
		
		if(page=="index.php"||page==""){
			
			$('#carte').css("cursor","pointer");
			$('#carte').click(function() {
				window.location.href="/FR/contact.php";
			});
			
			$('#refs').css("cursor","pointer");
			$('#refs').click(function() {
				window.location.href="/FR/references.php";
			});
			
			focussur.init();
			
		};
		
		if(page=="contact.php"||page=="contact-envoi.php"){
			
			$('form').jqTransform({imgPath:'css/img/'});
			
		};
		
});

