$("document").ready(function () {

    // homepage slideshow

    $('#slidethis').cycle({
        fx: 'fade',
        next: "#next",
        prev: "#prv",
        speed: 700,
        timeout: 8000
    });


    // product detail slideshow 

    $('#prod-main-rot').find(".slideshow").cycle({
        fx: 'fade',
        next: "#sld-next",
        prev: "#sld-prv",
        speed: 700,
        timeout: 8000
    });


    //set heights

    var v = 0;
    $('.best-sell-wrap').find('.desc').each(function () {
        var height = $(this).height();
        v = height > v ? height : v;
    });
    $('.best-sell-wrap').find('.desc').height(v);

    var l = 0;
    $('.fixlinks').find('.biglink').each(function () {
        var bigheight = $(this).height();
        l = bigheight > l ? bigheight : l;
    });
    $('.fixlinks').find('.biglink').height(l);

    //set three home coolumns to same height 

    var leftheight = $(".col1").find(".greytint").height();
    var middleheight = $(".col2").find(".greytint").height();
    var rightheight = $(".col3").find(".greytint").height();
    var arr = new Array(2);
    arr[0] = leftheight;
    arr[1] = middleheight;
    arr[2] = rightheight;
    var largest = arr.sort(function (a, b) { return a - b }).slice(-1);
    $(".col1").find(".greytint").height(largest);
    $(".col2").find(".greytint").height(largest);
    $(".col3").find(".greytint").height(largest);

    //set prodleft and prodright grey areas to same height

    var leftprod = $(".prod-left").height();
    var rightprod = $(".prod-right").height();
    var arr = new Array(1);
    arr[0] = leftprod;
    arr[1] = rightprod;
    var largestprod = arr.sort(function (a, b) { return a - b }).slice(-1);
    $(".prod-left").height((((largestprod - 0) + 18)));
    $(".prod-right").height((largestprod - 0));





    $(".prod-left").find(".whitebox:last").css("border-bottom", "none");


    //set left and right grey areas to same height
    /*
    var leftgrey = $("#left").find(".greytint").height();
    var rightgrey = $("#right").find(".greytint").height();
    var arr = new Array(1);
    arr[0] = leftgrey;
    arr[1] = rightgrey;
    var largestgrey = arr.sort(function(a,b){return a - b}).slice(-1);
    $("#left").find(".greytint").height(largestgrey);
    $("#right").find(".greytint").height(largestgrey);

    */





});

