
$j = jQuery.noConflict();

$j(document).ready(function() {



    jQuery('#pinesolutionspromo img, #pinesolutionspromo p').click(function () {

        jQuery("#pinesolutionspromo p a").text("Use code 'Dressing'");
        window.open('http://www.oakdressingtable.co.uk/pinesolutionexclusiveoffer', 'newwin');
        return false;
    });


$j('.voucher a.info').click(function() {


$j(this).parent("p").parent("div").children(".voucher-info").slideToggle(1000); 

    return false;
});
    


    /* Fires up the Home Carousel*/
    $j('#carousel ul').jcarousel({
        auto: 8,
        scroll: 1,
        animation: 600,
        wrap: 'last'

    });

    /* Select correct menu item style for current page*/
    $j('#menu a').each(function() {
        if (window.location.href.toLowerCase().indexOf($j(this).attr('href').toLowerCase()) >= 0 &&
             $j(this).attr('href').length > 1) {
            $j(this).addClass('current');
        }

    });


    $j('#categories a').each(function() {
        if (window.location.href.toLowerCase().indexOf($j(this).attr('href').toLowerCase()) >= 0 &&
             $j(this).attr('href').length > 1) {
            $j(this).addClass('current');
        }

    });

    if (window.location.href.toLowerCase() == 'http://www.oakdressingtable.co.uk/') {
        $j('#home a').addClass('current');

    }




    jQuery('#stock img').each(function() {

    if (jQuery(this).attr("height") > 130) {


        jQuery(this).css("height", 130);

    }

    if (jQuery(this).attr("width") > 140) {


        jQuery(this).css("width", 140);

    }
    
    });


    jQuery('#stock li').click(function() {
        window.open(jQuery("a", this).attr('href'), 'newwin').focus();
        return false;
    });

    jQuery('#stock li').hover(function() {

        return false;
    });


    jQuery('#stock li').mouseover(function() {
        jQuery(this).addClass('hover2');
    });
    jQuery('#stock li').mouseout(function() {
        jQuery(this).removeClass('hover2');
    });



});





