﻿$(document).ready(function () {
    //HIDE 1ST THUMBCONTAINER'S LEFT MARGIN
    $(".Row .ThumbCntnr:first-child").css('margin', '4px 0 0 0');

    //Hide last divider in VidLinkCntnr
    $('.VidLinkCntnr span:last').hide();

});
$(window).load(function () {

    //SHOW/HIDE HOVER STATE ON RESULTS THUMBNAILS
    $(".ThumbCntnr").hover(
        function () {
            $(this).find('.Rollover').show();
        },
        function () {
            $(this).find('.Rollover').hide();
        }
     );

    $('.ThumbCntnr img, .ThumbCntnr input').animate({ opacity: 1 }, 1000);
    //$('#PrevBtn, #NextBtn').animate({ opacity: 1 }, 1000);
    //$('.PaginationCntnr').animate({ opacity: 1 }, 1000);
    $('#PrevBtn, #NextBtn')/*.fadeTo(1000, 1)*/.delay(1000).show(1);
    $('.PaginationCntnr')/*.fadeTo(1000, 1);*/.delay(1000).show(1);



    $('.ThumbCntnr img').each(function (index) {
        //set width and height of thumbnail if original width of image is less than container div
        var width, height
        width = $(this).width();
        height = 450; //large image

        if (width <= 309) {//narrow portrait
            //alert("1");
            $(this).css('width', 144 + 'px');
        } else if (width > height) {//landscape
            //alert("2");
            $(this).css('height', 210 + 'px');
        } else if (width <= height && width > 309) { //square
            //alert("3");
            $(this).css('height', 210 + 'px');
        } else {
            //alert("4");
            $(this).css('height', 210 + 'px');
        }
    });
    //$('#loader').css('display', 'none');



});

