﻿function menuHover()
{
    $(this).stop().animate({
        opacity: 1
    });
}
function menuOut()
{
    $(this).stop().animate({
        opacity: 0
    });
}
/*var stack_topRight;
var stack_bottomLeft;
var stack_topRight_ready, stack_bottomLeft_ready;*/
$(document).ready(function () 
{
    //
    // the menu
    //
    $('ul#menuList a').hover(function() {
        $(this).stop().css({backgroundPosition: "0px 0px"}).animate(
            {backgroundPosition: "-171px 0px"},
		    500);
		}, function() {
        $(this).stop().animate(
            {backgroundPosition: "-342px 0px"},
		    500);
    });
    $("#menu_contactezNous span").css("opacity","0");
    $("#menu_contactezNous span").hover(menuHover, menuOut);
    //
    // the rotation
    //
    var $rotatingImages1_container = $('#rotatingImages1').cycle({ 
        random: 1,
        timeout: 5000,
        before: function(curr, next, opts)
        {
            $('#rotatingImages2').cycle(opts.nextSlide)
        }
     }).show();
     $('#rotatingText').cycle({ 
        random: 1,
        timeout: 8000
     }).show();
     $('#rotatingImages2').cycle({ 
        timeout: 0,
        startingSlide: $rotatingImages1_container.data('cycle.opts').currSlide
     }).show();

 });

 function createPlayer(container, width, height, flashvars) {
     /*var flashvars = {
     controlbar: "over",
        backcolor=695d50
         autostart: "true",
         repeat: "always",
         file: file
         frontcolor=ffffff&lightcolor=f79122&screencolor=000000&playlist=bottom&playlistsize=120
     };*/
     var params = {
         allowfullscreen: "true",
         allowscriptaccess: "always",
         menu: "false",
         wmode: "opaque"
     };
     var attributes = {
        id: "ply",
        name: "ply"
     };
     
     swfobject.embedSWF("/FLVPlayer/player.swf", container, width, height, "9.0.115", false, flashvars, params, attributes);
 }
