// Flash Embed ½ºÅ©¸³Æ® -- »ç¿ë¿¹ : <script>embed_flash("/images/flash/a.swf", 100, 50) 
function swf(src, w, h) {
	html = '';
	html += '<object type="application/x-shockwave-flash" classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" id="param" width="'+w+'" height="'+h+'">';
	html += '<param name="movie" value="'+src+'">';
	html += '<param name="quality" value="high">';
	html += '<param name="bgcolor" value="#ffffff">';
	html += '<param name="wmode" value="transparent">';
	html += '<param name="swliveconnect" value="true">';
	html += '<embed src="'+src+'" quality=high bgcolor="#ffffff" width="'+w+'" height="'+h+'" swliveconnect="true" id="param" name="param" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer"><\/embed>';
	html += '<\/object>';
	document.write(html);
}




// movie embed ½ºÅ©¸³Æ®
/*-------------------------------------------------------
 * ÀÏ¹Ý asf, wmv ÆÄÀÏ Ãâ·Â
--------------------------------------------------------*/
function vod_play(play_url, width, height) {

    var width_val = 320;
    var height_val = 310;
    if(width) width_val = width;
    if(height) height_val = height;
	str = "<object id=\"vodPlay\" width="+width_val+" height="+height_val+" viewastext style=\"z-index:1\" classid=\"CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6\" standby=\"Loading Microsoft Windows Media Player components...\" type=\"application/x-oleobject\">"
        + "<param name=\"URL\" value=\""+play_url+"\">"
        + "<param name=\"ANIMATIONATSTART\" value=\"0\">"
        + "<param name=\"AUTOSTART\" value=\"1\">"
        + "<param name=\"BALANCE\" value=\"0\">"
        + "<param name=\"CURRENTMARKER\" value=\"0\">"
        + "<param name=\"CURRENTPOSITION\" value=\"0\">"
        + "<param name=\"DISPLAYMODE\" value=\"4\">"
        + "<param name=\"ENABLECONTEXTMENU\" value=\"0\">"
        + "<param name=\"ENABLED\" value=\"1\">"
        + "<param name=\"FULLSCREEN\" value=\"0\">"
        + "<param name=\"INVOKEURLS\" value=\"-1\">"
        + "<param name=\"PLAYCOUNT\" value=\"1\">"
        + "<param name=\"RATE\" value=\"1\">"
        + "<param name=\"SHOWCONTROLS\" value=\"1\">"
        + "<param name=\"SHOWSTATUSBAR\" value=\"1\">"
        + "<param name=\"STRETCHTOFIT\" value=\"1\">"
        + "<param name=\"TRANSPARENTATSTART\" value=\"1\">"
        + "<param name=\"UIMODE\" value=\"FULL\">"
        + "<embed width=0 height=0 type='application/x-mplayer2' pluginspage='http://www.microsoft.com/Windows/MediaPlayer/download/default.asp' AutoStart='1' ShowControls='1' ShowStatusBar='1' ShowDisplay='1' ShowTracker='1' src='"+play_url+"'></embed>"

        + "</object>"

	document.write(str);
}



// ¸µÅ© Å×µÎ¸® Á¡¼± ¾ø¾Ö±â
function autoBlur(){ 
  if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") 
  document.body.focus(); 
} 
  document.onfocusin=autoBlur; 




// ÄÞº¸¹Ú½º »õÃ¢¸µÅ©
function goPage(value) {
 window.open(value,'','');
}

// FAQÇü ÆîÄ§±â´É
function txt_roll(str) {

	// ¼±ÅÃ¾ÈÇÑ Ç×¸ñ ¸ðµÎ´ÝÀ½
	for (var i=1; i<50; i++)	{
		if (document.getElementById("faq"+i) && str != "faq"+i) document.getElementById("faq"+i).style.display="none";
	}
	
	// ¼±ÅÃÇ×¸ñ ¹ÝÀü
	if (document.getElementById(str).style.display=="none") {document.getElementById(str).style.display="";}
	else if (document.getElementById(str).style.display=="") {document.getElementById(str).style.display="none";}
}


// ±âº» ÆË¾÷Ã¢
function view_open(url,name,features) { 
    window.open(url,name,features);
}

// window ¶ç¿ì±â
function open_win(URL, name, width, height) 
{
    msgWindow=window.open(URL,name,'location=0,toolbar=no,width='+width+',height='+height+',directories=no,status=no,scrollbars=Yes,resizable=no,menubar=no,border=0');
    msgWindow.focus()
}

// window ÆË¾÷ È®´ëÀÌ¹ÌÁö
function openwin(theURL,winName,features) { 
  window.open(theURL,winName,features);
}


// ¹öÆ° ·Ñ¿À¹ö
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];}
}







/* roll over-out image */
function menuOver() {
	this.src = this.src.replace(".gif", "_on.gif");
}
function menuOut() {
	this.src = this.src.replace("_on.gif", ".gif");
}
function initImgEffect(ImgEls,SelImg) {

	MenuImg = document.getElementById(ImgEls).getElementsByTagName("img");
	MenuImgLen = MenuImg.length;

	for (i=0; i<MenuImgLen; i++) {
		MenuImg.item(i).onmouseover = menuOver;
		MenuImg.item(i).onmouseout = menuOut;
		if (i == SelImg) {
			MenuImg.item(i).onmouseover();
			MenuImg.item(i).onmouseover = null;
			MenuImg.item(i).onmouseout = null;
		}
	}
}



/* submenu */
function initSubmenu(depth1, depth2, depth3) {
	selectDepth1 = "menu" + depth1 + "-" + depth2;
	selectDepth2 = "menu" + depth1 + "-" + depth2 + "-" + depth3;

	nav = document.getElementById("sub");
	menuEl = nav.getElementsByTagName("li");

	for(i = 0; i < menuEl.length; i++) {
		if (menuEl.item(i).id == selectDepth1 || menuEl.item(i).id == selectDepth2  ) {
			menuEl.item(i).getElementsByTagName("img").item(0).src = menuEl.item(i).getElementsByTagName("img").item(0).src.replace(".gif", "_on.gif");
		} else {
			menuEl.item(i).getElementsByTagName("img").item(0).onmouseover = menuOver;
			menuEl.item(i).getElementsByTagName("img").item(0).onmouseout = menuOut;
			if (menuEl.item(i).getElementsByTagName("ul").item(0)) {
				menuEl.item(i).getElementsByTagName("ul").item(0).style.display = "none";
			}
		}
	}
}



function iframe_resize(iframe) {
	if (id_iframe = parent.document.getElementById(iframe)) { 

		if(document.all) h = document.body.scrollHeight;
		else h = document.body.offsetHeight;

		id_iframe.height = h;
	}
}


///////////////////// defense.js ////////////////////////////////
function keypressed(keyStroke){ 
	//var key=event.keyCode;
	var key = (window.event) ? event.keyCode : keyStroke.which;

	// È­»ìÇ¥ Å°º¸µå Ã³¸®

	if (key == 13) event.keyCode='';
	if (key == 116) event.keyCode='';
	if (key == 122) event.keyCode='';
	if (window.event.ctrlKey == true ) return false;
	if (window.event.altKey == true ) return false;

	//return false;		

} 
function mouseFalse() {
	return false;
}
document.onkeydown=keypressed ; 
document.oncontextmenu = mouseFalse;
document.ondragstart = mouseFalse;
document.onselectstart = mouseFalse;
