function setPng24(obj) {
	var useragent = navigator.userAgent;
	
	if ((useragent.indexOf('MSIE 6')>0) && (useragent.indexOf('MSIE 7')==-1)){
		obj.width=obj.height=1;
		obj.className=obj.className.replace(/\bpng24\b/i,'');
		obj.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ obj.src +"',sizingMethod='image');"
		obj.src='';
		return '';
	}
}


// Top Menu
function initNavigation(seq) {
	nav = document.getElementById("mainmenu");
	nav.menu = new Array();
	nav.current = null;
	nav.menuseq = 0;
	navLen = nav.childNodes.length;
	
	allA = nav.getElementsByTagName("a")
	for(k = 0; k < allA.length; k++) {
		allA.item(k).onmouseover = allA.item(k).onfocus = function () {
			nav.isOver = true;
		}
		allA.item(k).onmouseout = allA.item(k).onblur = function () {
			nav.isOver = false;
			setTimeout(function () {
				if (nav.isOver == false) {
					if (nav.menu[seq])
						nav.menu[seq].onmouseover();
					else if(nav.current) {
						menuImg = nav.current.childNodes.item(0);
						menuImg.src = menuImg.src.replace(".gif", ".gif");
						if (nav.current.submenu)
							nav.current.submenu.style.display = "none";
						nav.current = null;
					}
				}
			}, 3000);
		}
	}

	for (i = 0; i < navLen; i++) {
		navItem = nav.childNodes.item(i);
		if (navItem.tagName != "LI")
			continue;

		navAnchor = navItem.getElementsByTagName("a").item(0);
		navAnchor.submenu = navItem.getElementsByTagName("ul").item(0);
		
		navAnchor.onmouseover = navAnchor.onfocus = function () {
			if (nav.current) {
				menuImg = nav.current.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", ".gif");
				if (nav.current.submenu)
					nav.current.submenu.style.display = "none";
				nav.current = null;
			}
			if (nav.current != this) {
				menuImg = this.childNodes.item(0);
				menuImg.src = menuImg.src.replace(".gif", ".gif");
				if (this.submenu)
					this.submenu.style.display = "block";
				nav.current = this;
			}
			nav.isOver = true;
		}
		nav.menuseq++;
		nav.menu[nav.menuseq] = navAnchor;
	}
	if (nav.menu[seq])
		nav.menu[seq].onmouseover();
}










// ¾Ë¸®¹Ì
var slideShowSpeed = 7000;
var crossFadeDuration = 3;
var Pic = new Array();
var PicLink = new Array();



Pic[0]		= "/english/img/main/arimy01.jpg";
PicLink[0]	= "/english/programs/index.jsp?mainMenu=3&subMenu=31";
Pic[1]		= "/english/img/main/arimy02.jpg";
PicLink[1]	= "/english/programs/index02.jsp?mainMenu=3&subMenu=32";
Pic[2]		= "/english/img/main/arimy03.jpg";
PicLink[2]	= "/english/programs/index03.jsp?mainMenu=3&subMenu=33";
Pic[3]		= "/english/img/main/arimy04.jpg";
PicLink[3]	= "/english/programs/index04.jsp?mainMenu=3&subMenu=34";
Pic[4]		= "/english/img/main/arimy05.jpg";
PicLink[4]	= "/english/programs/index07.jsp?mainMenu=3&subMenu=37";
Pic[5]		= "/english/img/main/arimy06.jpg";
PicLink[5]	= "/english/programs/index05.jsp?mainMenu=3&subMenu=35";
Pic[6]		= "/english/img/main/arimy07.jpg";
PicLink[6]	= "/english/programs/index06.jsp?mainMenu=3&subMenu=36";
//Pic[7]		= "/01kr/images/main/arimy090319.jpg";
//PicLink[7]	= "http://www.jeonnam.go.kr/01kr/open/open_sub.jsp?bid=information11&mode=view&cur_page=1&s_username&s_subject=&q_box=&sortfield=&s_category=&cate_box=&Include=Include&MID=A0303&jnid=&cno=2573";


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(){
	if (document.all){
		document.getElementById('SlideShow').style.filter = "blendTrans(duration=2)";
		document.getElementById('SlideShow').style.filter = "blendTrans(duration=crossFadeDuration)";
		document.getElementById('SlideShow').filters.blendTrans.Apply();    
	}
   
	document.getElementById('SlideShow').src = preLoad[j].src;
	document.getElementById('SlideLink').href = preLoadLink[j];

	document.getElementById('AlimiNum01').src = "/english/img/main/arlimy_num01.gif";
	document.getElementById('AlimiNum02').src = "/english/img/main/arlimy_num02.gif";
	document.getElementById('AlimiNum03').src = "/english/img/main/arlimy_num03.gif";
	document.getElementById('AlimiNum04').src = "/english/img/main/arlimy_num04.gif";
	document.getElementById('AlimiNum05').src = "/english/img/main/arlimy_num05.gif";
	document.getElementById('AlimiNum06').src = "/english/img/main/arlimy_num06.gif";
	document.getElementById('AlimiNum07').src = "/english/img/main/arlimy_num07.gif";
	//document.getElementById('AlimiNum08').src = "/01kr/images/main/banner_num08_off.gif";
	
	document.getElementById('AlimiNum0' + (j+1)).src =  '/english/img/main/arlimy_num0' + (j+1) + '_on.gif';

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


function OnPULink(){
	if(j==0){
		val = 7;	//Pic AOA¨ú ¨ùyAU ¡¾a¡¤I;
	}else{
		val = j-1;
	}
	window.open(PicLink[val]);
}


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

function stopSlideShow(){
	clearTimeout(t);
}