function view(what) { 
var imgwin = window.open("",'WIN','scrollbars=no,status=no,toolbar=no,resizable=1,location=no,menu=no,width=10,height=10'); 
imgwin.focus(); 
imgwin.document.open(); 
imgwin.document.write("<html>\n"); 
imgwin.document.write("<head>\n"); 
imgwin.document.write("<title>**</title>\n"); 

imgwin.document.write("<sc"+"ript>\n"); 
imgwin.document.write("function resize() {\n"); 
imgwin.document.write("pic = document.il;\n"); 
//imgwin.document.write("alert(eval(pic).height);\n"); 
imgwin.document.write("if (eval(pic).height) { var name = navigator.appName\n"); 
imgwin.document.write("  if (name == 'Microsoft Internet Explorer') { myHeight = eval(pic).height + 40; myWidth = eval(pic).width + 12;\n"); 
imgwin.document.write("  } else { myHeight = eval(pic).height + 9; myWidth = eval(pic).width; }\n"); 
imgwin.document.write("  clearTimeout();\n"); 
imgwin.document.write("  var height = screen.height;\n"); 
imgwin.document.write("  var width = screen.width;\n"); 
imgwin.document.write("  var leftpos = width / 2 - myWidth / 2;\n"); 
imgwin.document.write("  var toppos = height / 2 - myHeight / 2; \n"); 
imgwin.document.write("  self.moveTo(leftpos, toppos);\n"); 
imgwin.document.write("  self.resizeTo(myWidth, myHeight);\n"); 
imgwin.document.write("}else setTimeOut(resize(), 100);}\n"); 
imgwin.document.write("</sc"+"ript>\n"); 

imgwin.document.write("</head>\n"); 
imgwin.document.write('<body topmargin="0" leftmargin="0" marginheight="0" marginwidth="0" bgcolor="#FFFFFF">\n'); 

imgwin.document.write("<img border=0 src="+what+" xwidth=100 xheight=9 name=il onload='resize();'>\n"); 
imgwin.document.write("</body>\n"); 
imgwin.document.close(); 

} 

function chImg(img) {
	imgName = img.src;
	if( imgName.indexOf("on.") > -1 ) {
		var re = /on\./g;
		img.src = imgName.replace(re,"off.");
	} else {
		var re = /off\./g;
		img.src = imgName.replace(re,"on.");
	}
}

/**
 * 주민번호 체크
 */

function checkReliabilityOfJuminNumber(str1, str2) {

	var aObjMultiliers1= new Array(2, 3, 4, 5, 6, 7);
	var aObjMultiliers2= new Array(8, 9, 2, 3, 4, 5);
	var sum=0, sum1=0, sum2=0;
	var sLength1, sLength2;

	sLength1=str1.length;
	sLength2=str2.length;

	if(sLength1<6 || sLength2<7) return 0;

	for(i=0 ; i<6; i++) {
		sum1+=parseInt(str1.charAt(i), 10)*aObjMultiliers1[i];
		sum2+=parseInt(str2.charAt(i), 10)*aObjMultiliers2[i];
	}
	sum=sum1+sum2;
	var checker=(11-(sum%11))%10;

	if(checker==parseInt(str2.charAt(6), 10)) return 1;
	else return 0;
}



function MM_showHideLayers() { //v9.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) 
  with (document) if (getElementById && ((obj=getElementById(args[i]))!=null)) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}
/**
 * form.field를 매개변수로 하여 
 * 해당하는 필드에 체크된 radio버튼 혹은 checkbox가 있다면 true를
 * 없다면 false를 반환한다.
 * @param {Object} field_obj
 */
function hasChecked(field_obj) {
    if (field_obj.length > 1) {
        for (var idx = 0; idx < field_obj.length; idx++) {
            if (field_obj[idx].checked) return true;
        }
    } else {
        if (field_obj.checked) return true;
    }
    return false;
}
function hasCheckedValue(field_obj) {
    if (field_obj.length > 1) {
        for (var idx = 0; idx < field_obj.length; idx++) {
            if (field_obj[idx].checked) return field_obj[idx].value;
        }
    } else {
        if (field_obj.checked) return field_obj[idx].value;
    }
    return field_obj[idx].value;
}
function openWindow(url, name, width, height)   {
    var top  = screen.height / 2 - height / 2 - 50;
    var left = screen.width / 2 - width / 2 ;
    var win =
        open(url,
            name,
            'width=' + width + ', height=' + height + ', top=' + top +
            ', left=' + left + ', resizable=no, status=yes, toolbar=no, menubar=no, scrollbars=auto');
    win.focus();
    return win;
}

/**
 * top display
 */

function displaySubMenu(id_name,targer_menu_seq,total) {	
    var target_menu = id_name+targer_menu_seq;
    for(i=1 ; i<=total ; i++) {
		if (document.getElementById(id_name + i)) {
			document.getElementById(id_name + i).style.display = "none";
		}
    }
	if (document.getElementById(target_menu)) {
		document.getElementById(target_menu).style.display = "block";
	}
}

function change_subMenuImage(id_name,targer_menu_seq,total) {
    var target_menu = id_name+targer_menu_seq;
    for(i=1 ; i<=total ; i++) {
        var re = /on\./g;
        imgName = document.getElementById(id_name+i).src;
        document.getElementById(id_name+i).src = imgName.replace(re,"off.");
    }
    imgName = document.getElementById(target_menu).src;
    var re = /off\./g;
	document.getElementById(target_menu).src = imgName.replace(re,"on.");
}

function setCookie( name, value, expiredays )  {
	var todayDate = new Date(); 
	todayDate.setDate( todayDate.getDate() + expiredays ); 
	document.cookie = name + "=" + escape( value ) + "; path=/; expires=" + todayDate.toGMTString() + ";" 
}

function getCookie(name) {
	var Found = false 
	var start, end 
	var i = 0 
	while(i <= document.cookie.length) { 
		start = i 
		end = start + name.length 
		if(document.cookie.substring(start, end) == name) { 
			Found = true 
			break 
		} 
		i++ 
	} 

	if(Found == true) { 
		start = end + 1 
		end = document.cookie.indexOf(";", start) 
			
		if(end < start) 
			end = document.cookie.length 
		
		return document.cookie.substring(start, end) 
	} 

	return 0;

}

function deleteCookie (strName){

    var objExpireDate = new Date();

    objExpireDate.setDate(objExpireDate.getDate() - 1);
	
    document.cookie = strName + "=;expires=" + objExpireDate.toGMTString();

}

var font_size = 100;

function jsZoom(param)
{
    
    if(document.getElementById('content_area').style.fontSize==null||document.getElementById('content_area').style.fontSize=="") font_size = 100;

    if(param=="in")
        font_size = font_size + 20;
    else
        font_size = font_size - 20;

    if (font_size > 200) {
		alert("최대크기입니다.");
		font_size = 200;
	}      

    if(font_size < 60){
		alert("최소크기입니다.");
		font_size = 60;
	} 
     
    document.getElementById('content_area').style.fontSize = font_size +"%";
	
   
}

/* popup open */
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}
 

/********* 플래시 *********/
function showFlash(flaFile, widths, heights, btrans) { 

  var strings = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=5,0,0,0" width="' + widths + '"  height="' + heights + '"><param name="movie" value="' + flaFile + '"> <param name="quality" value="high"> '; 

  if (btrans == 'y') { 
    strings += '<param name="wmode" value="transparent">'; 
  } 

  strings += '<embed src="' + flaFile + '" quality="high" pluginspage="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="' + widths + '" height="' + heights + '"> </embed> </object>'; 

  document.write(strings); 

  return; 
} 
/********* 플래시 *********/

<!-- 롤오버
function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}
//-->

//원도우닫기
function winClose() {
window.close()
} 


// 새창열기
function winOpenid() {
window.open("../../html/member/popup/id_check.jsp","newWin","width=410,height=251,toolbar=no")
} 

function winOpenadd() {
window.open("../../html/member/popup/zipsearch.jsp","newWin","width=410,height=336,toolbar=no")
}

function winOpenreport01() {
window.open("../../html/report/report_popupview.jsp","newWin","width=786,height=650,toolbar=no, scrollbars=yes")
}


/********* 전체보기메뉴 *********/
function openmenuview() 
{ 
    menu_view.style.visibility="visible";
	}
	
function closemenuview() 
{ 
    menu_view.style.visibility="hidden";
	}
/********* //전체보기메뉴 *********/

/********* 스크롤 따라다니는 레이어 *********/
var ns = (navigator.appName.indexOf("Netscape") != -1);
var d = document;
function JSFX_FloatDiv(id, sx, sy)
{
	var el=d.getElementById?d.getElementById(id):d.all?d.all[id]:d.layers[id];
	var px = document.layers ? "" : "px";
	window[id + "_obj"] = el;
	if(d.layers)el.style=el;
	el.cx = el.sx = sx;el.cy = el.sy = sy;
	el.sP=function(x,y){this.style.left=x+px;this.style.top=y+px;};

	el.floatIt=function()
	{
		var pX, pY;
		pX = (this.sx >= 0) ? 0 : ns ? innerWidth : 
		document.documentElement && document.documentElement.clientWidth ? 
		document.documentElement.clientWidth : document.body.clientWidth;
		pY = ns ? pageYOffset : document.documentElement && document.documentElement.scrollTop ? 
		document.documentElement.scrollTop : document.body.scrollTop;
		if(this.sy<0) 
		pY += ns ? innerHeight : document.documentElement && document.documentElement.clientHeight ? 
		document.documentElement.clientHeight : document.body.clientHeight;
		this.cx += (pX + this.sx - this.cx)/8;this.cy += (pY + this.sy - this.cy)/8;
		this.sP(this.cx, this.cy);
		setTimeout(this.id + "_obj.floatIt()", 30);
	}
	return el;
}
//사용법: 움직일 객체 다음에 아래코드 삽입
//JSFX_FloatDiv("wing", 880,143).floatIt();



/********* 상단메뉴 *********/
//왜 극지인가?
function menu01_0101(){window.open("/www/whypolar/climaticchange/climaticchange.cms","_self")} //기후변화의 열쇠
function menu01_0201(){window.open("/www/whypolar/universewindow/universewindow.cms","_self")} //우주로 열린 지구의 창
function menu01_0301(){window.open("/www/whypolar/earthehistory/earthehistory.cms","_self")} //지구역사 기록 보관소
function menu01_0401(){window.open("/www/whypolar/survivaldrama/survivaldrama.cms","_self")} //생존드라마의 무대
function menu01_0501(){window.open("/www/whypolar/tresureresouce/tresureresouce.cms","_self")} //미래자원의 보고
function menu01_0601(){window.open("/www/whypolar/researchhistory/researchhistory.cms","_self")} //우리나라 극지연구의 역사


//극지의 자연환경
function menu02_0101(){window.open("/www/environment/antarctic/antarctic.cms","_self")} //남극
function menu02_0201(){window.open("/www/environment/arctic/arctic.cms","_self")} //북극


//연구활동 및 성과
function menu03_0101(){window.open("/www/research/prior_overview/prior_overview.cms","_self")} //중점연구분야
function menu03_0201(){window.open("/www/research/yearResearchTasks/report/reportList.do","_self")} //연도별 연구과제
function menu03_0301(){window.open("/www/research/science/science.cms","_self")} //극지 기초 과학지원 연구사업


//KOPRI 마당
function menu04_0101(){window.open("/www/koprizone/notice/userBbs/bbsList.do?bbs_cd_n=13","_self")} //공지사항
function menu04_0201(){window.open("/www/koprizone/tender/userBbs/bbsList.do?bbs_cd_n=14","_self")} //입찰공고
function menu04_0301(){window.open("/www/koprizone/news/userBbs/bbsList.do?bbs_cd_n=15","_self")} //언론보도자료
function menu04_0401(){window.open("/www/koprizone/publicReport/userBbs/bbsList.do?bbs_cd_n=16","_self")} //공무해외여행보고서
function menu04_0501(){window.open("/www/koprizone/freeboard/userBbs/bbsList.do?bbs_cd_n=17","_self")} //자유게시판
function menu04_0601(){window.open("/www/koprizone/qna/userBbs/bbsList.do?bbs_cd_n=18","_self")} //Q&A
function menu04_0701(){window.open("/www/koprizone/support/userBbs/bbsList.do?bbs_cd_n=35","_self")} //온라인 상담/신고


//정보센터
function menu05_0101(){window.open("/www/datacenter/multimedia/image/userBbs/bbsList.do?bbs_cd_n=19","_self")} //멀티미디어 자료실
function menu05_0201(){window.open("/www/datacenter/document/userBbs/bbsList.do?bbs_cd_n=21","_self")} //문헌자료실
function menu05_0301(){window.open("/www/datacenter/journal/userBbs/bbsList.do?bbs_cd_n=22","_self")} //전문학술지
function menu05_0401(){window.open("/www/datacenter/foreign.do","_self")} //관련단체 및 조직
function menu05_0501(){window.open("/www/datacenter/datasearch/search_report/search_report.cms","_self")} //자료검색
function menu05_0601(){window.open("/www/datacenter/kpdc/kpdc_about/kpdc_about.cms","_self")} //한국극지데이터센터


//연구소소개
function menu06_0101(){window.open("/www/about/kopri_greeting/kopri_greeting.cms","_self")} //소장 인사말
function menu06_0201(){window.open("/www/about/kopri_vision/kopri_vision.cms","_self")} //Vision & Mission
function menu06_0301(){window.open("/www/about/kopri_business/kopri_business_2007/kopri_business_2007.cms","_self")} //경영공시
function menu06_0401(){window.open("/www/about/kopri_history/kopri_history.cms","_self")} //연혁
function menu06_0501(){window.open("/www/about/kopri_ci/kopri_ci.cms","_self")} //CI
function menu06_0601(){window.open("/www/about/kopri_organization/kopri_organization.cms","_self")} //조직도
function menu06_0701(){window.open("/www/about/kopri_searchstaff/staff.do","_self")} //직원검색
function menu06_0801(){window.open("/www/about/kopri_location/kopri_location.cms","_self")} //오시는 길

/********* //상단메뉴 *********/

/********* ���θ޴��� �ϴܿ� ��µǴ� ���̾� �޴� *********/
function sOver(ImgName,Src_name) 
{ 
   { 
		eval(ImgName + '.filters.blendtrans.stop();'); 
		eval(ImgName + '.filters.blendtrans.Apply();'); 
		eval(ImgName + '.src="'+Src_name+'"'); 
		eval(ImgName + '.filters.blendtrans.Play();'); 
	} 
} 
function sOver2(ImgName,Src_name) 
{ 
	 { 
		eval(ImgName + '.filters.blendtrans.stop();'); 
		eval(ImgName + '.filters.blendtrans.Apply();'); 
		eval(ImgName + '.src="'+Src_name+'"'); 
		eval(ImgName + '.filters.blendtrans.Play();'); 
	} 
}

var isNav, isIE
var active = 0
var coll = ""
var styleObj = ""
var parent = ""
if (parseInt(navigator.appVersion) >= 4) {
	if (navigator.appName == "Netscape") {
		isNav = true
	} else {
		isIE = true
		coll = "all."
		styleObj = ".style"
	}
}
function getObject(obj,parent) {
	var theObj
	if (parent != "" && 0) {
		if (typeof obj == "string") {
			theObj = eval("document." + parent + ".document." + coll + obj + styleObj)
		} else {
			theObj = obj
		}
	}
	else {
		if (typeof obj == "string") {
			theObj = eval("document." + coll + obj + styleObj)
		} else {
			theObj = obj
		}
	}
	return theObj
}
function hidediv(obj,parent) {
    
	var theObj = getObject(obj,parent)
		theObj.visibility = "hidden"
		theObj.display = "none"
}

function showdiv(obj,parent) {
    
        var theObj = getObject(obj,parent)
		theObj.visibility = "visible"
		theObj.display = "block"
}
function show_00(){
   showdiv('menu01_bar0','menu01_bar');
   hidediv('menu01_bar1','menu01_bar');

}
function show_01(){
   hidediv('menu01_bar0','menu01_bar');
   showdiv('menu01_bar1','menu01_bar');   
   
   
}
function show_02(){
   showdiv('menub_bar0','menub_bar');
   hidediv('menub_bar1','menub_bar');

}
function show_03(){
   hidediv('menub_bar0','menub_bar');
   showdiv('menub_bar1','menub_bar');
   
   
}
function na_restore_img_src(name, nsdoc)
{
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img && img.altsrc) {
    img.src    = img.altsrc;
    img.altsrc = null;
  } 
}

function na_preload_img()
{ 
  var img_list = na_preload_img.arguments;
  if (document.preloadlist == null) 
    document.preloadlist = new Array();
  var top = document.preloadlist.length;
  for (var i=0; i < img_list.length; i++) {
    document.preloadlist[top+i]     = new Image;
    document.preloadlist[top+i].src = img_list[i+1];
  } 
}

function na_change_img_src(name, nsdoc, rpath, preload)
{ 
  var img = eval((navigator.appName.indexOf('Netscape', 0) != -1) ? nsdoc+'.'+name : 'document.all.'+name);
  if (name == '')
    return;
  if (img) {
    img.altsrc = img.src;
    img.src    = rpath;
  } 
}
function setClipBoard(target_url)
{
 window.clipboardData.setData('Text', "http://kopri.re.kr"+target_url);
 alert('복사되었습니다.');
}


/***********************************
/ 이미지 사이즈에 맞게 새창띄우기
/***********************************/
function OpenImage(s){
 //
 // 변수 정의
 //
 srcImg = new Image();
 clientWidth = screen.width;
 clientHeight = screen.height;
 srcImg.src = s.src;
 //
 // 열려는 파일을 이름
 //
 var srcFileName = srcImg.src.substr(srcImg.src.lastIndexOf("/")+1, srcImg.src.length);
 //
 // 새창 띄우고 이미지 삽입
 //
 win = window.open("","","width=15,height=15,scrollbars=no,resizable=no,left="+(clientWidth/2-15)+",top="+(clientHeight/2-15)+"");
 win.document.writeln("<html>");
 win.document.writeln("<head>");
 win.document.writeln("<title>"+document.title+" ["+srcFileName+"]</title>");
 win.document.writeln("</head>");
 win.document.writeln("<body style='margin:0px;' bgcolor='#333333'>");
 win.document.writeln("<table border='0' cellpadding='0' cellspacing='0' style='cursor:hand' onclick='self.close()'>");
 win.document.writeln(" <tr>");
 win.document.writeln("  <td align='center'><img src="+s.src+" name='winImg' style='cursor:hand' onclick='self.close()' alt='클릭하면 사라집니다'></td>");
 win.document.writeln(" </tr>");
 win.document.writeln("</table>");
 win.document.writeln("</body>");
 win.document.writeln("</html>");

 srcImg = win.document.winImg;
 //
 // 이미지가 모두 로딩될때까지 기다림
 //
 while(true)
 if(srcImg.readyState == "complete")
 break;
 
 //
 // 새창의 크기 설정
 //
 var winWidth = srcImg.width+10;
 var winHeight = srcImg.height+29;
 //
 // 새창이 띄워질 위치 설정
 //
 var left = (clientWidth/2)-(srcImg.width/2);
 var top = (clientHeight/2)-(srcImg.height/2);
 //
 // 이미지의 크기 overflow 확인후 새창의 크기와 위치 재설정
 //
 if(clientWidth <= srcImg.width){
  winWidth = clientWidth;
  left = 0;
  win.document.body.scroll = "auto";
 }
 if(clientHeight <= srcImg.height){
  winHeight = clientHeight-30;
  top = 0;
  win.document.body.scroll = "auto";
 }
 //
 // 이미지로딩이 끝났음으로 이미지의 크기를 사용할수 있다.
 // 해당 이미지의 사이즈에 맞게 윈도우를 재설정한다.
 win.moveTo(left, top);
 win.resizeTo(winWidth, winHeight);
}
//-->

/** 페이지 로딩 완료시 수행*/
function addLoadEvents( func )
{
  var oldonload = window.onload;
  if ( typeof window.onload != 'function' ){
    window.onload = func;
  } else {
    window.onload = function()
    {
      oldonload();
      func();
    }
  }
}


function linkParent(url){ 
	opener.location = url; 
	top.close(); 
	} 
