function $(str) { return document.getElementById(str); } function $$(str) { return document.getElementsByName(str); } function getStyle(tag, attr, isInteger) { var ret = ""; if (tag.currentStyle) { attr = attr.replace(/\-[a-z]/g, function () { return arguments[0].substr(1, 1).toUpperCase(); }); ret = tag.currentStyle[attr]; } else { ret = document.defaultView.getComputedStyle(tag, "").getPropertyValue(attr); } if (isInteger === true) { ret = ret.replace(/[^0-9]+/, ""); ret = Number(ret); } return ret; } function getBounds(tag) { var ret = {}; if (tag.getBoundingClientRect) { var rect = tag.getBoundingClientRect(); ret.left = rect.left + (document.documentElement.scrollLeft || document.body.scrollLeft); ret.top = rect.top + (document.documentElement.scrollTop || document.body.scrollTop); ret.width = rect.right - rect.left; ret.height = rect.bottom - rect.top; } else if (document.getBoxObjectFor) { var box = document.getBoxObjectFor(tag); ret.left = box.x; ret.top = box.y; ret.width = box.width; ret.height = box.height; } else { ret.left = tag.clientLeft; ret.top = tag.clientTop; var parents = tag; while (parents.parentNode.nodeName != "HTML") { ret.left += parents.offsetLeft; ret.top += parents.offsetTop; parents = parents.offsetParent; } ret.width = tag.offsetWidth; ret.height = tag.offsetHeight; } if (/MSIE (6|7)\.0/.test(navigator.userAgent) == true) { ret.left -= 2; ret.top -= 2; } return ret; } function getFixPng(blankimage, elements) { if (!/MSIE 6\.0/.test(navigator.userAgent)) { return; } if (!elements || elements.constructor !== Array) { elements = ["IMG"]; } for (var i = 0; i < elements.length; i++) { var element = document.getElementsByTagName(elements[i]); for (var j = 0; j < element.length; j++) { var obj = element[j]; if (obj.nodeName == "IMG" && !/\.png$/i.test(obj.src)) { continue; } else if (obj.nodeName != "IMG" && !/\.png"?\)$/i.test(obj.currentStyle.backgroundImage)) { continue; } //alert(obj.nodeName); //if (!/\.png$/i.test(obj.src)) { continue; } if (obj.style.filter != "") { continue; } var Src, Width, Height; Src = (obj.src || obj.currentStyle.backgroundImage.replace(/^url\(/,"").replace(/\)$/, "").replace(/"/g, "")); Width = obj.width; Height = obj.height; obj.src = blankimage; obj.width = Width; obj.height = Height; obj.style.backgroundImage = "url(" + blankimage + ")"; obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + Src + "', sizingMethod='scale')"; //obj.style.setAttribute("filter", "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + Src + "', sizingMethod='scale')"); } } } var tjoeun = { me: "", sd: "", subDomain: function () { var arr = location.hostname.split("."); if (arr.length < 4) { return "kn"; } return arr[0]; }, imageOnOff: function (args) { var btns = args.btns; var classnm = args.classnm; var ext = args.ext; for (var i = 0, i_len = btns.length; i < i_len; i++) { if (!(new RegExp(classnm)).test(btns[i].className)) { continue; } for (var j = 0, j_len = args.events.length; j < j_len; j++) { btns[i][args.events[j]] = function () { for (var k = 0, k_len = btns.length; k< k_len; k++) { if (btns[k] == this) { btns[k].src = btns[k].src.replace((new RegExp("off\." + ext + "$")), "on." + ext); if (args.on.w !== null) { btns[k].width = args.on.w; } if (args.on.h !== null) { btns[k].height = args.on.h; } if (typeof args.actions == "function") { args.actions(k); } } else { btns[k].src = btns[k].src.replace((new RegExp("on\." + ext + "$")), "off." + ext); if (args.on.w !== null) { btns[k].width = args.on.w; } if (args.off.h !== null) { btns[k].height = args.off.h; } } } } } } }, init: function () { var that = this; if ($("flashbg_line_right") !== null) { $("flashbg_line_right").style.display = "block"; //$("flashbg_line_right").attr('style','display: block'); } //for left flash nav if ($("foot_link_container") !== null) { $("foot_link_container").style.display = "block"; //$("foot_link_container").attr('style','display: block'); if ($("footer") !== null) { var footer_Bounds = getBounds($("footer")); $("foot_link_container").style.top = footer_Bounds.top + "px"; $("footer").style.marginTop = ($("foot_link_container").offsetHeight + getStyle($("footer"), "margin-top", true) * 2) + "px"; } } //for left flash nav if ($("footer") && $("footer_line_both") !== null) { $("footer_line_both").style.display = "block"; //$("footer_line_both").attr('style','display: block'); $("footer_line_both").style.top = getBounds($("footer")).top + "px"; } ///Äü°íÁ¤ ¿¡·¯/////////////////////////////////////////////////////////////////////////////////////////////////// 2009-01-11 by Han, su-jin ///// // if ($("quick_top") !== null) { // var quick_top_y = getStyle($("quick_top"), "top", true); // new Floating($("quick_top"), false, true, 0, quick_top_y, 20, 10); // } // if (this.me == "/campus/campus_main.asp" && $("quick_top") !== null && $("quick_top2") !== null) { // $("quick_top2").style.position = "relative"; // $("quick_top2").style.left = (0 - $("quick_top2").offsetWidth - 30) + "px"; // if (/MSIE 8\.0/.test(navigator.userAgent)) { // var gB_panel_repos = function () { // var gB_panel = getBounds($("container").getElementsByTagName("DIV")[0]); // $("quick_top").style.marginLeft = 0; // $("quick_top").style.left = (gB_panel.left + gB_panel.width - 20) + "px"; // } // gB_panel_repos(); // window.onresize = function () { gB_panel_repos(); } // } // } if ($("09_campus_quick_icon") !== null) { var quick = 0; for (var i = 0, i_len = document.images.length; i < i_len; i++) { if (document.images[i].className == "09_campus_quick") { quick++; var i_new = i; (function () { var i_quick = quick; document.images[i_new].onmouseover = function () { $("09_campus_quick_icon").src = $("09_campus_quick_icon").src.replace(/_\d+\.gif$/, "_" + i_quick + ".gif"); this.src = this.src.replace(/_textoff_/, "_texton_"); } document.images[i_new].onmouseout = function () { this.src = this.src.replace(/_texton_/, "_textoff_"); } })(); } } } //login id,password bg effect if ($("userid") !== null) { var bg_id = getStyle($("userid"), "background-image"); $("userid").onfocus = function () { this.style.backgroundImage = "url()"; } $("userid").onblur = function () { if (!this.value) { this.style.backgroundImage = bg_id; } } } if ($("userpw") !== null) { var bg_pw = getStyle($("userpw"), "background-image"); $("userpw").onfocus = function () { this.style.backgroundImage = "url()"; } $("userpw").onblur = function () { if (!this.value) { this.style.backgroundImage = bg_pw; } } } //login id,password bg effect //campus main tab if ($("campus_main_tabs_t") !== null) { tjoeun.imageOnOff({ btns: $("campus_main_tabs_t").getElementsByTagName("IMG"), classnm: "btn", ext: "gif", on: {w: null, h: 41}, off: {w: null, h: 29}, events: ["onmouseover"], actions: function (n) { if ($("campus_main_tabs_c_1") === null || $("campus_main_tabs_c_2") === null || $("campus_main_tabs_c_3") === null) { return; } var childs = [$("campus_main_tabs_c_1"), $("campus_main_tabs_c_2"), $("campus_main_tabs_c_3")]; for (var i = 0, i_len = childs.length; i < i_len; i++) { if (i == n) { childs[i].style.display = "block"; } else { childs[i].style.display = "none"; } } } }); } if ($("campus_main_tabs_c") !== null) { if ($("campus_main_tabs_c_1") !== null) { tjoeun.imageOnOff({ btns: $("campus_main_tabs_c_1").getElementsByTagName("IMG"), classnm: "btn", ext: "gif", on: {w: null, h: null}, off: {w: null, h: null}, events: ["onmouseover"], actions: function (n) { $("tabbtn_img_1").src = $("tabbtn_img_1").src.replace(/\d+\.jpg$/, n + ".jpg"); $("tabbtn_img_1").useMap = $("tabbtn_img_1").useMap.replace(/_1\d+$/, "_1" + n); } }); } if ($("campus_main_tabs_c_2") !== null) { tjoeun.imageOnOff({ btns: $("campus_main_tabs_c_2").getElementsByTagName("IMG"), classnm: "btn", ext: "gif", on: {w: null, h: null}, off: {w: null, h: null}, events: ["onmouseover"], actions: function (n) { //$("tabbtn_img_2").src = $("tabbtn_img_2").src.replace(/\d+(_..)\.jpg$/, n + "$1.jpg"); var n_temp = n + 1; if (n_temp == 7) { $("tabbtn_img_2").src = $("tabbtn_img_2").src.replace(/_\d_\d\.jpg$/, "_3_6_kn.jpg"); } else { $("tabbtn_img_2").src = $("tabbtn_img_2").src.replace(/_\d_\d+(_..)?\.jpg$/, "_1_" + (n + 1) + ".jpg"); } $("tabbtn_img_2").useMap = $("tabbtn_img_2").useMap.replace(/_2\d+$/, "_2" + n); } }); } if ($("campus_main_tabs_c_3") !== null) { tjoeun.imageOnOff({ btns: $("campus_main_tabs_c_3").getElementsByTagName("IMG"), classnm: "btn", ext: "gif", on: {w: null, h: null}, off: {w: null, h: null}, events: ["onmouseover"], actions: function (n) { $("tabbtn_img_3").src = $("tabbtn_img_3").src.replace(/\d+(_..)\.jpg$/, n + "$1.jpg"); $("tabbtn_img_3").useMap = $("tabbtn_img_3").useMap.replace(/_3\d+$/, "_3" + n); } }); } } //campus main tab } }; window.onload = function () { try { document.execCommand("BackgroundImageCache", false, true); } catch (e) {} tjoeun.init(); getFixPng("../images/blank.gif", ["IMG", "DIV"]); }