function resizeImage(obj, limitWidth, limitHeight) {
    limitWidth = limitWidth || 120;
    limitHeight = limitHeight || 120;

    if (obj.width > limitWidth) {
        obj.style.width = limitWidth + 'px';
        obj.style.height =  (limitWidth * obj.height / obj.width) + 'px';
    }

    if (obj.height > limitHeight) {
        obj.style.height = limitHeight + 'px';
        obj.style.width =  (limitHeight * obj.width / obj.height) + 'px';
    }

    obj.style.visibility = 'visible';
}

$.fn.extend({
    formVal : function (name) {
        return $("[name="+ name +"]", this).val();
    }
});

(function ($) {
    $(function () {
        $("table.hover tr, dl.subject_item").hover(function () {
            $(this).addClass("hover");
        }, function () {
            $(this).removeClass("hover");
        });

        $(".kg_hover").hover(function () {
            $(this).addClass("hover");
        }, function () {
            $(this).removeClass("hover");
        }).removeClass("kg_hover");

        window.setInterval(function () {
            $("img.captcha").click();
        }, 1200000);

        //hash_init();

        return true;
    });
})(jQuery);
