	$(document).ready(function()
		{
			// Cookie stuff
			function setCookie(c_name,value,expiredays)
				{
					var exdate = new Date();
					exdate.setDate(exdate.getDate() + expiredays);
					document.cookie = c_name + "=" + escape(value) + ((expiredays == null) ? "" : ";expires=" + exdate.toUTCString());
				}

			function getCookie(c_name)
				{
					if(document.cookie.length > 0)
				  		{
				  			c_start = document.cookie.indexOf(c_name + "=");

							if(c_start != -1)
							    {
								    c_start = c_start + c_name.length + 1;
								    c_end = document.cookie.indexOf(";", c_start);

									if(c_end == -1)
										c_end = document.cookie.length;

									return unescape(document.cookie.substring(c_start,c_end));
							    }
				  		}

					return "";
				}

			// Get all variables from URL into array and prepare for further call
			$.extend(
				{
					getUrlVars: function()
						{
							var vars = [], hash;
							var hashes = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');

							for(var i = 0; i < hashes.length; i++)
								{
									hash = hashes[i].split('=');
									vars.push(hash[0]);
									vars[hash[0]] = hash[1];
								}

							return vars;
						},
						getUrlVar: function(name)
							{
								return $.getUrlVars()[name];
							}
				});

			// Get variable in question		main.php?page=foo
			//var foovar = $.getUrlVar('page');	// Result: foovar = foo

$.fn.cycle.transitions.scrollVertUp = function($cont, $slides, opts) {
        $cont.css('overflow','hidden');
        opts.before.push(function(curr, next, opts, fwd) {
                $.fn.cycle.commonReset(curr,next,opts);
                opts.cssBefore.top = fwd ? (next.cycleH-1) : (1-next.cycleH);
                opts.animOut.top = fwd ? -curr.cycleH : curr.cycleH;
        });
        opts.cssFirst = { top: 0 };
        opts.cssBefore= { left: 0 };
        opts.animIn   = { top: 0 };
        opts.animOut  = { left: 0 };
};

			// Tickerline
			$('ul#newsTickerList').cycle(
				{
				    fx:     'fade',
				    speed:  1000,
				    timeout: 5000,
				    sync: 0,
				    rev: 0,
				    cleartype: true,
				    cleartypeNoBg: true,
//				    easeIn: 'easeInOutQuad',
//				    easeOut: 'easeInOutQuad',
//				    next:   '#gallerySlide .next',			Next button
//				    prev:   '#gallerySlide .prev',			Previous button
				    pause: 1
				});




			// Submenu Display ----------------------------------------------------------------
			// Init
			$("ul.dropdown").css("display", "none");	// If Javascript is enabled, hide all dropdowns immediately
			$("ul.dropdown li").css("float", "none");	// If Javascript is enabled, disable floating of the list elements

			// Routine
			$(".dropdown").each(
				function()
					{
						$(this).parent().eq(0).hover(
							function()
								{
									$("a.sub", this).addClass("active");	// Mark parent tab active
									$(".dropdown:eq(0)", this).slideDown('normal').show();
								},
							function()
								{
									$("a.sub", this).removeClass("active");	// Remove mark from parent tab
									$(".dropdown:eq(0)", this).slideUp('fast').show();
								});
					});




			// Product pictures slides -----------------------------------------------------------
   			$('#imageContainerBox').cycle(
				{
				    fx:     'scrollHorz',
				    speed:  2000,
				    timeout: 5000,
				    sync: 1,
				    easeIn: 'easeInOutQuad',
				    easeOut: 'easeInOutQuad',
				    next:   '#nextBut',		//	Next button
				    prev:   '#prefBut',		//	Previous button
				    pause: 1
				});


			// Welcome section sujet animation ---------------------------------------------------

			$("#sujet1Box").cycle(
				{
					fx: 'fade',				// choose your transition type, ex: fade, scrollUp, shuffle, etc...
					timeout: 2000,
					speed: 4000,			// speed of the transition (any valid fx speed value)
					easing: null,
					delay: -2000				// additional delay (in ms) for first transition (hint: can be negative)
				});

			$("#sujet2Box").cycle(
				{
					fx: 'fade',				// choose your transition type, ex: fade, scrollUp, shuffle, etc...
					timeout: 2000,
					speed: 4000,			// speed of the transition (any valid fx speed value)
					easing: null,
					delay: -3000				// additional delay (in ms) for first transition (hint: can be negative)
				});

			$("#sujet3Box").cycle(
				{
					fx: 'fade',				// choose your transition type, ex: fade, scrollUp, shuffle, etc...
					timeout: 2000,
					speed: 4000,			// speed of the transition (any valid fx speed value)
					easing: null,
					delay: -1000				// additional delay (in ms) for first transition (hint: can be negative)
				});


		});
