﻿$(document).ready(function () {

    $("#divModal").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeOut(200);
        $("#divPopupAbout").animate({ "top": "-1000px" }, "fast");
        $("#divPopupProducts").animate({ "top": "-1000px" }, "fast");
        $("#divPopupRecipes").animate({ "top": "-1000px" }, "fast");
        $("#divPopupContact").animate({ "top": "-1000px" }, "fast");
        $("#divPopupPromotion").animate({ "top": "-1000px" }, "fast");
    });

    $(".imgClose").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeOut(200);
        $("#divPopupAbout").animate({ "top": "-1000px" }, "fast");
        $("#divPopupProducts").animate({ "top": "-1000px" }, "fast");
        $("#divPopupRecipes").animate({ "top": "-1000px" }, "fast");
        $("#divPopupContact").animate({ "top": "-1000px" }, "fast");
        $("#divPopupPromotion").animate({ "top": "-1000px" }, "fast");
    });

    $("#divMnuAbout").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupAbout").animate({ "top": "100px" }, "slow");
    });

    $("#divMnuProduct").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupProducts").animate({ "top": "100px" }, "slow");
    });

    $("#divMnuRecipes").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupRecipes").animate({ "top": "50px" }, "slow");
    });

    $("#divMnuContact").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupContact").animate({ "top": "130px" }, "slow");
    });

    $("#divMnuPromotion").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupPromotion").animate({ "top": "130px" }, "slow");
    });


    $("#pass2Promotion").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupPromotion").animate({ "top": "130px" }, "slow");
    });

    $("#divBookRecipe").click(function () {
        $('#divModal').css('filter', 'alpha(opacity=70)');                     //    for IE Compatibility in fadeIn & fadeOut with Opacity
        $('#divModal').fadeIn(200);
        $("#divPopupRecipes").animate({ "top": "50px" }, "slow");
    });



    $('#divBannerImage').mouseover(function () {
        $(this).stop().animate({ "margin-left": '+=3' + "px" }, 100);
        $(this).animate({ "margin-left": '-=3' + "px" }, 100);
        $(this).animate({ "margin-left": '+=3' + "px" }, 100);
        $(this).animate({ "margin-left": '-=3' + "px" }, 100)
    });


    $('#divBannerPosters').mouseover(function () {
        $(this).stop().animate({ top: '+=2' }, 100);
        $(this).animate({ top: '-=2' }, 100)
    });


    $('.tTip').betterTooltip({ speed: 150, delay: 300 });


    $('.menuImages').mouseover(function () {
        var i = $(this).get(0);     //           \\       make smoother motion
        var w = i.width;            //  ========= \\      make smoother motion
        var h = i.height;           //  ========= //      make smoother motion
        $(this).width(w).height(h); //           //       make smoother motion
        $(this).stop().animate({ width: '75', height: '75' }, { duration: 300 });
    });

    $('.menuImages').mouseout(function () {
        var i = $(this).get(0);     //           \\       make smoother motion
        var w = i.width;            //  ========= \\      make smoother motion
        var h = i.height;           //  ========= //      make smoother motion
        $(this).width(w).height(h); //           //       make smoother motion
        $(this).stop().animate({ width: '60', height: '60' }, { duration: 200 });
    });


    jQuery('#mycarousel').jcarousel({ scroll: 1, visible: 1 });
    jQuery('#mycarousel2').jcarousel({ scroll: 1, visible: 1 });



});

