$(document).ready(function (){    if ($.cookie('first') == 'nee')    {    }    else    {        $.cookie('first', 'ja');    }    $('.mycarousel').jcarousel(    {        wrap: 'circular',        auto: 2,        vertical: true,        scroll: 1,        initCallback: function ()        {            $('#menu').css('opacity', '0');        }    });    $('.jcarousel-skin-tango ').css('visibility', 'visible');    if ($.cookie('first') == 'nee')    {        $('#menu').css('opacity', '1');    }    else if ($.cookie('first') == 'ja')    {        if ($('#home').length)        { // implies *not* zero            opening();            $.cookie('first', 'nee');        }        else        {            $('#menu').css('opacity', '1');        }    }    function opening()    {        $('#footer').hide();        $('#men').hide();        $('.nieuws').hide();        $('#bno').hide();        $('#wit').css('height', '0');        $('#wit').css('width', '5px');        $('#wit').css('top', '500px');        $('#wit').animate(        {            width: '100%'        }, 900);        $('#wit').delay(600).animate(        {            height: '363px',            top: '168px'        }, 900, function ()        {            $('#footer').fadeIn('900');            $('#menu').animate(            {                opacity: 1            }, 900);            $('#men').delay(200).fadeIn('slow', function ()            {                $('.nieuws').fadeIn('slow', function ()                {                });                $('#bno').fadeIn('slow', function ()                {                });            });        });    }    $('.slide').css("display", "block");    if ($('.scroll').length)    { // implies *not* zero        $(function ()        {            $('.scroll').jScrollPane();        });    }    else    {    } /*center()*/    hideSlides()    $('#werk span').each(function (index)    {        $(this).animate(        {            opacity: 0.4        }, 300);    });    $('.blokje a').click(function ()    {        if ($('.slide').is(':animated'))        {            return false;        }        else        {            $('.blokje a[name]').each(function (index)            {                $(this).removeAttr("name");                $(this).parent().find(".flip").delay(100).animate(                {                    width: "0",                    left: "50%"                }, 75, function ()                {                    $(this).parent().find(".plaatje").animate(                    {                        width: "100%",                        left: "0"                    }, 75);                });            });            $(this).attr("name", "huidig");            $(this).parent().find(".plaatje").css("z-index", "400");            $(this).parent().find(".flip").css("z-index", "500");            $(this).parent().find(".plaatje").animate(            {                width: "0px",                left: "20px"            }, 75, function ()            {                $(this).parent().find(".flip").delay(100).animate(                {                    width: "100%",                    left: "0%"                }, 75);            });        }    }); /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    /*                ANIMATE FIRST SLIDE          */    /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    if ($('.first').length)    { // implies *not* zero			        $('body').css('overflow-x', 'hidden');        var $target = $('#content').position(); /* ANIMATE THE SLIDE */        $('.first').attr("title", "current")        $('.first').show();        $('.first').animate(        {            "left": $target.left        }, 1000);    }    else    {    } /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    /*                HIDE SLIDES                  */    /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    function hideSlides()    {        $pageWidth = $(window).width();        $('.slide').each(function (index)        {            if ($(this).attr('title'))            {                var $target = $('#content').position();                $(this).css("left", $target.left);            }            else            {                $(this).css('left', $pageWidth + "px");                $(this).hide();            }        });    } /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    /*                CLICK SLIDES                 */    /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    $("#slidemenu a").click(function (e)    {        if ($('.slide').is(':animated'))        {            return false;        }        else        {            $('#slidemenu a').each(function (index)            {                $(this).attr("id", "")            });            $(this).attr("id", "current")            $slide = $(this).attr('href');            if ($($slide).attr('title'))            { /* CURRENT */                return false;            }            else            {                $('body').css('overflow-x', 'hidden');                $(".slide[title]").animate(                {                    "left": $pageWidth + "px"                }, 1000, function ()                {                    $(this).hide();                    $('body').css('overflow', 'auto');                });                $(".slide[title]").removeAttr('title');            } /* ADD ATTR TITTLE FOR LATER USE */            $($slide).attr("title", "current")            var $target = $('#content').position(); /* ANIMATE THE SLIDE */            $($slide).show();            $($slide).animate(            {                "left": $target.left            }, 1000);            $($slide).dequeue()            return false;        };    }); /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    /*                ON SCREEN RESIZE             */    /* * *  *  *  *  *  *  *  *  *  *  *  *  *  *  */    $(window).resize(function ()    {        hideSlides()    }); /* FORMULIER */    if ($('#formID').length)    { // implies *not* zero        $("#formID").validationEngine(        {            openDebug: true,            ajaxSubmit: true,            ajaxSubmitFile: "ajaxSubmit.php",            ajaxSubmitMessage: "Bedankt voor uw interesse. Wij nemen zo spoedig mogelijk contact met u op.",            success: false,            failure: function ()            {            }        });    }    else    {    }});/* News ticker */$(function(){	var ticker = function()	{		setTimeout(function(){			$('#newsTicker li:first').animate( {marginTop: '-80px'}, 800, function()			{				$(this).detach().appendTo('ul#newsTicker').removeAttr('style');				});			ticker();		}, 5000);	};	ticker();});
