/**
 * °øÅë ½ºÅ©¸³Æ® (»çÀÌÆ® Àü¹ÝÀûÀ¸·Î »ç¿ëµÇ´Â ½ºÅ©¸³Æ®)
 */


//Popup 		
function popup(Fn,Win, X, Y, Scroll){
l = (screen.width) ?	(screen.width- X) / 2	: 0;
t = (screen.height) ?	(screen.height- Y) / 2 : 0;	
	NewWindow=window.open(Fn,Win,'width='+X+',height='+Y+',top='+t+',left='+l+',scrollbars='+Scroll+',toolbar=no,location=no,directories=no,status=no,resizable=no,menubar=no');
}
	

function JumpMenu(form) {
 var myindex=form.cmbSel.selectedIndex 
	 // if (myindex == 0) {
			document.location.href = form.cmbSel.options[myindex].value;
   // } 
	//	else
	//	{
	//	 window.open(form.cmbSel.options[myindex].value); 
	//	}
}
// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function ObFlashW(url,w,h,vars,bg,win){
	
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if(vars==null) 	vars='';
	if(bg==null) 	bg='#FFFFFF';
	if(win==null) 	win='transparent';


	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
		flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,0,0'";
		flashStr+="			width='"+w+"'";
		flashStr+="			height='"+h+"'";
		flashStr+="			id='"+id+"'";
		flashStr+="			align='middle'>";

		flashStr+="		<param name='allowScriptAccess' value='always' />";
		flashStr+="		<param name='movie' value='"+url+"' />";
		flashStr+="		<param name='FlashVars' value='"+vars+"' />";
		flashStr+="		<param name='wmode' value='"+win+"' />";
		flashStr+="		<param name='menu' value='false' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";
	
	
		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='false'";
		flashStr+="		       quality='high'";
		flashStr+="		       bgcolor='"+bg+"'";
		flashStr+="		       width='"+w+"'";
		flashStr+="		       height='"+h+"'";
		flashStr+="		       name='"+id+"'";
		flashStr+="		       align='middle'";
		flashStr+="		       allowScriptAccess='always'";
		flashStr+="		       type='application/x-shockwave-flash'";
		flashStr+="		       pluginspage='http://www.macromedia.com/go/getflashplayer' />";
		flashStr+=" </object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(movStr);
}


// MovieWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function ObMovW(url,w,h,bg){
	
	var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
	if(bg==null) 	bg='#FFFFFF';


	// µ¿¿µ»ó ÄÚµå Á¤ÀÇ
	var movStr= "	<object classid='CLSID:22D6f312-B0F6-11D0-94AB-0080C74C7E95'";
		movStr+="			codebase='http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=6,4,05,0809'  standby='Loading Microsoft Windows Media Player components...' type='application/x-oleobject' VIEWASTEXT";
		movStr+="			width='"+w+"'";
		movStr+="			height='"+h+"'";
		movStr+="			id='"+id+"'";
		movStr+="			name='"+id+"'>";
		movStr+="			<param name='FileName' value='"+url+"' />";		
		movStr+="			<param name='transparentAtStart' value='True' />";		
		movStr+="			<param name='transparentAtStop' value='False' />";	
		movStr+="			<param name='AnimationAtStart' value='False' />";		
		movStr+="			<param name='AutoStart' value='0' />";		
		movStr+="			<param name='AutoRewind' value='true' />";		
		movStr+="			<param name='SendMouseClickEvents' value='True' />";		
		movStr+="			<param name='DisplaySize' value='0' />";			
		movStr+="			<param name='AutoSize' value='False' />";					
		movStr+="			<param name='ShowDisplay' value='False' />";		
		movStr+="			<param name='ShowControls' value='1' />";		
		movStr+="			<param name='ShowTracker' value='True' />";				
		movStr+="			<param name='Enabled' value='1' />";		
		movStr+="			<param name='EnableContextMenu' value='0' />";		
		movStr+="			<param name='EnablePositionControls' value='1' />";		
		movStr+="			<param name='EnableFullScreenControls' value='1' />";		
		movStr+="			<param name='ShowPositionControls' value='1' />";		
		movStr+="			<param name='Mute' value='0' />";		
		movStr+="			<param name='Rate' value='1' />";		
		movStr+="			<param name='SAMILang' value='' />";		
		movStr+="			<param name='SAMIStyle' value='' />";		
		movStr+="			<param name='SAMIFileName' value='' />";		
		movStr+="			<param name='ClickToPlay' value='0' />";		
		movStr+="			<param name='CursorType' value='1' />";		
		movStr+=" </object>";

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	document.write(movStr);
}

//iframe ±æÀÌ ´Ã¾î³ª±â
function resizeHeight(fr) {
  fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
  fr.setExpression('height',detail.document.body.scrollHeight);
}
function resizeHeight2(fr) {
  fr = typeof fr == 'string' ? document.getElementById(fr) : fr;
  fr.setExpression('height',clearance.document.body.scrollHeight);
}

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];}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


// Å¾¹öÆ°½ºÅ©·Ñ
function goTop(orix,oriy,desx,desy) {
		var Timer;
		var winHeight = document.body.scrollTop;
		if(Timer) clearTimeout(Timer);
		startx = 0;
		starty = winHeight;
		if(!orix || orix < 0) orix = 0;
		if(!oriy || oriy < 0) oriy = 0;
		var speed = 7;
		if(!desx) desx = 0 + startx;
		if(!desy) desy = 0 + starty;
		desx += (orix - startx) / speed;
		if (desx < 0) desx = 0;
		desy += (oriy - starty) / speed;
		if (desy < 0) desy = 0;
		var posX = Math.ceil(desx);
		var posY = Math.ceil(desy);
		window.scrollTo(posX, posY);
		if((Math.floor(Math.abs(startx - orix)) < 1) && (Math.floor(Math.abs(starty - oriy)) < 1)){
			clearTimeout(Timer);
			window.scroll(orix,oriy);
		}else if(posX != orix || posY != oriy){
			Timer = setTimeout("goTop("+orix+","+oriy+","+desx+","+desy+")",15);
		}else{
			clearTimeout(Timer);
		}
	}	

var bNetscape4plus = (navigator.appName == "Netscape" && navigator.appVersion.substring(0,1) >= "4");
var bExplorer4plus = (navigator.appName == "Microsoft Internet Explorer" && navigator.appVersion.substring(0,1) >= "4");
function CheckUIElements(){
  var yMenuFrom, yMenuTo, yButtonFrom, yButtonTo, yOffset, timeoutNextCheck;
	var ie=document.all&&navigator.userAgent.indexOf("Opera")==-1
	var ne=document.getElementById==-1
	var window_height=ie? document.body.clientHeight : window.innerHeight
	var window_height1=ne? document.getElementById.clientHeight : window.innerHeight

  if ( bNetscape4plus ) {
    yMenuFrom   = document["divMenu"].top;
    yMenuTo     = top.pageYOffset  + 108;
  }
  else if ( bExplorer4plus ) {
    yMenuFrom   = parseInt (divMenu.style.top, 10);
    yMenuTo     = document.body.scrollTop  +108 ;
  }

  timeoutNextCheck = 500;

  if ( Math.abs (yButtonFrom - (yMenuTo + 152)) < 6 && yButtonTo < yButtonFrom ) {
    setTimeout ("CheckUIElements()", timeoutNextCheck);
    return;
  }

  if ( yButtonFrom != yButtonTo ) {
    yOffset = Math.ceil( Math.abs( yButtonTo - yButtonFrom ) / 10 );
    if ( yButtonTo < yButtonFrom )
      yOffset = -yOffset;

    if ( bNetscape4plus )
      document["divLinkButton"].top += yOffset;
    else if ( bExplorer4plus )
      divLinkButton.style.top = parseInt (divLinkButton.style.top, 10) + yOffset;

    timeoutNextCheck = 10;
  }
  if ( yMenuFrom != yMenuTo ) {
    yOffset = Math.ceil( Math.abs( yMenuTo - yMenuFrom ) / 20 );
    if ( yMenuTo < yMenuFrom )
      yOffset = -yOffset;

    if ( bNetscape4plus )
      document["divMenu"].top += yOffset;
    else if ( bExplorer4plus )
      divMenu.style.top = parseInt (divMenu.style.top, 10) + yOffset;

    timeoutNextCheck = 10;
  }

  setTimeout ("CheckUIElements()", timeoutNextCheck);
}

function OnLoad()
{
  var y;
  if ( top.frames.length )
  if ( bNetscape4plus ) {
    document["divMenu"].top = top.pageYOffset + 135;
    document["divMenu"].visibility = "visible";
  }
  else if ( bExplorer4plus ) {
    divMenu.style.top = document.body.scrollTop + 135;
    divMenu.style.visibility = "visible";
  }
  CheckUIElements();
  return true;
}


// images roll
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}

function imagesOver(imgEl) {
	imgEl.src = imgEl.src.replace(".gif", "_on.gif");
}
function imagesOut(imgEl) {
	imgEl.src = imgEl.src.replace("_on.gif", ".gif");
}

// element toggle
function blockToggle(href) {
	targetElement = document.getElementById(href.split("#")[1]);

	if (targetElement && targetElement.style.display == "block") {
		targetElement.style.display = "none";
	} else {
		targetElement.style.display = "block";
	}
	return false;
}



// tabbed menu
function initTabMenu(menuElId) {
	var tabMenu = document.getElementById(menuElId).getElementsByTagName("a");
	for(i=0; i<tabMenu.length; i++) {
		thismenu = tabMenu.item(i);
		thismenu.menuContainer = document.getElementById(menuElId);
		thismenu.targetEl = document.getElementById(tabMenu.item(i).href.split("#")[1]);
		thismenu.targetEl.style.display = "none";
		thismenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
		thismenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
		thismenu.onclick = tabMenuClick;
	}

	initmenu = tabMenu.item(0);
	initmenu.targetEl.style.display = "block";
	initmenu.getElementsByTagName("img").item(0).onmouseover();
	initmenu.getElementsByTagName("img").item(0).onmouseover = null;
	initmenu.getElementsByTagName("img").item(0).onmouseout = null;
	initmenu.menuContainer.current = initmenu;
}
function tabMenuClick() {
	currentmenu = this.menuContainer.current;
	if (currentmenu != this) {
		currentmenu.targetEl.style.display = "none";
		currentmenu.getElementsByTagName("img").item(0).onmouseover = menuOver;
		currentmenu.getElementsByTagName("img").item(0).onmouseout = menuOut;
		currentmenu.getElementsByTagName("img").item(0).onmouseout();
	
		this.targetEl.style.display = "block";
		this.getElementsByTagName("img").item(0).onmouseover = null;
		this.getElementsByTagName("img").item(0).onmouseout = null;
		this.menuContainer.current = this;
	}
	return false;
}


/* depth4*/
// images roll
function menuOver2() {
	this.src = this.src.replace("_off.gif", "_on.gif");
}
function menuOut2() {
	this.src = this.src.replace("_on.gif", "_off.gif");
}

var tabcurrentSeq = -1;
function initTabMenu2(menuEl) {
	for (i=0; i<menuEl.length; i++) {
		if (i != tabcurrentSeq) {
			menuEl[i].onmouseover = menuOver2;
			menuEl[i].onmouseout = menuOut2;
		} else {
			menuEl[i].src = menuEl[i].src.replace("_off.gif", "_on.gif")
		}
	}
}
document.getElementsBySelector = function(selector) {
	// Attempt to fail gracefully in lesser browsers
	if (!document.getElementsByTagName) {
		return new Array();
	}
	// Split selector in to tokens
	var tokens = selector.split(' ');
	var currentContext = new Array(document);
	for (var i = 0; i < tokens.length; i++) {
		token = tokens[i].replace(/^\s+/,'').replace(/\s+$/,'');;
		if (token.indexOf('#') > -1) {
			// Token is an ID selector
			var bits = token.split('#');
			var tagName = bits[0];
			var id = bits[1];
			var element = document.getElementById(id);
			if (tagName && element.nodeName.toLowerCase() != tagName) {
				// tag with that ID not found, return false
				return new Array();
			}
			// Set currentContext to contain just this element
			currentContext = new Array(element);
			continue; // Skip to next token
		}
		if (token.indexOf('.') > -1) {
			// Token contains a class selector
			var bits = token.split('.');
			var tagName = bits[0];
			var className = bits[1];
			if (!tagName) {
				tagName = '*';
			}
			// Get elements matching tag, filter them for class selector
			var found = new Array;
			var foundCount = 0;
			for (var h = 0; h < currentContext.length; h++) {
				var elements;
				if (tagName == '*') {
						elements = getAllChildren(currentContext[h]);
				} else {
						elements = currentContext[h].getElementsByTagName(tagName);
				}
				for (var j = 0; j < elements.length; j++) {
					found[foundCount++] = elements[j];
				}
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			for (var k = 0; k < found.length; k++) {
				if (found[k].className && found[k].className.match(new RegExp('\\b'+className+'\\b'))) {
					currentContext[currentContextIndex++] = found[k];
				}
			}
			continue; // Skip to next token
		}
		// Code to deal with attribute selectors
		if (token.match(/^(\w*)\[(\w+)([=~\|\^\$\*]?)=?"?([^\]"]*)"?\]$/)) {
			var tagName = RegExp.$1;
			var attrName = RegExp.$2;
			var attrOperator = RegExp.$3;
			var attrValue = RegExp.$4;
			if (!tagName) {
				tagName = '*';
			}
			// Grab all of the tagName elements within current context
			var found = new Array;
			var foundCount = 0;
			for (var h = 0; h < currentContext.length; h++) {
				var elements;
				if (tagName == '*') {
						elements = getAllChildren(currentContext[h]);
				} else {
						elements = currentContext[h].getElementsByTagName(tagName);
				}
				for (var j = 0; j < elements.length; j++) {
					found[foundCount++] = elements[j];
				}
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			var checkFunction; // This function will be used to filter the elements
			switch (attrOperator) {
				case '=': // Equality
					checkFunction = function(e) { return (e.getAttribute(attrName) == attrValue); };
					break;
				case '~': // Match one of space seperated words 
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('\\b'+attrValue+'\\b'))); };
					break;
				case '|': // Match start with value followed by optional hyphen
					checkFunction = function(e) { return (e.getAttribute(attrName).match(new RegExp('^'+attrValue+'-?'))); };
					break;
				case '^': // Match starts with value
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) == 0); };
					break;
				case '$': // Match ends with value - fails with "Warning" in Opera 7
					checkFunction = function(e) { return (e.getAttribute(attrName).lastIndexOf(attrValue) == e.getAttribute(attrName).length - attrValue.length); };
					break;
				case '*': // Match ends with value
					checkFunction = function(e) { return (e.getAttribute(attrName).indexOf(attrValue) > -1); };
					break;
				default :
					// Just test for existence of attribute
					checkFunction = function(e) { return e.getAttribute(attrName); };
			}
			currentContext = new Array;
			var currentContextIndex = 0;
			for (var k = 0; k < found.length; k++) {
				if (checkFunction(found[k])) {
					currentContext[currentContextIndex++] = found[k];
				}
			}
			// alert('Attribute Selector: '+tagName+' '+attrName+' '+attrOperator+' '+attrValue);
			continue; // Skip to next token
		}
		// If we get here, token is JUST an element (not a class or ID selector)
		tagName = token;
		var found = new Array;
		var foundCount = 0;
		for (var h = 0; h < currentContext.length; h++) {
			var elements = currentContext[h].getElementsByTagName(tagName);
			for (var j = 0; j < elements.length; j++) {
				found[foundCount++] = elements[j];
			}
		}
		currentContext = found;
	}
	return currentContext;
}




<!-- [Á¡¼± ¾ø¾Ö±â] ½ÃÀÛ ###########################################################################-->
function allblur() {
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
}
document.onfocusin = allblur;
<!-- [Á¡¼± ¾ø¾Ö±â] ³¡ ###########################################################################-->


//add by Pentabreed 2009-06-17

//Element ID ºÒ·¯¾²±â
function dEI(elementID){
	return document.getElementById(elementID);
}

// first ¿¹¿ÜÃ³¸® firstChild(ºí·°Id, ÅÂ±×³×ÀÓ, Ã³¸®ÇÒ ¾ÆÀÌÅÛ ¹øÈ£) // ¾ÆÀÌÅÛ¹øÈ£´Â 0¹øºÎÅÍ ¹ÝÈ¯
function firstChild(Elid, Etn, Num){
	if(Num==""){Num=0;}
	liEl = dEI(Elid).getElementsByTagName(Etn);
	if (liEl.item(Num)) {
		liEl.item(Num).className += " first-child";
	}
}

// first ¿¹¿ÜÃ³¸® listFirst(ºí·°Id, ÅÂ±×³×ÀÓ, Ã³¸®ÇÒ ¾ÆÀÌÅÛ °¹¼ö) // ¾ÆÀÌÅÛ¹øÈ£´Â 0¹øºÎÅÍ ¹ÝÈ¯
function listFirst(Elid, Etn, Num){
	liEl = dEI(Elid).getElementsByTagName(Etn);
	for(i=0; liEl.length>i; i=i+Num){
		liEl.item(i) .className += " first";
	}
}

// first line ¿¹¿ÜÃ³¸® firstLine(ºí·°Id, ÅÂ±×³×ÀÓ, Ã³¸®ÇÒ ¾ÆÀÌÅÛ °¹¼ö) // ¾ÆÀÌÅÛ¹øÈ£´Â 0¹øºÎÅÍ ¹ÝÈ¯
function firstLine(Elid, Etn, Num){
	liEl = dEI(Elid).getElementsByTagName(Etn);
	var checkNum = Num;
	if(liEl.length<Num){
		liEl.length = checkNum;
	}
	for(i=0; i<checkNum; i++){
	liEl.item(i) .className += " firstLine";
	}
}

// ÀÌ¹ÌÁö ·Ñ¿À¹ö
function imgRollover(imgBoxID){
	var MenuCounts = dEI(imgBoxID).getElementsByTagName("img");
	for (i=0;i<MenuCounts.length;i++) {
		var numImg=MenuCounts.item(i);
		var ImgCheck = numImg.src.substring(numImg.src.length-6,numImg.src.length);
		if (ImgCheck!="on.gif") {
				numImg.onmouseover = function () {
					this.src = this.src.replace(".gif", "on.gif");
				}
				numImg.onmouseout = function () {
					this.src = this.src.replace("on.gif", ".gif");
				}
			}
	}
}

//FAQ
function toggleList(tabContainer) {
	var tabContainer=document.getElementById(tabContainer)
	var triggers = tabContainer.getElementsByTagName("a");

	for(i = 0; i < triggers.length; i++) {
		if (triggers.item(i).href.split("#")[1])
			triggers.item(i).targetEl = document.getElementById(triggers.item(i).href.split("#")[1]);

		if (!triggers.item(i).targetEl)
			continue;

		triggers.item(i).targetEl.style.display = "none";
		triggers.item(i).className="";
		triggers.item(i).onclick = function () {
			if (tabContainer.current == this) {
				this.targetEl.style.display = "none";
				this.className="";
				tabContainer.current = null;
			} else {
				if (tabContainer.current) {
					tabContainer.current.targetEl.style.display = "none";
					tabContainer.current.className="";
				}
				this.targetEl.style.display = "block";
				this.className="on";
				tabContainer.current = this;
			}
			return false;
		}
	}
	//triggers.item(0).targetEl.style.display = "block";
}


