/*
 * Demo binding and preparation, no need to read this part
 */ (function($){
		// Borrowed from jQuery easing plugin
		// http://gsgd.co.uk/sandbox/jquery.easing.php
		$.easing.easeOutExpo = function(x,t,b,c,d) { return (t==d) ? b+c : c * (-Math.pow(2, -10 * t/d) + 1) + b; };
			
		// By default, the scroll is only done vertically ('y'), change it to both.
		$.scrollTo.defaults.axis = 'x'; 	
		$.scrollTo.defaults.duration = '200';
		$.scrollTo(0); // This one is important, many browsers don't reset scroll on refreshes

		function scrollThis(y) { $.scrollTo(y, { easing:'easeOutExpo' }); return false; }

		$('#s_accueil').click(function(){ scrollThis(0); });
		$('#s_concept').click(function(){ scrollThis(600); });
		$('#s_chef').click(function(){ scrollThis(1500); });
		$('#s_vin').click(function(){ scrollThis(1800); });
		$('#s_reunion').click(function(){ scrollThis(5400); });
		$('#s_menu').click(function(){ scrollThis(2100); });
		$('#s_menubar').click(function(){ scrollThis(4500); });

	});


function steht () {
	var Agent = window.navigator.userAgent; 
	var AppName = window.navigator.appName;
	if ((AppName.indexOf("Explorer") >= 0) && (Agent.indexOf("Mozilla/3") >= 0) && (Agent.indexOf("Mac") >= 0))
		return true; 
	else return false; 
}

var floater;
var floatersub;
var LinkerRand = 0;
var old = LinkerRand;

function init() {
	floater = new getObj('navigation');
	bougeNav();
}

function getObj(name) {
	if (document.getElementById) {
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	} else if (document.all) {
		this.obj = document.all[name];
		this.style = document.all[name].style;
	} else if (document.layers)	{
		this.obj = getObjNN4(document,name);
		this.style = this.obj;
	}
}

function bougeNav() {

	if (document.documentElement && document.documentElement.scrollLeft)
		gescrolltes = document.documentElement.scrollLeft;
	else if (document.body)	// IE
		gescrolltes = document.body.scrollLeft;

	if (gescrolltes < LinkerRand)
		gescrolltes = LinkerRand;
	else
		gescrolltes += 0;

	if (gescrolltes != old)	{
		gescrolltes = (.5 *(gescrolltes-old))+old;
		floater.style.left = gescrolltes + "px";
	}

	old = gescrolltes;
	temp = setTimeout('bougeNav()',5);
}

function xGetTarget(xTarget) {
	var xLV1;
	if (document.all && document.getElementById) xLV1 = document.all[xTarget];
	if (document.layers) xLV1 = document.layers[xTarget];
	if (document.addEventListener) xLV1 = document.getElementById(xTarget);
	return xLV1;
}

function xPand(xTarget,xValue) {
	if (typeof(xTarget) == "string") {
		xTargetName = xTarget;
		xIcon = xGetTarget(xTargetName+"_i");
		xTarget = xGetTarget(xTarget);
	} else {
		xRef = xTarget;
		xTargetName = xRef.id;
		xIcon = xGetTarget(xTargetName+"_i");
		xTarget = xGetTarget(xTargetName+"_c");
	}

	if (xValue >= 0 && typeof(xTarget) == "object") {
		switch (xValue) {
			case 0:
				xTarget.style.display = "none";
				xTarget.xOpened = 0;
				break;
			case 1:
				xTarget.style.display = "block";
				xTarget.xOpened = 1;
				break;
		}
	} else {
		if (xTarget.style.display == "block") xTarget.xOpened = 1;
		if (xTarget.xOpened && typeof(xTarget) == "object") {
			if (xTarget.xOpened == 1) {
				xTarget.style.display = "none";
				xTarget.xOpened = 0;
			} else {
				xTarget.style.display = "block";
				xTarget.xOpened = 1;
			}
		} else if (typeof(xTarget) == "object") {
			xTarget.style.display = "block";
			xTarget.xOpened = 1;
			if (xIcon) xIcon.oSrc = xIcon.src;
		}
	}
	if (xIcon && typeof(xTarget) == "object") {
		if (!xIcon.oSrc) xIcon.oSrc = xIcon.src;
		if (xTarget.xOpened == 1) {
			xSep = xIcon.oSrc.indexOf(".jpg");
			if (xSep < 0) xSep = xIcon.oSrc.indexOf(".gif");
			if (xSep > 0) {
				xIcon.src = xIcon.oSrc.substr(0,xSep) + "_a" + xIcon.oSrc.substr(xSep,xIcon.oSrc.length);
			}
		} else {
			xIcon.src = xIcon.oSrc;
		}
	}
}