﻿var gname = "online-shop";
        $(document).ready(function() {
            $(".onhover").hover(function() {
                var that = this;
                $(this).children('.on').fadeOut(25, function() {
                    $(that).children('.off').fadeIn(25);
                });


            }, function() {
                var that = this;
                $(this).children('.off').fadeOut(25, function() {
                    $(that).children('.on').fadeIn(25);
                });

            })

            $("#search").submit(function() {

            })

            $("#loginbtn").click(function() {
                $("#login").show();
            })
            $("#nlclose").click(function() {
                $("#login").hide();
            })

            var text = '';
            if ($(".current_page_parent").length) {
                text = $(".current_page_parent").text();
            }
            if ($(".current_page_item").length) {
                text = $(".current_page_item").text();
            }

            if ((text == '') && (gname != '')) {
                $(".nav ul li").each(function() {
                    if ($(this).text().toLowerCase() == gname.toLowerCase()) {
                        $(this).addClass(gname);
                    }
                });
            }


            $(".current_page_parent").addClass(gname);
            $(".current_page_item").addClass(gname);
            $("#mycarousel .page_item").addClass(gname);


            jQuery('#mycarousel').jcarousel({
                scroll: 6,
                buttonNextHTML: '<div><a title="next">></a></div>',
                buttonPrevHTML: '<div><a title="previous"><</a></div>',
                itemLoadCallback: function() {
                    $(".jcarousel-next").addClass(gname);
                    $(".jcarousel-prev").addClass(gname);
                },
                buttonNextCallback: function(a, b, c) {
                    if (c) {
                        $(".jcarousel-next").show();
                    } else {
                        $(".jcarousel-next").hide();
                    }

                },
                buttonPrevCallback: function(a, b, c) {
                    if (c) {
                        $(".jcarousel-prev").show();
                    } else {
                        $(".jcarousel-prev").hide();
                    }
                }
            });

            if (typeof (slides) != "undefined") {
                if (slides.length > -1) {
                    for (i = 0; i < slides.length; i++) {
                        $("#" + slides[i]).slideView({ easeFunc: "easeInOutBack", easeTime: 600 });
                    }
                }
            }

            Cufon.now();
        });
