/************************************************************
*
*  JavaScript
*
************************************************************/

// DreamWeaver Script
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_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 popupWin(URL,width,height) {
var str,width,height;
str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,copyhistory=no,";
str=str+"width="+width;
str=str+",height="+height+"'";
window.open(URL,'remote',str);
}

function popupWinsc(URL,width,height) {
var str,width,height;
str="'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=no,";
str=str+"width="+width;
str=str+",height="+height+"'";
window.open(URL,'remote',str);
}

// pNum ¸¦ ÀÔ·ÂÇØ¼­ ÆË¾÷¿¡¼­ ¿ÀÇÁ³Ê Ã¢À» ÇØ´ç ÆäÀÌÁö·Î ÀÌµ¿½ÃÅ´.
function goMain(pNum) {
	var pNum,ppNum;
	ppNum = "javascript:menuLink('";
	ppNum = ppNum+pNum;
	ppNum = ppNum+"');";
	opener.location.href= ppNum;
//	opener.location.href= "/mysmart/";
	self.close();
}

/************************************************************
* Tab View Start - ½º¸¶Æ®°øÈ­±¹ - ¸ðµ¨
************************************************************/
function TabMenu_md(index) {

for (i=1; i<=6; i++)
	if (index == i) {
		thisMenu = document.getElementById("md_Menu" + index);
		thisLayer = document.getElementById("md_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("md_Menu" + i);
		otherLayer = document.getElementById("md_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

/************************************************************
* Tab View Start - ¸¶ÀÌ¹Ì ´Ü°èº° ¼ºÀå °úÁ¤
************************************************************/
function TabMenu(index) {

for (i=1; i<=3; i++)
	if (index == i) {
		thisMenu = document.getElementById("r_Menu" + index);
		thisLayer = document.getElementById("r_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("r_Menu" + i);
		otherLayer = document.getElementById("r_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

function TabMenu_fz(index) {

for (i=1; i<=3; i++)
	if (index == i) {
		thisMenu = document.getElementById("fz_Menu" + index);
		thisLayer = document.getElementById("fz_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("fz_Menu" + i);
		otherLayer = document.getElementById("fz_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

/************************************************************
* Tab View Start - ±ÝÁÖÀÇ º£½ºÆ®¸ÅÀå
************************************************************/
function TabMenu2(index) {

for (i=1; i<=4; i++)
	if (index == i) {
		thisMenu = document.getElementById("r_Menu" + index);
		thisLayer = document.getElementById("r_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("r_Menu" + i);
		otherLayer = document.getElementById("r_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

/************************************************************
* Tab View Start - Â¯°øÈ­±¹ ¸ÞÀÎ Â¯Ä«µå¼Ò°³ , È¸¿ø°¡ÀÔ
************************************************************/
function TabMenu3(index) {

for (i=1; i<=2; i++)
	if (index == i) {
		thisMenu = document.getElementById("r_Menu" + index);
		thisLayer = document.getElementById("r_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("r_Menu" + i);
		otherLayer = document.getElementById("r_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

/************************************************************
* Tab View Start - Â¯°øÈ­±¹ ¸ÞÀÎ ÆÛ´ÏÆÛ´Ï
************************************************************/
function TabMenu4(index) {

for (i=1; i<=2; i++)
	if (index == i) {
		thisMenu = document.getElementById("f_Menu" + index);
		thisLayer = document.getElementById("f_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("f_Menu" + i);
		otherLayer = document.getElementById("f_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

/************************************************************
* Tab View Start - ÇÐ±³°ø°¨ ¿ì¸®µ¿¾Æ¸®
************************************************************/
function TabMenu5(index) {

for (i=1; i<=6; i++)
	if (index == i) {
		thisMenu = document.getElementById("r_Menu" + index);
		thisLayer = document.getElementById("r_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("r_Menu" + i);
		otherLayer = document.getElementById("r_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}

function TabMenu_cb(index) {

for (i=1; i<=4; i++)
	if (index == i) {
		thisMenu = document.getElementById("cb_Menu" + index);
		thisLayer = document.getElementById("cb_Cont" + index);
		thisMenu.style.display = "";
		thisLayer.style.display = "";

	}
	else {
		otherMenu = document.getElementById("cb_Menu" + i);
		otherLayer = document.getElementById("cb_Cont" + i);
		otherMenu.style.display = "none";
		otherLayer.style.display = "none";
	}
}
/************************************************************
* Tab View End
************************************************************/


/************************************************************
* Toggle Script ½ÃÀÛ
************************************************************/

function toggle(e) {
  if (e.style.display == "none") {
     e.style.display = "";
  } else {
     e.style.display = "none";
  }
}

/******************
EX))))

<table width="200" cellpadding="0" cellspacing="0" border="1">
	<tr>
		<td><a href="javascript:toggle(HideShow);">Click Here</a></td>
	</tr>
</table>
<span style="color: blue; display:none" id=HideShow>This will go away</span>
<table width="200" cellpadding="0" cellspacing="0" border="1">
	<tr>
		<td><a href="javascript:toggle(HideShow);">This is some text</a></td>
	</tr>
</table>
******************/
/************************************************************
* Toggle Script ³¡
************************************************************/



/************************************************************
* Popup Script ½ÃÀÛ
************************************************************/

function ticket_end() {
	alert ('¿¹¸Å°¡´É ±â°£ÀÌ ¾Æ´Õ´Ï´Ù.\n\n°ø¿¬ÀÌ Á¾·áµÇ¾ú½À´Ï´Ù.');
}

/************************************************************
* Popup Script ³¡
************************************************************/




/************************************************************
* Popup Script ½ÃÀÛ
************************************************************/

// Dreamweaver's Popup Script
function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

// Â¯! ´çÃ· ³»¿ëº¸±â ÆË¾÷
function _view_zzangPrize() {
  var wl = (window.screen.width/2) - ((716/2) + 10);
  var wt = (window.screen.height/2) - ((490/2) + 50);

  var option = "width=716,height=490,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=yes";

  commonPopWin = window.open('/mysmart/ev/MYSEVCA008Q.jsp','view_zzangPrize',option);
  commonPopWin.focus();
}

// Â¯À¸·Î ¹ÞÀº Â¯µ¹³»¿ª ÆË¾÷
function _recive_dol() {
  var wl = (window.screen.width/2) - ((416/2) + 10);
  var wt = (window.screen.height/2) - ((410/2) + 50);

  var option = "width=416,height=410,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=yes";

  commonPopWin = window.open('/mysmart/ev/MYSEVCA007Q.jsp','recive_dol',option);
  commonPopWin.focus();
}

// ±¸¸ÅÇÑ ÄíÆù ÆË¾÷
function _buy_coupon() {
  var wl = (window.screen.width/2) - ((816/2) + 10);
  var wt = (window.screen.height/2) - ((490/2) + 50);

  var option = "width=816,height=490,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=yes";

  commonPopWin = window.open('/mysmart/ac/MYSACCA005Q.jsp','buy_coupon',option);
  commonPopWin.focus();
}

// ½ÅÃ»ÇÑ »óÇ° ÆË¾÷
function _buy_product() {
  var wl = (window.screen.width/2) - ((416/2) + 10);
  var wt = (window.screen.height/2) - ((410/2) + 50);

  var option = "width=416,height=410,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=yes";

  commonPopWin = window.open('/mysmart/ac/MYSACCA004Q.jsp','buy_product',option);
  commonPopWin.focus();
}

// ¸¶ÀÌ¹Ì ÆÇ¸Å µî·ÏÇÏ±â ½Ç?? ÆË¾÷
function _not_enough() {
  var wl = (window.screen.width/2) - ((350/2) + 10);
  var wt = (window.screen.height/2) - ((212/2) + 50);

  var option = "width=350,height=212,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/mysmart/mm/MYSMMCA009Q.jsp','not_enough',option);
  commonPopWin.focus();
}

// ¸¶ÀÌ¹Ì ÆÇ¸Å µî·ÏÇÏ±â 2´Ü°è ÆË¾÷
function _regist_sell() {
  var wl = (window.screen.width/2) - ((350/2) + 10);
  var wt = (window.screen.height/2) - ((196/2) + 50);

  var option = "width=350,height=196,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/mysmart/mm/MYSMMCA008Q.jsp','regist_sell',option);
  commonPopWin.focus();
}

// ¸¶ÀÌ¹Ì ÆÇ¸Å µî·ÏÇÏ±â 1´Ü°è ÆË¾÷
function _mycrc_sell(chrid) {
  var wl = (window.screen.width/2) - ((416/2) + 10);
  var wt = (window.screen.height/2) - ((466/2) + 50);

  var option = "width=416,height=466,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=yes";

  commonPopWin = window.open('/smart/front/character/sellCharacterFrm.do?chrId=' + chrid,'mycrc_sell',option);
  commonPopWin.focus();
}

// ¸¶ÀÌ¹Ì ÄÜÅ×½ºÆ® µî·ÏÇÏ±â ÆË¾÷
function _regist_contest(chrid, use) {
	if (use == "U")	{
		alert("ÄÁÅ×½ºÆ®¿¡ Âü¿©ÇÒ¼ö ¾ø´Â Ä³¸¯ÅÍÀÔ´Ï´Ù");
		return;
	}
  var wl = (window.screen.width/2) - ((350/2) + 10);
  var wt = (window.screen.height/2) - ((196/2) + 50);

  var option = "width=350,height=196,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/smart/front/character/registContestFrm.do?chrId=' + chrid,'regist_contest',option);
  commonPopWin.focus();
}

// ÇöÀçº¸À¯ÇÑ ¾ÆÀÌÅÛ ÇöÈ² ÆË¾÷
function _myitem_view() {
  var wl = (window.screen.width/2) - ((400/2) + 10);
  var wt = (window.screen.height/2) - ((387/2) + 50);

  var option = "width=400,height=387,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/smart/mysmart/mm/MYSMMCA003Q.jsp','myap',option);
  commonPopWin.focus();
}

// ±âº» Ä³¸¯ÅÍ·Î ¼±ÅÃÇÏ±â ÆË¾÷
function _select_default(chrid, use) {
	if (use == "Y") {
		alert("ÇöÀç ±âº» Ä³¸¯ÅÍ·Î »ç¿ëÁßÀÔ´Ï´Ù");
		return;
	} else if (use == "U") {
		alert("±âº» Ä³¸¯ÅÍ·Î »ç¿ëÇÒ¼ö ¾ø½À´Ï´Ù");
		return;
	}
  var wl = (window.screen.width/2) - ((350/2) + 10);
  var wt = (window.screen.height/2) - ((127/2) + 50);

  var option = "width=350,height=127,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/smart/front/character/setDefaultCharacter.do?chrId=' + chrid,'myap',option);
  commonPopWin.focus();
}


// °Ô½Ã¹° »èÁ¦ ÆË¾÷
function _del_view() {
  var wl = (window.screen.width/2) - ((350/2) + 10);
  var wt = (window.screen.height/2) - ((184/2) + 50);

  var option = "width=350,height=184,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/talk/ss/TAKSSCA006Q.jsp','del_view',option);
  commonPopWin.focus();
}

// Å»Åð ÆË¾÷
function _leave_zzang() {
  var wl = (window.screen.width/2) - ((350/2) + 10);
  var wt = (window.screen.height/2) - ((184/2) + 50);

  var option = "width=350,height=184,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars=no";

  commonPopWin = window.open('/mysmart/if/MYSIFCA003Q.jsp','leave_zzang',option);
  commonPopWin.focus();
}

//  È­¸é Á¤Áß¾Ó¿¡ POPUP WINODOW OPEN

function fnOpenCenterWinOption( url, name, w, h, scroll) {

  var wl = (window.screen.width/2) - ((w/2) + 10);
  var wt = (window.screen.height/2) - ((h/2) + 0);

  var option = "height="+h+",width="+w+",left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll + ", status=no";

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

// ¿øÇÏ´Â À§Ä¡¿¡ POPUP WINODOW OPEN

function fnOpenUserWin( url, name, w, h, wl, wt, scroll) {

  var option = "status=no,height="+h+",width="+w+",resizable=no,left="+wl+",top="+wt+",screenX="+wl+",screenY="+wt+",scrollbars="+scroll;

  commonPopWin = window.open( url, name, option );
  commonPopWin.focus();
}

//°³ÀÎÁ¤º¸º¸È£Á¤Ã¥
function privacy_policy() {
	window.open('.asp','privacy','width=530,height=450,top=1,left=1,scrollbars=yes');
}


/************************************************************
* Popup Script ³¡
************************************************************/




/***********************************************************
*   QuickMenu Start
***********************************************************/

var stmnLEFT = 900;
var stmnGAP1 = 0;
var stmnGAP2 = 277;         //  ¿Ã¶ó°¥¼ö ÀÖ´Â ÃÖ»ó´Ü À§Ä¡
var stmnBASE = 5;
var stmnActivateSpeed = 0;
var stmnScrollSpeed = 0;

var stmnTimer;


function RefreshQuickMenu()
{
	var stmnStartPoint, stmnEndPoint, stmnRefreshTimer;

	stmnStartPoint = parseInt(QuickMenu.style.top, 10);
	stmnEndPoint = document.body.scrollTop + stmnGAP2;
	if (stmnEndPoint < stmnGAP1) stmnEndPoint = stmnGAP1;

	stmnRefreshTimer = stmnActivateSpeed;

	if ( stmnStartPoint != stmnEndPoint ) {
		stmnScrollAmount = Math.ceil( Math.abs( stmnEndPoint - stmnStartPoint ) / 15 );

		if ( document.body.scrollTop>=stmnGAP2 ) {
			QuickMenu.style.top = parseInt(document.body.scrollTop, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		} else if ( document.body.scrollTop<stmnGAP2 ) {
			QuickMenu.style.top = stmnGAP2;
		} else {
			//  À§ ÄÚµå »ðÀÔ..
			//  ½ÇÇàµÇÁö ¾ÊÀ½
			QuickMenu.style.top = parseInt(QuickMenu.style.top, 10) + ( ( stmnEndPoint<stmnStartPoint ) ? -stmnScrollAmount : stmnScrollAmount );
		}
		stmnRefreshTimer = stmnScrollSpeed;
	}

	stmnTimer = setTimeout ("RefreshQuickMenu();", stmnRefreshTimer);
}



function InitializeQuickMenu()
{
	QuickMenu.style.top = document.body.scrollTop + stmnBASE;
	RefreshQuickMenu();

	QuickMenu.style.left = stmnLEFT;

}

function __WS__(id) {
    document.write(id.innerHTML);
    id = "";
}
/***********************************************************
*   Banner Scroll End
***********************************************************/

/***********************************************************
*   ÀÌ¹ÌÁö Å©±â Á¶Á¤
***********************************************************/
	function imgResize(size){ 
	    imgs = document.getElementsByName('picture');
	    for(i=0; i<imgs.length; i++){
	    	if(imgs[i].width>size){
	        	imgs[i].width=size;   
	        } 
	    }
	}

