$(function(){ contentImgResize(700); }); function addFavorites() { var title = document.title; var url = document.location.href; if(window.sidebar){ /* Mozilla Firefox Bookmark */ // window.sidebar.addPanel(title, url, ""); alert("Ctrl + D¸¦ ´©¸£½Ã¸é Áñ°Üã±â¿¡ Ãß°¡ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù"); return; }else if(window.external){ /* IE Favorite */ window.external.AddFavorite(url, title); }else if(window.opera && window.print) { /* Opera Hotlist */ alert("Ctrl + D¸¦ ´©¸£½Ã¸é Áñ°Üã±â¿¡ Ãß°¡ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù"); return; }else{ /* Other */ alert("Ctrl + D¸¦ ´©¸£½Ã¸é Áñ°Üã±â¿¡ Ãß°¡ÇÏ½Ç ¼ö ÀÖ½À´Ï´Ù"); return; } } function contentImgResize(w){ w = w || 800; $(".contents").find("img").each(function(){ if ($(this).attr('data-resize') == 'T') { //$(this).css("width", w); $(this).css("cursor", "pointer"); $(this).click(function(){ var oImg = new Image(); oImg.src = $(this).attr("src"); var wid=oImg.width; var hei=oImg.height; var scrollbars; if (screen.width < wid){ scrollbars = "yes"; } else{ scrollbars = "no"; } var winPop = window.open("","imgPop","scrollbars="+scrollbars+",width="+wid+", height="+hei+""); winPop.document.write(""); winPop.document.write("
"); winPop.document.write(""); }); } }); } // Trim ÇÔ¼ö ################################################## // Ex) str = " Å× ½ºÆ® ".trim(); => str = "Å× ½ºÆ®"; String.prototype.trim = function() { return this.replace(/(^\s*)|(\s*$)/g, ""); } // ¹®ÀÚ¿­ °ø¹éÁ¦°Å ÇÔ¼ö ################################################## // Ex) str = " Å× ½º Æ® ".stripspace(); => str = "Å×½ºÆ®"; String.prototype.stripspace = function() { return this.replace(/ /g, ""); } // Àüü ¹®ÀÚ¿­ ¹Ù²Ù±â ÇÔ¼ö ################################################## // Ex) str = "aÅ×½ºÆ®bcdÅ×½ºÆ®efg".replaceAll("Å×½ºÆ®", ""); => str = "abcdefg"; String.prototype.replaceAll = function(a, b) { var s = this; var n1, n2, s1, s2; while (true) { if ( s=="" || a=="" ) break; n1 = s.indexOf(a); if ( n1 < 0 ) break; n2 = n1 + a.length; if ( n1==0 ) { s1 = b; } else { s1 = s.substring(0, n1) + b; } if ( n2 >= s.length ) { s2 = ""; } else { s2 = s.substring(n2, s.length); } s = s1 + s2; } return s; }