$(document).ready(function () {

    /*products - view subcategories*/
    var $first = $('.subMenu a.image:first');
    var fimage = $first.attr("rel");
    var flink = $first.attr("href");
    var ftitle = $first.attr("title");
    $first.addClass('current');

    $("#gallery").html('<h2>' + ftitle + '</h2><img src="' + fimage + '" /><a class="more" href="' + flink + '"></a>');

    $(".subMenu a.image").mouseover(function () {
        $(".subMenu a.image").removeClass('current');
        $(this).addClass('current');
        var image = $(this).attr("rel");
        var link = $(this).attr("href");
        var title = $(this).attr("title");

        $("#gallery").html('<h2>' + title + '</h2><img src="' + image + '" /><a class="more" href="' + link + '"></a>');

        return false;
    });

    $(".subMenu a.image").mouseout(function () {
        return false;
    });

   

    /*product*/
    jQuery('#product_slider').jcarousel({
        vertical: true,
        scroll: 1,
        visible: 4
    });

    var $first = $('#product_slider li a:first');

    var image = $first.attr('rel');
    var title = $first.attr('title');
    $('#pimg a').each(function () { if ($(this).is('a:first-child')) this.style.display = 'block'; else this.style.display = 'none'; return; });



    $('#product_slider li a').click(function () {
        var pimage = $(this).attr('rel');
        var ptitle = $(this).attr('title');
        $('#pimg a').each(function () {
            var himage = $(this).attr('href');
            if (himage == pimage) $(this).show(); else this.style.display = 'none'; 
            return;
         });
         
        return false;
    });

    /*prettyPhoto*/
    jQuery("a[rel^='prettyPhoto']").prettyPhoto({ theme: 'light_square' });
  jQuery("a[rel^='lightbox']").prettyPhoto({ theme: 'light_square' });




}); 

