<!--
var wwwurl = location.host;
document.title="¿Â¶óÀÎ TCG º¸µå°ÔÀÓ";

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_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_swapImgRestore1(no) { //v3.0 ¸ÞÀÎ °øÁÖ¾ÆÀÌÄÜ
  var obj = document.getElementById("chkimg");
  if (obj.value != no) {
    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_swapImgRestore2(no) { //v3.0 ¼¼·Â Á¶¾ðÆäÀÌÁö °øÁÖ ¾ÆÀÌÄÜ
  var obj = document.getElementById("chkRealm");
  if (obj.value != no) {
    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_swapImgRestore3(no) { //v3.0 ¼¼·Â Á¶¾ðÆäÀÌÁö °øÁÖ ¾ÆÀÌÄÜ
  var obj = document.getElementById("selectPrin");
  if (obj.value != no) {
    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_swapImgRestore4(no) { //v3.0 ¼¼·Â Æò°¡ÆäÀÌÁö °øÁÖ ¾ÆÀÌÄÜ
  var obj = document.getElementById("selectJudge");
  if (obj.value != no) {
    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_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 bluring(){ 
	if(event.srcElement.tagName=="A"||event.srcElement.tagName=="IMG") document.body.focus(); 
} 

document.onfocusin=bluring; 

//·Î±×ÀÎ ¾ÈÇßÀ» °æ¿ì...
function NotLogin (refurl) {
  if (confirm('º» ¼­ºñ½º´Â ·Î±×ÀÎ ÇÏ¼Å¾ß ÀÌ¿ëÇÒ ¼ö ÀÖ½À´Ï´Ù. ·Î±×ÀÎ ÇÏ½Ã°Ú½À´Ï±î?')){
     document.location.href="/config/loginform.asp?refurl=" + refurl;
  }
  return;
}

//´ñ±Û 400ÀÚ ÀÌ³»·Î Á¦ÇÑ
function updateChar(length_limit,frm)
{ // alert(seq)
	var comment='';
	comment = eval(frm.comment);
	var frm = document.frm;
	var length = calculate_msglen(comment.value);
	document.getElementById("textlimit").innerHTML = length;
	if (length > length_limit) {
		alert("ÃÖ´ë " + length_limit + "byteÀÌ¹Ç·Î ÃÊ°úµÈ ±ÛÀÚ¼ö´Â ÀÚµ¿À¸·Î »èÁ¦µË´Ï´Ù.");
		comment.value = comment.value.replace(/\r\n$/, "");
		comment.value = assert_msglen(comment.value, length_limit);
	}
}

function calculate_msglen(message)
{
	var nbytes = 0;

	for (i=0; i < message.length; i++) {
		var ch = message.charAt(i);
		if(escape(ch).length > 4) {
			nbytes += 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				nbytes += 1;
			}
		} else if (ch == '<' || ch == '>') {
			nbytes += 4;
		} else {
			nbytes += 1;
		}
	}

	return nbytes;
}

function assert_msglen(message, maximum)
{
	var inc = 0;
	var nbytes = 0;
	var msg = "";
	var msglen = message.length;

	for (i=0; i<msglen; i++) {
		var ch = message.charAt(i);
		if (escape(ch).length > 4) {
			inc = 2;
		} else if (ch == '\n') {
			if (message.charAt(i-1) != '\r') {
				inc = 1;
			}
		} else if (ch == '<' || ch == '>') {
			inc = 4;
		} else {
			inc = 1;
		}
		if ((nbytes + inc) > maximum) {
			break;
		}
		nbytes += inc;
		msg += ch;
	}
	document.getElementById("textlimit").innerHTML = nbytes;
	return msg;
}

//°Ô½ÃÆÇ ±Û¾²±â Ã¼Å©
function BoardWriteCheck(frm){
  if(frm.check.value==1)
	{
		alert('Ã³¸® ÁßÀÔ´Ï´Ù. Àá½Ã¸¸ ±â´Ù·Á ÁÖ¼¼¿ä.');
		frm.subject.focus();
		return false;
	}
	
	if (frm.subject.value.split(" ").join("") == "") 
	{
		alert("Á¦¸ñÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		frm.subject.value="";
		frm.subject.focus();
	}
	else if (frm.contents.value.split(" ").join("") == "") 
	{
		alert("³»¿ëÀ» ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
		if (frm.contents.style.display == "");
		frm.contents.value="";
		frm.contents.focus();
	}
	else 
	{	
		frm.check.value = 1;
		return true;
	}
	return false;
}

//Å«ÀÌ¹ÌÁö ·¹ÀÌ¾î·Î º¸±â
var nowusr = "";
var prevLayer = "";

function div_show(id_name, disp) {
	id=eval(id_name);
    id.style.display=disp;
}
	
function toggleLayer(obj, w , h) {
	var currLayer = "";
		
	if(prevLayer!="" && obj!=prevLayer) {	
		pl=eval(prevLayer);
		pl.style.display="none";
	}
	prevLayer=obj;
			
	currLayer=eval(obj);

	Xpos = window.event.x + document.body.scrollLeft;
 	Ypos = window.event.y + document.body.scrollTop; 

	//alert(document.body.clientWidth + ":" + document.body.clientHeight + " / " + Xpos + ":" + Ypos);
	if((Xpos + w) > document.body.clientWidth)	{
		//alert(Xpos + w + ":" + document.body.clientWidth);
		Xpos = document.body.clientWidth - (w + 20);
		//alert(Xpos);
	}
	if((Ypos + h) > document.body.clientHeight + document.body.scrollTop)	{
		Ypos = document.body.clientHeight + document.body.scrollTop - (h);
	}
   		
 		currLayer.style.left = Xpos;
 		currLayer.style.top = Ypos;
   		
	currLayer.style.display = "" ? 'none' : '';
		
}

function toggleLayer1(obj) {
    currLayer=eval(obj);
   		
	currLayer.style.display = 'block';
		
}
	
function clearLayer(obj) {

	currLayer=eval(obj);
		
	currLayer.style.display = 'none';
		
}		

//Ã¼Å©¹Ú½º ÀüÃ¼¼±ÅÃ, ¼±ÅÃÇØÁ¦
function checkall(formname,checkname,thestate){
	var el_collection=eval("document.forms."+formname+"."+checkname)

	if(el_collection != null)
	{
		if(el_collection.length){
			for (c=0;c<el_collection.length;c++)
				el_collection[c].checked=thestate
		}
		else{
			el_collection.checked=thestate;
		}
	}
}
function chk_selected(f){
	if (f.checked){
		f.parentElement.parentElement.className='tb3';
	}else {
		f.parentElement.parentElement.className='tb10';
	}
}
function change_stat()
{
	if(document.form.allbox.checked == true) {
		document.form.allbox.checked=true;
		checkall('form','CHECKID',true);
	}
	else {
		document.form.allbox.checked=false;
		checkall('form','CHECKID',false);
	}
}
// ¾ÆÀÌÄÜ Å¬¸¯½Ã ¹è°æ º¯°æ
function change_bg(no)
{
    document.body.background = "/img/common/main_bg0" + no + "_100722.jpg"
    var aa = no - 1;
    var obj = document.princess;
        for(var i=0; i<obj.length; i++){
            if(i != aa){
                var imgno = i + 1;
                obj[i].src = "/img/common/main_ch0" + imgno + ".png";
             }
        }
    var chkimg = document.getElementById("chkimg");
    chkimg.value = no;
    document.princess[aa].src = "/img/common/main_ch0" + no + "_on.png";
}

//»õÃ¢¿­±â
function NewWindow(mypage,myname,w,h,scroll){
        var win=null;
		LeftPosition=(screen.width - w) / 2;
		TopPosition=(screen.height - h) / 2;
		settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',menubar=no,resizable=no,status=no,location=no';
		win=window.open(mypage,myname,settings);
		    
	  if(win.focus){win.focus();}
	}
	
//À¥»óÁ¡
function shopWindow(mypage,myname,w,h,scroll){
        var win=null;
		LeftPosition=(screen.width - w) / 2;
		TopPosition=(screen.height - h) / 2;
		
		if(screen.height < 1024){
		    settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars=yes,menubar=no,resizable=no,status=no,location=yes';   
		}else{
		    settings='height='+h+',width='+w+',top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',menubar=no,resizable=no,status=no,location=yes';
		}
		win=window.open(mypage,myname,settings);
		    
	  if(win.focus){win.focus();}
	}
	
//ÂÊÁöº¸³»±â ÆË¾÷
function pop_message(gameid){
    var win=null;
		LeftPosition=(screen.width - 375) / 2;
		TopPosition=(screen.height - 400) / 2;
		settings='height=400,width=375,top='+TopPosition+',left='+LeftPosition+',scrollbars='+scroll+',menubar=no,resizable=no,status=no,location=no';
		win=window.open("/mypage/message/message_pop.asp?receiveid=" + gameid,"message",settings);
		    
	  if(win.focus){win.focus();}
}
//-->