﻿
//document.domain = "uway.com";
document.domain = "knou.ac.kr";
document.title="Korea National Open University";	// 타이틀
document.write('<script type="text/javascript" src="/engknou2/js/menu.js"></script>');
document.write('<script type="text/javascript" src="/engknou2/js/ui.js"></script>');

var IE = (navigator.appName.indexOf("Microsoft")>-1);
var IE6 = (navigator.appName.indexOf("Microsoft")>-1)&&(navigator.userAgent.indexOf("MSIE 6")>-1);
var IE7 = (navigator.appName.indexOf("Microsoft")>-1)&&(navigator.userAgent.indexOf("MSIE 7")>-1);

var depth1="",depth2="",depth3="";	// 각 페이지에 맞게 탑메뉴,좌측메뉴가 자동으로 활성화되게 하기위한 메뉴의 depth 의 값저장
var topMenuCount = 4;	// 탑메뉴갯수 (대학소개, 대학/대학원, 입학안내, 대학생활) 총 4개
var global_topFocusId = "";	// 탑메뉴에서 현재 포커스가 된 객체 ID 임시저장변수
var global_leftFocusId = "";	// 좌측메뉴에서 현재 포커스가 된 객체 ID 임시저장변수
var tmpDepth1 = "";	// 좌측메뉴에서 현재페이지의 depth번호와 메뉴번호를 비고해서 포커스가 있다면 클래스명 끝에 _on 를 붙임

// 플리커현상((flicker prevent) 제거소스
try {
	document.execCommand('BackgroundImageCache', false, true);
} catch(e) {}

function mNavi(hNum,mNum,sNum) {
	if(hNum) {
		depth1 = hNum;
		tmpDepth1 = hNum.toString();
	}
	if(mNum) {
		depth2 = mNum;
		tmpDepth1 += "-" + mNum.toString();

	}
	if(sNum) {
		depth3 = sNum;
		tmpDepth1 += "-" + sNum.toString();
	}
}

/*상단비주얼*/

function visual(){
	if(depth1 != ""){
		document.write('<div id="visual">');
		flashWrite('/engknou2/comimg/visual'+depth1+'.swf',965,245,'','#ffffff','transparent')
		document.write('</div>');
		
	}
}
/*상단비주얼*/

// flashWrite(파일경로, 가로, 세로, 아이디, 배경색, 윈도우모드)
function flashWrite(url,w,h,id,bg,win){

	// 플래시 코드 정의
	var flashStr=
	"<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000' codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0' width='"+w+"' height='"+h+"' id='"+id+"' align='middle'>"+
	"<param name='movie' value='"+url+"' />"+
	"<param name='wmode' value='"+win+"' />"+
	"<param name='menu' value='false' />"+
	"<param name='quality' value='high' />"+
	"<param name='bgcolor' value='"+bg+"' />"+
	"<embed src='"+url+"' wmode='"+win+"' menu='false' quality='high' bgcolor='"+bg+"' width='"+w+"' height='"+h+"' name='"+id+"' align='middle' type='application/x-shockwave-flash' pluginspage='http://www.macromedia.com/go/getflashplayer' />"+
	"</object>";
	// 플래시 코드 출력
	document.write(flashStr);

}

/* 이미지 롤오버 */
function over(obj,type){
	if(type) obj.src = obj.src.replace(".gif","_.gif");
	else  obj.src = obj.src.replace("_.gif",".gif");
}

/* 이미지 롤오버 */

/* 내용바로가기 */
function contentAcessibility() {
	document.write('<div id="skipnavi"><a href="#contents">내용으로 바로가기</a></div>');
}


/* 좌측최상단에 방송통신대학 로고 */
function knouLogo() {
	document.write('<div id="toplogo"><a class="logolink" href="/engknou2/" title="Korea National Open University">Korea National Open University Logo</a></div>');
	                       
}


/* 좌측 상단 크게,작게 보기 */
function textZoomControl() {
	document.write('<div id="zoom_util">');
	document.write('<ul>');
	document.write('<li id="zoom_plus"><a title="zoom in" onkeypress="zoomUtil(\'plus\',event)" onclick="zoomUtil(\'plus\',event)" href="#">zoom in</a></li>');
	document.write('<li id="zoom_default"><a title="standard" onkeypress="zoomUtil(\'default\',event)" onclick="zoomUtil(\'default\',event)" href="#">standard</a></li>');
	document.write('<li id="zoom_minus"><a title="zoom out" onkeypress="zoomUtil(\'minus\',event)" onclick="zoomUtil(\'minus\',event)" href="#">zoom out</a></li>');
	document.write('</ul>');
	document.write('</div>');
}

/* 좌측 상단 버튼 무비,브로슈어 보기 */
function gobtnPr() {
		document.write('<div id="footer_link">');
document.write('<ul>');
document.write('<li><img src="/engknou2/comimg/footerbtn_2_1.gif" alt="brochure/breifing" width="239px" height="25px" border="0" usemap="#Map2">');
document.write('<map name="Map2" id="Map2">');
document.write('  <area shape="rect" coords="70,4,100,21" href="http://www.knou.ac.kr/engknou2/files/brochure.pdf"  target=_blank  title="go brochure" />');
document.write('  <area shape="rect" coords="194,4,222,21" href="http://www.knou.ac.kr/engknou2/files/breifing(eng).pdf" target=_blank title="go breifing" />');
document.write('</map></li>');
document.write('		<li><img src="/engknou2/comimg/footerbtn_1.gif" alt="movie" width="239" height="25" border="0" usemap="#Map">');
document.write('      	<map name="Map">');
document.write('       	<area shape="rect" coords="59,4,113,20" href="mms://st2.knou.ac.kr/ounvod/knou/방송대_2012_홍보_ENG.wmv" alt="english">');
document.write('       	 <area shape="rect" coords="117,4,171,20" href="mms://st2.knou.ac.kr/ounvod/S/knou/knou_chn.wmv" alt="chinese">');
document.write('      	  <area shape="rect" coords="175,4,229,20" href="mms://st2.knou.ac.kr/ounvod/S/knou/knou_jpn.wmv" alt="japanese">');
document.write('    	  </map>');
document.write('		</li>');
document.write('  </ul>');
document.write('		</div>');

}

/* 하단 카피라이트 */
function copyRightIncldue() {
	document.write('<div id="footer">');
	document.write('<div id="footerlogo">');
	document.write('<h4>하단로고 - 한국방송통신대학교</h4>');
	document.write('</div>');
	document.write('<div id="wrappe_copy">');
	document.write('<div id="copyright">');	
	document.write('<dl>');
	document.write('<dt class="copy">Copyright &copy; 2007 Korea national Open University. All rights reserved.</dt>');
	document.write('</dl>');
	document.write('</div>');
	document.write('</div>');
	document.write('</ul>');
	document.write('</div>');
	document.write('</div>');
}


// 아이프레임 리사이징 //
function adjustIFrameSize(id) {
	var myIframe = document.getElementById(id);

	if (myIframe) {
        if (myIframe.contentDocument && myIframe.contentDocument.body.offsetHeight) {
            // W3C DOM (and Mozilla) syntax
			if(window.opera) {			
				myIframe.height = myIframe.document.body.scrollHeight;    
			} else {
				myIframe.height = myIframe.contentDocument.body.offsetHeight;    
			}
        } else if (myIframe.Document && myIframe.Document.body.scrollHeight) {
            // IE DOM syntax
            myIframe.height = myIframe.Document.body.scrollHeight;
        }

		// bind onload events to iframe
        if (myIframe.addEventListener) {			
            myIframe.addEventListener("load", resizeIframe, false);
        } else {
            myIframe.attachEvent("onload", resizeIframe);
        }
   }
}

function resizeIframe(evt) {
    evt = (evt) ? evt : event;
    var target = (evt.target) ? evt.target : evt.srcElement;

    // take care of W3C event processing from iframe's root document

    if (target.nodeType == 9) {
      if (evt.currentTarget && evt.currentTarget.tagName.toLowerCase() == "iframe") {
            target = evt.currentTarget;    
        }
    }

    if (target) {
        adjustIFrameSize(target.id);
    }
}
