﻿$(document).ready(function() {

    //$('#content').hide();
    for (var i = 1; i <= iImages; i++) {
        $('#img_' + i).css('opacity', 0);
    }
    $('#content').show();
    setTimeout('imLoad()', 150);



});
var i = 1;
var iPos = 48;
function imLoad() {
    $('#img_' + i).animate({ opacity: 0.75 }, 500);
    i++;
    if (i <= iImages) {
        if (i <= 10) {
            setTimeout('imLoad()', 150);
        } else {
            imLoad();
        };
    } else {
        $('.categories img').css('opacity', 0.8).hover(function() {
            $(this).animate({ opacity: 1 }, 250);
        }, function() {
            $(this).animate({ opacity: 0.75 }, 850);
        });
        //        $('#divArLeft').mousedown(function() {
        //            if (iPos < 48) {
        //                iPos = iPos + 99;
        //            }
        //            $('#content').animate({ left: iPos }, 400);
        //        });
        //        $("divArLeft").mouseup(function() {
        //            if (iPos < 48) {
        //                iPos = iPos + 99;
        //            }
        //            $('#content').animate({ left: iPos }, 400);
        //        }).mousedown(function() {
        //            if (iPos < 48) {
        //                iPos = iPos + 99;
        //            }
        //            $('#content').animate({ left: iPos }, 400);
        //        });

        //        $('#divArLeft').mouseover(function() {
        //            if (iPos < 48) {
        //                iPos = iPos + 99;
        //            }
        //            $('#content').animate({ left: iPos }, 400);
        //        });
        //        $('#divArRight').mouseover(function() {
        //            if (iPos > -((iImages - 10) / 2 * 99 - 48)) {
        //                iPos = iPos - 99;
        //            }
        //            $('#content').animate({ left: iPos }, 400);
        //        });
        $('#divArLeft').click(function() {
            if (iPos < 48) {
                iPos = iPos + 99;
            }
            $('#content').animate({ left: iPos }, 600);
        });
        $('#divArRight').click(function() {
            if (iPos > -((iImages - 10) / 2 * 99 - 48)) {
                iPos = iPos - 99;
            }
            $('#content').animate({ left: iPos }, 600);
        });
    };
};