function bluring() //¸µÅ© ÀÌ¹ÌÁö¿¡ onfocus='this.blur()' È¿°ú
{ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 
document.onfocusin=bluring; 

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_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.0
	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 && document.getElementById) x=document.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_showHideLayers()
{ //v3.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_openBrWindow(theURL,winName,features)
{ //v2.0
	window.open(theURL,winName,features);
}


// Ä³¸¯ÅÍ¸í º¯°æ ÆË¾÷Ã¢
function UserCharCng()
{
	var iMyWidth;
	var iMyHeight;
	iMyWidth = (window.screen.width/2) - (200 + 10);
	iMyHeight = (window.screen.height/2) - (160 + 50);
	urlstr = "http://kr.joymax.com/silkroad/Silkroad_Front.jmx?workURL=http://krsilkroadcp.joymax.com/notarget/uname/ucharid.asp"
	var winpop = window.open(urlstr,"UserCC","width=400,height=314,left=" + iMyWidth + ",top=" + iMyHeight + ",screenX=" + iMyWidth + ",screenY=" + iMyHeight + ",status=no,scrollbars=no,directories=no,menubar=no,toolbar=no,resizable=no");
	winpop.focus();
}

// ½ÇÅ© ÃæÀü ÆË¾÷Ã¢
function SilkChargeGO()
{
	var width_ = 400;
	var height_ = 458;
	var left_ = screen.width;
	var top_ = screen.height;

	left_ = left_/2 - (width_/2);
	top_ = top_/2 - (height_/2);

	var GoUrl = "http://kr.joymax.com/silkroad/Silkroad_Front.jmx?workURL=http://krsilkroadcp.joymax.com/itemmall/silkcharge_goods.asp"
	window.open(GoUrl, "silkcharge", "width="+ width_ +", height="+ height_ +", top="+ top_ +", left="+ left_ +", resizable=0, fullscreen=0, scrollbars=0, directories=0, menubar=0, toolbar=0");
}


// *** ÀÌ¿Ã¶ó½º °ÇÀ¸·Î ÆÐÄ¡µÈ ¿ÜºÎ ÄÁÆ®·Ñ »ç¿ë ½ºÅ©¸³Æ®, µÎ °¡Áö ¹æ½Ä Áß¿¡ ÅÃÀÏÇÏ¿© »ç¿ë
// s: source url
// d: flash id -> »ç¿ë¾ÈÇÔ (function mf(s,d,w,h,t)  -> width="+w+" height="+h+" id="+d+">)
// w: source width
// h: source height
// t: wmode ("" for none, transparent, opaque ...)
//function mf(s,w,h,t){
        //return "<object classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\" codebase=\"http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0\" width="+w+" height="+h+"><param name=wmode value="+t+" /><param name=movie value="+s+" /><param name=quality value=high /><embed src="+s+" quality=high wmode="+t+" type=\"application/x-shockwave-flash\" pluginspage=\"http://www.macromedia.com/shockwave/download/index.cgi?p1_prod_version=shockwaveflash\" width="+w+" height="+h+"></embed></object>";
//}

function mf(url,w,h,win){
	
	var wh_length = url.length;
	var sc_length = wh_length - 3;
	var filep = url.substring(wh_length, sc_length);

	if(filep == 'swf') {
		var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
		vars='';
		bg='#FFFFFF';
		if(win==null) win='transparent';

		if(document.forms.length > 0){
			id = document.forms[0].id;
		}

		// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
		var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
			flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,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='true' />";
			flashStr+="		<param name='quality' value='high' />";
			flashStr+="		<param name='bgcolor' value='"+bg+"' />";
		
		
			flashStr+="		<embed src='"+url+"'";
			flashStr+="		       flashVars='"+vars+"'";
			flashStr+="		       wmode='"+win+"'";
			flashStr+="		       menu='true'";
			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>";
	}
	else {
		//flashStr = "<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" width="+w+" height="+h+"><param name=filename value="+url+" /><param name=quality value=high /></object>";
		var id=url.split("/")[url.split("/").length-1].split(".")[0]; //id´Â ÆÄÀÏ¸íÀ¸·Î ¼³Á¤
		vars='';
		bg='#FFFFFF';
		if(win==null) win='transparent';

		if(document.forms.length > 0){
			id = document.forms[0].id;
		}

		// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
		var flashStr= "	<object classid='clsid:d27cdb6e-ae6d-11cf-96b8-444553540000'";
			flashStr+="			codebase='http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,124,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='true' />";
			flashStr+="		<param name='quality' value='high' />";
			flashStr+="		<param name='bgcolor' value='"+bg+"' />";
		
		
			flashStr+="		<embed src='"+url+"'";
			flashStr+="		       flashVars='"+vars+"'";
			flashStr+="		       wmode='"+win+"'";
			flashStr+="		       menu='true'";
			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>";
	}

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	return flashStr;
}

// ÀÌº¥Æ® µ¿¿µ»ó ¸µÅ© ½Ã PLAY ¹öÆ°À» ´­·¯¾ß µ¿¿µ»ó Àç»ý
function mf2(s,w,h,t){	
	return "<object classid=\"clsid:22d6f312-b0f6-11d0-94ab-0080c74c7e95\" codebase=\"http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701\" width="+w+" height="+h+"><param name=filename value="+s+" /><param name=quality value=high /><param name=AutoStart value=False /></object>";
}

// write document contents
function flashview(src){
	document.write(src);
}

// assign code innerHTML
function setcode(target, code){
	target.innerHTML = code;
}

/*
<script>
var ff = mf("http://img.yahoo.co.kr/game/silkroad/silkroad_opbeta/<%=ImgSc_Link%>/1n_topbimg_03.swf", "sro", 955, 341, "opaque");
documentwrite(ff);
</script>
*/


// Arguments : flashMovie(Ãâ·Â¿µ¿ªID,ÇÃ·¹½¬ÆÄÀÏ°æ·Î,WIDTH,HEIGHT[,FLASHVARS[,WMOD]])
function FlashMovie(fid,src,wid,hei,fvs,wmd) {
  this.fPrint = '';
  this.Id = document.getElementById(fid);
  this.Src = src;
  this.Width = wid;
  this.Height = hei;
  this.FlashVars = (fvs != undefined)? fvs :'';
  this.Wmod = (wmd != undefined)? wmd :'';
  if(isObject(Id)) {
    fPrint = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"';
    fPrint += ' width="'+Width+'"';
    fPrint += ' height="'+Height+'">';
    fPrint += '<param name="movie" value="'+Src+'">';
    fPrint += '<param name="quality" value="high">';
    fPrint += (FlashVars != null) ? '<param name="FlashVars" value="'+FlashVars+'">' : '';
    fPrint += (Wmod != null) ? '<param name="wmode" value="'+Wmod+'">' : '';
    fPrint += '<embed';
    fPrint += fPrint + ' src="'+Src+'"';
    fPrint += (FlashVars != null) ? ' FlashVars="'+FlashVars+'"' : '';
    fPrint += (Wmod != null) ? ' wmode="'+Wmod+'"' : '';
    fPrint += ' quality="high"';
    fPrint += ' pluginspage="http://www.macromedia.com/go/getflashplayer"';
    fPrint += ' type="application/x-shockwave-flash"';
    fPrint += ' width="'+Width+'"';
    fPrint += ' height="'+Height+'"';
    fPrint += '></embed>';
    fPrint += '</object>';
    Id.innerHTML = fPrint;
  }
}

function isObject(a) {
    return (a && typeof a == 'object');
}



/* ÀÌ¹ÌÁö ¿À¹ö¾Æ¿ô */
function menuon(imgel)
{
	imgel.src = imgel.src.replace(".gif", "_on.gif");
}

function menuout(imgel)
{
	imgel.src = imgel.src.replace("_on.gif", ".gif");
}


// flashWrite(ÆÄÀÏ°æ·Î, °¡·Î, ¼¼·Î[, º¯¼ö][,¹è°æ»ö][,À©µµ¿ì¸ðµå])
function flashWrite(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';

	if(document.forms.length > 0){
		id = document.forms[0].id;
	}

	// ÇÃ·¡½Ã ÄÚµå Á¤ÀÇ
	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+"'";
		//³×ÀÌÆ® °Ë»ö ¹öÆ° Å¬¸¯½Ã ½ºÅ©¸³Æ® ¿À·ù·Î ID°ª Á¦°Å
		//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='true' />";
		flashStr+="		<param name='quality' value='high' />";
		flashStr+="		<param name='bgcolor' value='"+bg+"' />";
	
	
		flashStr+="		<embed src='"+url+"'";
		flashStr+="		       flashVars='"+vars+"'";
		flashStr+="		       wmode='"+win+"'";
		flashStr+="		       menu='true'";
		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(flashStr);
}