Event.observe(window, 'load', function() {
    $$("div.img.jobPhotoSlide div.other").each(function(ele) {
        ele.observe('click', function() {
            if (this.className.match(/other_disabled/i)) {
                return ;
            }
            layout_no = 0;
            image_num = 0;
            $A($('ul' + this.id).getElementsByTagName('li')).each(function(li) {
                if (li.innerHTML.match(/180x180\-f1/)) {
                    layout_no = image_num;
                }
                image_num ++;
            });
            if (layout_no == 0) {
                pre_div_class_name = "previous_button previous_button_disabled";
            } else {
                pre_div_class_name = "previous_button";
            }
            if (layout_no+1 == image_num) {
                next_div_class_name = "next_button next_button_disabled";
            } else {
                next_div_class_name = "next_button";
            }
            $('ul' + this.id).style.left = "-" + (layout_no*180) + "px";
            $A(this.parentNode.getElementsByTagName("div")).each(function(div) {
                if (div.className.match(/previous/i)) {
                    div.className = pre_div_class_name;
                } else if (div.className.match(/next/i)) {
                    div.className = next_div_class_name;
                }
            });
        });
    });
});

