$(document).ready(function(){ //Áñ°Üã±â // add a "rel" attrib if Opera 7+ if(window.opera) { if ($("a.jqbookmark").attr("rel") != ""){ // don't overwrite the rel attrib if already set $("a.jqbookmark").attr("rel","sidebar"); } } $("a.jqbookmark").click(function(event){ event.preventDefault(); // prevent the anchor tag from sending the user off to the link var url = this.href; var title = this.title; if (window.sidebar) { // Mozilla Firefox Bookmark window.sidebar.addPanel(title, url,""); } else if( window.external ) { // IE Favorite window.external.AddFavorite( url, title); } else if(window.opera) { // Opera 7+ return false; // do nothing - the rel="sidebar" should do the trick } else { // for Safari, Konq etc - browsers who do not support bookmarking scripts (that i could find anyway) alert('Unfortunately, this browser does not support the requested action,' + ' please bookmark this page manually.'); } }); //³×ºñ°ÔÀÌ¼Ç GNB $('#gnb > li').bind("mouseenter",function(){ $(this).find('ul').show('_on.png'); var imgSrc = $(this).find('> a > img').attr('src'); $(this).find('> a > img').attr('src',imgSrc.replace('.png','_on.png')); }).bind("focusin",function(){ $(this).find('ul').show(); }).bind("mouseleave",function(){ $(this).find('ul').hide(); var imgSrc = $(this).find('> a > img').attr('src'); $(this).find('> a > img').attr('src',imgSrc.replace('_on.png','.png')); }).find('ul li:last').bind("focusout",function(){ $('#gnb > li ').hide(); }); //»ó´Ü Ä·ÆÛ½º ¹Ù·Î°¡±â $('ul.campusGo').animate({ opacity:0 }); $('#btnGoCampus').bind('click',function(){ if($(this).next('ul').css('top') == '-344px'){ $(this).addClass('onn').next('ul').animate({ top:40, opacity:1 }, 500); }else{ $(this).removeClass('onn').next('ul').animate({ top:-344, opacity:0 }, 500); } return false; }); $('#campus').bind('mouseleave',function(){ $(this).find('#btnGoCampus').removeClass('onn') $(this).find('ul:not(:animated)').animate({ top:-344, opacity:0 }, 500); }); //ÇÏ´Ü »çÀÌÆ®¸Ê $('#btnSite').bind('click',function(){ if($(this).next('ul').css('top') == '99px'){ $(this).next('ul').animate({ top:0 }, 300); var imgSrc = $(this).find('img').attr('src'); $(this).find('img').attr('src',imgSrc.replace('.png','_on.png')); }else{ $(this).next('ul').animate({ top:99 }, 300); var imgSrc = $(this).find('img').attr('src'); $(this).find('img').attr('src',imgSrc.replace('_on.png','.png')); } return false; }); $('#siteArea').bind('mouseleave',function(){ $(this).find('ul:not(:animated)').animate({ top:99 }, 300); var imgSrc = $(this).find('h3 img').attr('src'); $(this).find('h3 img').attr('src',imgSrc.replace('_on.png','.png')); }); //ÅǸ޴º $('#tab > div:gt(0)').hide(); $('#tab h3').click(function(){ $("#tab> div").hide(); $('#tab h3').removeClass('active'); $(this).next().show(); $(this).addClass('active').show(); return false; }); //ÀÎDz Æ÷Ä¿½º º¸´õ»ö»ó $("#lgoId, #lgoPw, #subId, #subPw, #key, #name, #phone, #phoneBox1, #phoneBox2, .borderOn, .textBox, #boardSearch, .division > select, .personalInfo input, .personalInfo select, .popContents input").focus(function(){ $(this).css("borderColor","#e01b00"); }).blur(function(){ $(this).css("borderColor",""); }); //·¹À̺í Àͽº Àû¿ë $("label.labelFor").click(function(e){//¶óº§ÀÌ Å¬·¡½º .labelForÀ϶§. e.preventDefault(); $("#"+$(this).attr("for")).click().change(); }); //¸¶¿ì½º¿À¹ö $('.imgOn, .on img').hover(function(){ var imgSrc = $(this).attr('src'); $(this).attr('src',imgSrc.replace('.png','_on.png')); },function(){ var imgSrc = $(this).attr('src'); $(this).attr('src',imgSrc.replace('_on.png','.png')); }); //»çÀÌÆ®¸Ê ·¹À̾î Æ˾÷ $('a[name=modal]').click(function(e){ //a Å×±× À̺¥Æ® ¹«È¿ e.preventDefault(); //µµÅ¥¸àÆ® À©µµ¿ì Å©±â ÁöÁ¤ var maskHeight = $(document).height(); var maskWidth = $(window).width(); $('#mask').css({'width':maskWidth,'height':maskHeight}); $('#mask').fadeTo(500,0.6); //Ŭ¸¯½Ã ¶ß´Â Æ˾÷ var id = $(this).attr('href'); $(id).fadeIn(500); }); //´Ý±â¹öÆ° (X¹öÆ°,´Ý±â¹öÆ°,½Î°íÀÖ´Â ¸¶½ºÅ©) $('.modal .close, #mask').click(function (e) { e.preventDefault(); $('#mask, .modal').fadeOut('nomal'); }); }); // ÆäÀÌÁöÀÎ½Ä function menuOver() { //alert(this.src); this.src = this.src.replace(".png", "_on.png"); } function menuOut() { this.src = this.src.replace("_on.png", ".png"); } function menuClick() { if(this.id.indexOf("menu-image") > -1) { var submenu = document.getElementById("menu" + this.id.substring(10)); var uls = submenu.getElementsByTagName("ul"); if(uls.length>0){ if(uls[0].style.display == "none") uls[0].style.display = "block"; else uls[0].style.display = "none"; } } } function menuOut() { this.src = this.src.replace("_on.png", ".png"); } function initImgEffect(ImgEls,SelImg) { MenuImg = document.getElementById(ImgEls).getElementsByTagName("img"); MenuImgLen = MenuImg.length; for (i=0; i 0 ) { im.item(0).src = im.item(0).src.replace(".png", "_on.png"); } else { var anc = menuEl.item(i).getElementsByTagName("a"); if(anc && anc.length > 0) { anc.item(0).className = "on"; if(menuEl.item(i).id == selectDepth3) { anc.item(0).className += " leaf"; } } } } else { var im = menuEl.item(i).getElementsByTagName("img"); if( im == null || im.length == 0) continue; im.item(0).onmouseover = menuOver; im.item(0).onmouseout = menuOut; im.item(0).onfocus = menuOver; im.item(0).onblur = menuOut; if (menuEl.item(i).getElementsByTagName("ul").item(0)) { menuEl.item(i).getElementsByTagName("ul").item(0).style.display = "none"; } } } menuId = "menu" + depth1; initTopmenuByMenuId(depth1,depth2,depth3,depth4,menuId); } function initTopMenu(el,depth1) { topMenuOut(el.getElementsByTagName("img").item(0)); if(el.id == "top-menu" + depth1) { topMenuOver(el.getElementsByTagName("img").item(0)); } } function topMenuOver(img) { img.src = img.src.replace(".png", "_on.png"); } function topMenuOut(img) { img.src = img.src.replace("_on.png", ".png"); } function selectTopmenuByMenuId() { var depth1 = this.id.substring("top-menu-head".length,this.id.length); var menuId = "sub-menu" + depth1; var selectDepth1 = "top-" + depth1 + "-1"; var topnav = document.getElementById("lnb"); if(!topnav) return; var topEl = topnav.getElementsByTagName("ul"); for(i = 0 ; i < topEl.length ; i++){ if(topEl[i].id.substring(0,12) == "top-sub-menu") { topEl[i].style.display = "none"; } } var topEl2 = topnav.getElementsByTagName("li"); for(i = 0 , seq = 1; i < topEl2.length ; i++){ if(topEl2[i].id.substring(0,8) == "top-menu") { initTopMenu(topEl2[i],depth1); } } var nav = document.getElementById("top-" + menuId); if(!nav) return; nav.style.display = "block"; menuEl = nav.getElementsByTagName("li"); for(i = 0; i < menuEl.length; i++) { var imgEl = menuEl.item(i).getElementsByTagName("img") if(imgEl != null && imgEl.length>0) { imgEl.item(0).onmouseover = menuOver; imgEl.item(0).onmouseout = menuOut; imgEl.item(0).onfocus = menuOver; imgEl.item(0).onblur = menuOut; } } } function initTopmenuByMenuId(depth1, depth2, depth3, depth4, menuId) { var selectDepth1 = "top-" + depth1 + "-" + depth2; var selectDepth2 = "top-" + depth1 + "-" + depth2 + "-" + depth3; var selectDepth3 = "top-" + depth1 + "-" + depth2 + "-" + depth3 + "-" + depth4; var topnav = document.getElementById("lnb"); if(!topnav) return; var topEl = topnav.getElementsByTagName("ul"); for(var i = 0 ; i < topEl.length ; i++){ if(topEl[i].id.substring(0,12) == "top-sub-menu") { topEl[i].style.display = "none"; } } var topEl3 = topnav.getElementsByTagName("li"); for(i = 0 , seq = 1; i < topEl3.length ; i++){ if(topEl3[i].id.substring(0,8) == "position") { if(depth1 == seq) topEl3[i].style.display = "block"; else topEl3[i].style.display = "none"; seq++; } } var topEl2 = topnav.getElementsByTagName("a"); for(i = 0, seq = 0 ; i < topEl2.length ; i++){ if(topEl2[i].id.substring(0,13) == "top-menu-head") { topEl2[i].onmouseover = selectTopmenuByMenuId; topEl2[i].onfocus = selectTopmenuByMenuId; if ( topEl2[i].id.substring(13) == depth1) { topEl2[i].onmouseover(); } seq++; } } var nav = document.getElementById("top-" + menuId); if(!nav) return; nav.style.display = "block"; menuEl = nav.getElementsByTagName("li"); for(i = 0; i < menuEl.length; i++) { var menuElItm = menuEl.item(i); var imgEl = menuElItm.getElementsByTagName("img"); if(imgEl == null || imgEl.length == 0) { var aEl = menuElItm.getElementsByTagName("a"); var itm = aEl.item(0); if (menuElItm.id == selectDepth1 || menuElItm.id == selectDepth2 || menuElItm.id == selectDepth3 ) { itm.className = "on"; itm.onmouseover = null; itm.onmouseout = null; itm.onfocus = null; itm.onblur = null; } else { itm.onmouseover = menuOver; itm.onmouseout = menuOut; itm.onfocus = menuOver; itm.onblur = menuOut; } } else { var itm = imgEl.item(0); if (menuElItm.id == selectDepth1 || menuElItm.id == selectDepth2 || menuElItm.id == selectDepth3 ) { itm.src = itm.src.replace(".png", "_on.png"); itm.onmouseover = null; itm.onmouseout = null; itm.onfocus = null; itm.onblur = null; } else { itm.onmouseover = menuOver; itm.onmouseout = menuOut; itm.onfocus = menuOver; itm.onblur = menuOut; } } } }