jQuery(document).ready(function() {
    var left;
    var i;
    var widthImgList;

    jQuery("#scrollRight").bind("mouseover", function() {//scrollLeft

        var widthBox = jQuery("#scrollBox").width();
        widthImgList = jQuery("#scrollImgList").width();

        var left_parent = jQuery("#scrollBox").offset().left;

        left = jQuery("#scrollImgList").offset().left - left_parent;

        if ((widthImgList + left) >= widthBox) {
            jQuery("#scrollImgList").animate({left: "-=" + ((widthImgList + left - 1) - widthBox)}, 2000);

        } else {
            jQuery("#scrollImgList").stop(true);
        }
    });
    jQuery("#scrollRight").bind("mouseout", function() {//scrollLeft

        jQuery("#scrollImgList").stop(true);

    });


    jQuery("#scrollLeft").bind("mouseover", function() {//scrollRight

        var widthBox = jQuery("#scrollBox").width();
        widthImgList = jQuery("#scrollImgList").width();
        var left_parent = jQuery("#scrollBox").offset().left;
        left = jQuery("#scrollImgList").offset().left - left_parent;

        if ((widthImgList - left) >= widthBox) {
            jQuery("#scrollImgList").animate({left: "+=" + (- left + 1)}, 2000)
        } else {
            jQuery("#scrollImgList").stop(true);
        }
    });
    jQuery("#scrollLeft").bind("mouseout", function() {  //scrollRight

        jQuery("#scrollImgList").stop(true);

    });

    /*   $("#scrollImgList img").click(function(){
     var img_id = $(this).attr("id");
     $(".item_homepage").css("display","none");
     $("#"+img_id+"_homepage").css("display","block");
     $("#scrollImgList img").css("border", "6px solid #fff");
     $("#scrollImgList img").css("width", "55px");
     $("#scrollImgList img").css("height", "55px");
     $(this).css("border", "6px solid #0b95b4");
     $(this).css("width", "72px");
     $(this).css("height", "72px");

     });*/

    /* $("#scrollImgList img").bind("mouseover", function() {
     $(this).css("border", "6px solid #0b95b4");
     $(this).stop().animate({width:"72px",height:"72px", margin:"-9px"}, 400);

     });
     $("#scrollImgList img").bind("mouseout", function() {  //scrollRight
     $(this).css("border", "6px solid #fff");
     $(this).stop().animate({width:"55px",height:"55px",margin:"0px"}, 400);

     });*/
    jQuery('.menu').hover(
            function() {

            },
            function() {

                //jQuery(".current").next().next(".submenu_box").show();
               // jQuery(".current").next(".sub_menu_marker").show();

            }
            );
    jQuery("#sub_menu").hover(function() {
        //jQuery(".submenu_box").show();
        //jQuery(".sub_menu_marker").show();
    },

            function() {
                jQuery(".submenu_box").hide();
                jQuery(".sub_menu_marker").hide();
            });


    jQuery("#scrollRight_").bind("mouseover", function() {//scrollLeft

        var widthBox = jQuery("#scrollBox_").width();
        widthImgList = jQuery("#scrollImgList_").width();

        var left_parent = jQuery("#scrollBox_").offset().left;

        left = jQuery("#scrollImgList_").offset().left - left_parent;

        if ((widthImgList + left) >= widthBox) {
            jQuery("#scrollImgList_").animate({left: "-=" + ((widthImgList + left - 1) - widthBox)}, 2000);

        } else {
            jQuery("#scrollImgList_").stop(true);
        }
    });
    jQuery("#scrollRight_").bind("mouseout", function() {//scrollLeft

        jQuery("#scrollImgList_").stop(true);

    });


    jQuery("#scrollLeft_").bind("mouseover", function() {//scrollRight

        var widthBox = jQuery("#scrollBox_").width();
        widthImgList = jQuery("#scrollImgList_").width();
        var left_parent = jQuery("#scrollBox_").offset().left;
        left = jQuery("#scrollImgList_").offset().left - left_parent;

        if ((widthImgList - left) >= widthBox) {
            jQuery("#scrollImgList_").animate({left: "+=" + (- left + 1)}, 2000)
        } else {
            jQuery("#scrollImgList_").stop(true);
        }
    });
    jQuery("#scrollLeft_").bind("mouseout", function() {  //scrollRight

        jQuery("#scrollImgList_").stop(true);

    });


    jQuery(".opacity").hover(function() {
        $(this).css("filter", "progid:DXImageTransform.Microsoft.Alpha(opacity=0)");
        $(this).css("opacity", 0);
    },

            function() {
                $(".opacity").css("filter", "progid:DXImageTransform.Microsoft.Alpha(opacity=50)");
                $(".opacity").css("opacity", 0.5);
            });


}
        );
