function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

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_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_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];}
}
 var nowZoom = 100; 
 var maxZoom = 200; 
 var minZoom = 80; 


 function zoomIn() {
  if (nowZoom < maxZoom) {
   nowZoom += 10; 
  } else {
   return;
  }

document.getElementById("sub_body").style.zoom = nowZoom + "%";

 }

 function zoomOut() {
  if (nowZoom > minZoom) {
   nowZoom -= 10; 
  } else {
   return;
  }

document.getElementById("sub_body").style.zoom = nowZoom + "%";
 }

function Action_site1() {
document.getElementById('notice').style.display = '';
document.getElementById('news').style.display = 'none';
}
function Action_site2() {
document.getElementById('notice').style.display = 'none';
document.getElementById('news').style.display = '';
}

function search1() {
document.getElementById('search_01').style.display = '';
document.getElementById('search_02').style.display = 'none';
document.getElementById('search_03').style.display = 'none';
}
function search2() {
document.getElementById('search_01').style.display = 'none';
document.getElementById('search_02').style.display = '';
document.getElementById('search_03').style.display = 'none';
}
function search3() {
document.getElementById('search_01').style.display = 'none';
document.getElementById('search_02').style.display = 'none';
document.getElementById('search_03').style.display = '';
}











var slideShowSpeed = 3000;
var crossFadeDuration = 3;
var Pic = new Array();
var PicLink = new Array();





Pic[0]		= "../images/main/popup.gif";
PicLink[0]	= "http://www.cncae.go.kr/popup/100405_02.html";

Pic[1]		= "../images/main/popup.gif";
PicLink[1]	= "http://www.cncae.go.kr/popup/100405.html";

Pic[2]		= "../images/main/popup.gif";
PicLink[2]	= "http://www.cncae.go.kr/popup/100331.html";

Pic[3]		= "../images/main/popup.gif";
PicLink[3]	= "http://www.cncae.go.kr/popup/100326.html";

Pic[4]		= "../images/main/popup.gif";
PicLink[4]	= "http://www.cncae.go.kr/popup/100312.html";

Pic[5]		= "../images/main/popup.gif";
PicLink[5]	= "http://www.cncae.go.kr/popup/100309.html";

Pic[6]		= "../images/main/popup.gif";
PicLink[6]	= "http://www.cncae.go.kr/popup/100305.html";


Pic[7]		= "../images/main/popup.gif";
PicLink[7]	= "http://www.cncae.go.kr/popup/100224.html";

Pic[8]		= "../images/main/popup.gif";
PicLink[8]	= "http://www.cncae.go.kr/popup/100303_02.html";

Pic[9]		= "../images/main/popup.gif";
PicLink[9]	= "http://www.cncae.go.kr/popup/100205.html";

var t;
var j = 0;
var p = Pic.length;

var preLoad = new Array();
var preLoadLink = new Array();

for (i = 0; i < p; i++){
   preLoad[i] = new Image();
   preLoad[i].src = Pic[i];
   preLoadLink[i] = PicLink[i];
}

function runSlideShow(a){


	document.getElementById('SlideShow').src = preLoad[j].src;
	if(j == -0){ 
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=400, height=336\"))";
		document.getElementById('SlideLink').target = "";
	}
	
	else if(j == 1){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=450, height=327\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 2){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=548, height=325\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 3){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=500, height=348\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 4){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=400, height=547\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 5){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=285, height=415\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j ==6){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=341, height=473\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 7){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=403, height=237\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 8){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=400, height=529\"))";
		document.getElementById('SlideLink').target = "";
	}

	else if(j == 9){
		document.getElementById('SlideLink').href = "javascript:void(window.open('" + preLoadLink[j] + "', \"popJN\", \"scrollbars=no, width=456, height=275\"))";
		document.getElementById('SlideLink').target = "";
	}

	document.getElementById('AlimiNum01').src = "../images/main/popup_01.gif";
	document.getElementById('AlimiNum02').src = "../images/main/popup_02.gif";
	document.getElementById('AlimiNum03').src = "../images/main/popup_03.gif";
	document.getElementById('AlimiNum04').src = "../images/main/popup_04.gif";
	document.getElementById('AlimiNum05').src = "../images/main/popup_05.gif";
	document.getElementById('AlimiNum06').src = "../images/main/popup_06.gif";
	document.getElementById('AlimiNum07').src = "../images/main/popup_07.gif";
	document.getElementById('AlimiNum08').src = "../images/main/popup_08.gif";
	document.getElementById('AlimiNum09').src = "../images/main/popup_09.gif";
	document.getElementById('AlimiNum010').src = "../images/main/popup_10.gif";
	
	document.getElementById('AlimiNum0' + (j+1)).src =  '../images/main/popup_0' + (j+1) + '_on'+'.gif';

   if (document.all){
		//document.getElementById('SlideShow').filters.blendTrans.Play();
   }
   
   if(a == 1) j = j+1;
   if (j > (p-1)) j = 0;
   t = setTimeout('runSlideShow(1)', slideShowSpeed);
}


function OnPULink(){
	val = j;
	if(val == 0){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=400, height=336");
	}else if(val == 1){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=450, height=327");
	}
else if(val == 2){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=548, height=325");
	}
else if(val == 3){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=500, height=348");
	}
else if(val == 4){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=400, height=547");
	}
else if(val == 5){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=285, height=415");
	}
else if(val == 6){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=341, height=473");
	}
else if(val == 7){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=403, height=237");
	}
else if(val == 8){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=400, height=529");
	}
else if(val == 9){
		window.open(PicLink[val], "popJN", "scrollbars=no, width=456, height=275");
	}
}




function OnPUNext(n){
	clearTimeout(t);
	j = n;
	runSlideShow();
}

function stopSlideShow(){
	clearTimeout(t);
}

