﻿$(document).ready(function () {
    $(".productitem").hover(function () {
        $(".productdescription", this).css("background-color", "#860e0e");
        $(".meerdetails", this).css("background-color", "#a70000");
    },
    function () {
        $(".productdescription", this).css("background-color", "#727272");
        $(".meerdetails", this).css("background-color", "#414141");
    }).click(function () {
        $("a.meerdetails", this).trigger('click');
    }).css({'cursor':'pointer'});

    $("a.meerdetails").fancybox({
        'hideOnContentClick': false,
        'zoomSpeedIn': 0,
        'zoomSpeedOut': 0,
        'overlayShow': true,
        'overlayColor': '#000',
        'overlayOpacity': 0.8,
        'padding': 0,
        'width': 708,
        'height': 626
    });

    $("a.detailpic").fancybox({
        'hideOnContentClick': false,
        'zoomSpeedIn': 0,
        'zoomSpeedOut': 0,
        'overlayShow': true,
        'overlayColor': '#000',
        'overlayOpacity': 0.8,
        'padding': 0,
        'width': 708,
        'height': 516
    });
});

$(function() {
    var images = [
       'images/slideshow/1.jpg',
       'images/slideshow/2.jpg',
       'images/slideshow/3.jpg',
       'images/slideshow/4.jpg',
       'images/slideshow/5.jpg'
   ],
   loop = -1,
   $slideshow = $('#slideshow');

   var timerFade = null;

   function fader() {
        $slideshow.fadeOut('fast', function() {
            $slideshow.css('background', '#38383a url(' + images[loop] + ') top center no-repeat');
            /* text[loop].css('display', 'block');*/
            $('.slideshowtext').css({ "display": "none" });
            $('.slideshowtext:nth-child('+(loop+1)+')').css({ "display": "block" });
            $slideshow.fadeIn('fast', function() {
                timerFade = setTimeout(fader, 5000);
            });
        });

        if (loop < images.length - 1)
            loop++;
        else loop = 0;
    };
    fader();
});

