window.onload = function(){
	/*공지사항 이미지에 링크가 걸릴수 있으므로 리사이징을 적용하지 않음
	 * By Chang hooon
	 * */
	if (location.href.indexOf("/notice/types/announcement") > -1 ) return;
    $('#content').find('img').each(function() {
        var maxWidth = 890;
        var maxHeight = 640;
        var ratio = 0;
        var width = $(this).width();
        var height = $(this).height();

        if (width >= maxWidth) {
        	var src = $(this).attr("src");
        	var url = src.replace("/util/image/view", "/util/image/popup");
        	$(this).attr("style", "cursor:pointer");
        	$(this).attr("onClick", "window.open('" + url + "', 'imageview', 'toolbar=no, resizable=yes, scrollbars=yes')");
            ratio = maxWidth / width;
            $(this).css("width", maxWidth);
            $(this).css("height", height * ratio);
            height = height * ratio;
            width = width * ratio;
        }
    });
}
