﻿
function ClearBackground(type, idCtrl, pwdCtrl) 
{
	if(type == 'id')
	{
		document.getElementById(idCtrl).value ="";
		document.getElementById(idCtrl).style.background="#cc3d03"; 
	}
	else if(type == 'pwd')
	{
		document.getElementById(pwdCtrl).value ="";
		document.getElementById(pwdCtrl).style.background="#cc3d03"; 
	}
}

function ClearBackgroundImg(type, idCtrl, pwdCtrl) 
{
	if(type == 'id')
	{
		document.getElementById(idCtrl).style.background="#cc3d03"; 
	}
	else if(type == 'pwd')
	{
		document.getElementById(pwdCtrl).style.background="#cc3d03"; 
	}
}

function checkLogin(idCtrl, pwdCtrl, url) 
{
	var id = document.getElementById(idCtrl).value;
	var pwd = document.getElementById(pwdCtrl).value; 
	if(id == "")
	{
		alert("아이디를 입력해 주세요.");
		document.getElementById(idCtrl).focus();
	}
	else if(pwd == "")
	{
		alert("패스워드를 입력해 주세요.");
		document.getElementById(pwdCtrl).focus();
	}
	else
	{
	    if(url.indexOf("www.batoo.com") != -1)
	    {
	        document.forms[0].action = 'https://www.batoo.com/Common/LoginSSL.aspx?idCtrl=' + idCtrl + '&pwdCtrl=' + pwdCtrl + '&retUrl=' + url;
	    }
	    else if(url.indexOf("batoo.tygem.com") != -1)
	    {
			document.forms[0].action = 'https://batoo.tygem.com/Common/LoginSSL.aspx?idCtrl=' + idCtrl + '&pwdCtrl=' + pwdCtrl + '&retUrl=' + url;
	    }
	    else
	    {
	        document.forms[0].action = '../Common/LoginSSL.aspx?idCtrl=' + idCtrl + '&pwdCtrl=' + pwdCtrl + '&retUrl=' + url;
	    }
		
		document.forms[0].submit();
	}
}

function moveLoginPopup(retUrl)
{
	window.open('/MemberShip/LoginPopup.aspx?retUrl=' + retUrl, 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=465,height=340,copyhistory=no');
}

function CheckAll()
{
	if(document.getElementById("chkToggle").checked)
	{
		for (var i=0; i < document.forms[0].elements.length; i++)
		{
			strName = document.forms[0].elements[i].name;
			
			if ( strName.search("RowCheckBox") != -1 )
			{
				document.forms[0].elements[i].checked = true ;
			}
		}
	}
	else
	{
		for (var i=0; i < document.forms[0].elements.length; i++)
		{
			strName = document.forms[0].elements[i].name;
			
			if ( strName.search("RowCheckBox") != -1 )
			{
				document.forms[0].elements[i].checked = false ;
			}
		}
	}	
}

function imgResize(ctrl, maxsize) 
{
	var contents = document.getElementById(ctrl);
	if(contents != null)
	{
	    var img = contents.getElementsByTagName("img"); 
	    for(i=0; i<img.length; i++) 
	    { 
		    if ( img[i].width > maxsize ) 
		    { 
			    var heightSize = (img[i].height * maxsize) / img[i].width ; 
			    img[i].width = maxsize; 
			    img[i].height = heightSize;
		    } 
	    }
	}
} 

function popupResize(ctrl)
{
    window.resizeTo(document.getElementById(ctrl).clientWidth + 10, document.getElementById(ctrl).clientHeight + 80);
}

function unableAllNickNamePopup(tagName)
{
	var regVal = new RegExp("^" + tagName);
	var bodyElement = document.body
	var divElements = bodyElement.getElementsByTagName("div");
	for(i = 0 ; i <  divElements.length ; i++)
	{
		if(regVal.test(divElements[i].id))
		{ 
			divElements[i].style.display = 'none';
		}
	}
}


function unableAllNickNamePopup(tagName)
{
	var regVal = new RegExp("^" + tagName);
	var bodyElement = document.body
	var divElements = bodyElement.getElementsByTagName("div");
	for(i = 0 ; i <  divElements.length ; i++)
	{
		if(regVal.test(divElements[i].id))
		{ 
			divElements[i].style.display = 'none';
		}
	}
}

function NickNameQuickMenu(id, obj)
{
	unableAllNickNamePopup('NickNameQuickMenu_');
	var target ="NickNameQuickMenu_" + id; 
	ShowNickNameQuickMenu(obj, target);
	document.getElementById(target).style.display = "block";
	
}

function ShowNickNameQuickMenu(obj, target)
{
    var vicCal = document.getElementById(target);
	var point = fGetXY(obj);
    with (vicCal.style) 
    {
        width = 190;
        left = point.x + 10 ;
        top  = point.y + 2;
        display = "";
    }
}

function UnableNickNameQuickMenu(id)
{
	var target = "NickNameQuickMenu_" + id;
	document.getElementById(target).style.display = "none";
}

function fGetXY(aTag)
{
	var oTmp = aTag;
	var pt = new Point(0,0);
	do
	{
		pt.x += oTmp.offsetLeft;
		pt.y += oTmp.offsetTop;
		oTmp = oTmp.offsetParent;
	}
	while
	(oTmp.tagName != "BODY");
	return pt;
}

function Point(iX, iY)
{
	this.x = iX;
	this.y = iY;
}

function GetLockerRoomUrl(nickname)
{
	if(nickname != '' && nickname != null)
	{
		AjaxService.GetLockerRoomUrl(nickname, GetLockerRoomUrl_CallBack);
	}
}

function GetLockerRoomUrl_CallBack(response)
{
	if(response == '')
	{
		alert('락커룸이 존재하지 않는 회원입니다.');
	}
	else
	{
		window.open(response);
	}
}

function GetMyLockerRoomUrl(nickname)
{
	if(nickname != '' && nickname != null)
	{
		AjaxService.GetLockerRoomUrl(nickname, GetMyLockerRoomUrl_CallBack);
	}
}

function GetMyLockerRoomUrl_CallBack(response)
{
	if(response == '')
	{
		if(confirm('락커룸이 존재하지 않는 회원입니다.\n락커룸을 생성하시겠습니까?'))
		{
			CreateLockerRoom();
		}
	}
	else
	{
		location.href = response;
	}
}


function sendMessagePopup(nickname)
{
	window.open('../Message/MessageSend.aspx?nickname=' + nickname, 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=666,height=526,copyhistory=no');
}

function memberGameDetailInfoPopup(nickname)
{
	window.open('../Common/MemberGameDetailInfo.aspx?nickname=' + escape(nickname), 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=510,copyhistory=no');
}

function messagePopup(type)
{
	window.open('../Message/MessageList.aspx?Type='+type, 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=666,height=526,copyhistory=no');
}


function reChargePopup()
{
	window.open('../HomeMain/CoinChargePopup.aspx', 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=450,height=355,copyhistory=no');
}

function CheckSearchTextValid(ctrl)
{
	if(document.getElementById(ctrl).value.length <= 1)
	{
		alert('검색어는 2글자 이상이어야 합니다.');
		document.getElementById(ctrl).focus();
		return false;
	}
	else
	{
		return true;
	}
}

function PopupNotice()
{
    var option  = "location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,width=450,height=330";
	window.open("../LockerRoomZone/NoticeListPopup.aspx","",option);
}

<!-- 글자수 체크 -->
function SizeOfString(Str)
{
	var Add = 0;
	for (i=0; i<Str.length; i++) 
	{
		if( (Str.charCodeAt(i) < 0) || (Str.charCodeAt(i) > 127) ) 
		{
			Add = Add+1;
		}
	}
	return (Str.length + Add);
}

function SetCheckSize(theControl) 
{	
	strSize = SizeOfString(theControl.value);
	if(strSize > length_limit)
	{
		alert("최대 " + length_limit + "byte이므로 초과된 글자수는 자동으로 삭제됩니다.");
        theControl.value = theControl.value.replace(/\r\n$/, "");
        theControl.value = assert_msglen(theControl.value, length_limit);
        strSize = SizeOfString(theControl.value);
        
        if(strSize > length_limit)	
        {
			spanContentSize.style.color	= "#FF0000";
		}	
	}
	else 
	{
		spanContentSize.style.color		= "#333333";
	}
	
	strSize += " byte";
	spanContentSize.innerHTML = strSize;
}


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;
      }
	return msg;
}


function CreateLockerRoom()
{
    var option  = "location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,width=595,height=475";
    window.open("../LockerRoom/LockerRoomCreation.aspx","",option);
}

function checkValidString(type, value)
{
	var valid = "";
	
	switch(type)
	{
		case 1 : //영문
			valid = "abcdefghijklmnopqrstuvwxyz";
			break;
		case 2 : //숫자
			valid = "0123456789";
			break;
		case 3 : //영문 + 숫자
			valid = "abcdefghijklmnopqrstuvwxyz0123456789";
			break;
		case 4 : // 특수문자
			valid = "~!@#$%^&*()_+|`;'<>?/.,-=\\[]";
			break;
		default :
			return false;
			break;
	}
	var temp;
	value = value.toLowerCase();
	for (var i = 0; i < value.length; i++) 
	{
		temp = value.substring(i, i+1);
		if (valid.indexOf(temp) == "-1") 
		{
			return false;
		}
	}
	return true;
}

function checkValidNicName(value)
{
    var valid = "☆★○●◎◇◆□■△▲▽▼☎★™♡→←↑↓↔〓≪≫√∽∝∵∫∬∈∋⊆⊇⊂⊃∪∩∧∨￢~!@#$%^&*()_+|`;'<>?/.,-=\\[]、。·‥…¨〃―∥＼∼“”〔〕〈〉《》「」『』【】±×÷≠≥≤∞∴°′″Å￠￡￥♂♀∠⊥⌒∂∇≡≒§※~!@#$%^&*()_+|`;'<>?/.,-=\\[]☜☞♀♂♠♡♣♤♥♧♨♩♪♬♭γ☞凸ⓣㆀı˘カント®†▒ ┛┏ ∏™ㅜのんし乙よあнø、¿さなえ㉭Й∇￣■";
	
    var temp;
    value = value.toLowerCase();
    for (var i = 0; i < value.length; i++) 
    {
	    temp = value.substring(i, i+1);
	    if (valid.indexOf(temp) != -1) 
	    {
		    return false;
	    }
    }
    return true;
}

function GoLockerRoom(url)
{
   location.href = url;
}

function viewLevelTest()
{
    window.open('../HomeMain/LevelTestPopup.aspx', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=720,height=600,copyhistory=no');
}

function tbtn()
{
    var a=document.documentElement.scrollTop+430;
    if(a<=document.getElementById("TC").clientHeight-430)
    {
        document.getElementById("bar").style.top = a;
    }
}

function setBatooCookie( cookieName, cookieValue, expireDate )
{
  var today = new Date();
  today.setDate( today.getDate() + parseInt( expireDate ) );
  document.cookie = cookieName + "=" + escape( cookieValue ) + "; path=/; expires=" + today.toGMTString() + ";";
}

function getBatooCookie( cookieName )
{
    var search = cookieName + "=";
    var cookie = document.cookie;

    if( cookie.length > 0 )
    {

        startIndex = cookie.indexOf( cookieName );

        if( startIndex != -1 )
        {

            startIndex += cookieName.length;

            endIndex = cookie.indexOf( ";", startIndex );

            if( endIndex == -1) endIndex = cookie.length;


            return unescape( cookie.substring( startIndex + 1, endIndex ) );
        }
        else
        {

            return false;
        }
    }
    else
    {
           
            return false;
    }
}

function deleteCookie( cookieName )
{
  var expireDate = new Date();
  
  expireDate.setDate( expireDate.getDate() - 1 );
  document.cookie = cookieName + "= " + "; expires=" + expireDate.toGMTString() + "; path=/";
}


function bindID()
{
	if(document.getElementById("txtHomeId") != null)
	{
		var id_save = getBatooCookie('id_save');
		var memberid = getBatooCookie('memberid');
		if(id_save == "on" && memberid != "")
		{
			ClearBackground('id','txtHomeId','');
			document.getElementById("txtHomeId").value = memberid;
			document.getElementById("txtHomeId").onfocus = null;
			if(document.getElementById("id_save") != null)
			{
			    document.getElementById("id_save").checked = true;
			}
		}
		
		if(document.getElementById("txtHomeId").value != '')
		{
			ClearBackgroundImg('id','txtHomeId','');
		}
	}
}

function bindMemberShipID()
{
	if(document.getElementById("txtHomeId") != null)
	{
		var id_save = getBatooCookie('id_save');
		var memberid = getBatooCookie('memberid');
		if(id_save == "on" && memberid != "")
		{
			document.getElementById("txtHomeId").style.background="#fff"; 
			document.getElementById("txtHomeId").value = memberid;
			document.getElementById("txtHomeId").onfocus = null;
			document.getElementById("id_save").checked = true;
		}
		
		if(document.getElementById("txtHomeId").value != '')
		{
			document.getElementById("txtHomeId").style.background="#fff"; 
		}
	}
}

function setId_Save()
{
	var chk = document.getElementById("id_save").checked;
	var memberid = document.getElementById("txtHomeId").value;
	if(chk && memberid != "")
	{
		setBatooCookie("id_save", "on", 1000 );
		setBatooCookie("memberid", memberid, 1000 );
	}
	else
	{
		deleteCookie("id_save");
		deleteCookie("memberid");
	}
}

function bindNateID()
{
	if(document.getElementById("txtMemberID") != null && document.getElementById("selEmailDomain") != null)
	{
		var id_save = getBatooCookie('nateId_save');
		var memberid = getBatooCookie('memberid');
		var domain = getBatooCookie('domain');
		if(id_save == "on" && memberid != "" && domain != "")
		{
			ClearBackground('id','txtMemberID','');
			
			document.getElementById("txtMemberID").value = memberid;
			document.getElementById("txtMemberID").onfocus = null;
			
			document.getElementById("selEmailDomain").value = domain;
			document.getElementById("selEmailDomain").onfocus = null;
			
			if(document.getElementById("nateId_save") != null)
			{
			    document.getElementById("nateId_save").checked = true;
			}
		}
		
		if(document.getElementById("txtMemberID").value != '')
		{
			ClearBackgroundImg('id','txtMemberID','');
		}
	}
}


function setNateId_Save()
{
	var chk = document.getElementById("nateId_save").checked;
	var memberid = document.getElementById("txtMemberID").value;
	var domain = document.getElementById("selEmailDomain").value;
	if(chk && memberid != "")
	{
		setBatooCookie("nateId_save", "on", 1000 );
		setBatooCookie("memberid", memberid, 1000 );
		setBatooCookie("domain", domain, 1000 );
	}
	else
	{
		deleteCookie("nateId_save");
		deleteCookie("memberid");
		deleteCookie("domain");
	}
}


function bindDanalID()
{
	if(document.getElementById("txtMemberID") != null)
	{
		var id_save = getBatooCookie('danalId_save');
		var memberid = getBatooCookie('memberid');
		if(id_save == "on" && memberid != "")
		{
			ClearBackground('id','txtMemberID','');
			document.getElementById("txtMemberID").value = memberid;
			document.getElementById("txtMemberID").onfocus = null;
			if(document.getElementById("danalId_save") != null)
			{
			    document.getElementById("danalId_save").checked = true;
			}
		}
		
		if(document.getElementById("txtMemberID").value != '')
		{
			ClearBackgroundImg('id','txtMemberID','');
		}
	}
}

function setDanalId_Save()
{
	var chk = document.getElementById("danalId_save").checked;
	var memberid = document.getElementById("txtMemberID").value;
	if(chk && memberid != "")
	{
		setBatooCookie("danalId_save", "on", 1000 );
		setBatooCookie("memberid", memberid, 1000 );
	}
	else
	{
		deleteCookie("danalId_save");
		deleteCookie("memberid");
	}
}



//투니버스
function bindTooniverseID()
{
	if(document.getElementById("txtMemberID") != null)
	{
		var id_save = getBatooCookie('tooniverseId_save');
		var memberid = getBatooCookie('memberid');
		if(id_save == "on" && memberid != "")
		{
			ClearBackground('id','txtMemberID','');
			document.getElementById("txtMemberID").value = memberid;
			document.getElementById("txtMemberID").onfocus = null;
			if(document.getElementById("tooniverseId_save") != null)
			{
			    document.getElementById("tooniverseId_save").checked = true;
			}
		}
		
		if(document.getElementById("txtMemberID").value != '')
		{
			ClearBackgroundImg('id','txtMemberID','');
		}
	}
}

function setTooniverseId_Save()
{
	var chk = document.getElementById("tooniverseId_save").checked;
	var memberid = document.getElementById("txtMemberID").value;
	if(chk && memberid != "")
	{
		setBatooCookie("tooniverseId_save", "on", 1000 );
		setBatooCookie("memberid", memberid, 1000 );
	}
	else
	{
		deleteCookie("tooniverseId_save");
		deleteCookie("memberid");
	}
}

function GoTooniverseLogin()
{
	if(document.getElementById('txtMemberID').value == null || document.getElementById('txtMemberID').value == "")
	{
		alert('아이디를 입력해 주세요.');
		document.getElementById('txtMemberID').select();
	}
	else if(document.getElementById('txtPassword').value == null || document.getElementById('txtPassword').value == "")
	{
		alert('비밀번호를 입력해 주세요.');
		document.getElementById('txtPassword').select();
	}
	else
	{
		document.forms['gc_login'].gc_id.value = document.getElementById('txtMemberID').value;
		document.forms['gc_login'].gc_pwd.value = document.getElementById('txtPassword').value;
		document.forms['gc_login'].gc_gid.value = "batoo";

		 gc_goLogin();
    }
}




function ib_tab(type)
{	
	if( type=="ib_all")
	{
		document.getElementById("ib_o18").style.display ="none";
		document.getElementById("ib_all").style.display ="block";
	} else if (type=="ib_o18")		{
		document.getElementById("ib_all").style.display ="none";	
		document.getElementById("ib_o18").style.display ="block";
		
	}
}

function ib_tab_nhn (type,state)
{	
	var st;
	if (state=="main")
	{
			st="http://image.batoo.com/img/main/";
	} else if (state=="customer")
	{
		st="../img/customer/";
	} else {
		//
	}
	if( type=="ib_all")
	{
		document.getElementById("ib_o18").style.display ="none";
		document.getElementById("ib_all").style.display ="block";
		document.getElementById("f_grade_"+state).src=st+"class_grade_u18.gif";
	} else if (type=="ib_o18")		{
		document.getElementById("ib_all").style.display ="none";	
		document.getElementById("ib_o18").style.display ="block";
		document.getElementById("f_grade_"+state).src=st+"class_grade_o18.gif";
		
	}
}
function tab_on(type)
{	
	var i;
	for (i=1;i  <= 3 ; i++ )
	{
		document.getElementById("mbox_tab0"+i).src = "http://image.batoo.com/IMG/main/mbox_tab0"+i+"__off.gif";
		document.getElementById("t_cont0"+i).style.display ="none";
		document.getElementById("t_type_"+i).style.display ="none";
	}
	document.getElementById("mbox_tab0"+type).src = "http://image.batoo.com/IMG/main/mbox_tab0"+type+"__on.gif";
	document.getElementById("t_cont0"+type).style.display ="block";
	document.getElementById("t_type_"+type).style.display ="block";
}

function GoTutorial()
{
    var option  = "location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,width=696,height=648";
    window.open("../Tutorial/Tutorial.aspx","",option);  
}

function GoGuideView()
{
    window.open('../Guide/BatooGuidMain.html', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=746,height=696,copyhistory=no');
}


function GoUserAggrement()
{
    window.open('../MemberShip/AgreementPolicy.htm', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=610,copyhistory=no');
}

function GoAdminPolicy()
{
    window.open('../MemberShip/AdminPolicy.htm', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=610,copyhistory=no');
}

function GoInfoSafe()
{
    window.open('../MemberShip/InfoSafePolicy.htm', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=610,copyhistory=no');
}

function GoJoinInfoSafe()
{
    window.open('../MemberShip/InfoSafePolicy_join.htm', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=610,copyhistory=no');
}

function GoSuplyAggrement()
{
    window.open('../MemberShip/AgreementInfoSupply.htm', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=610,copyhistory=no');
}

function GoYahooSuplyAggrement()
{
    window.open('../MemberShip/YahooAgreementInfoSupply.htm', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=600,height=610,copyhistory=no');
}


function clear_textarea(type) 
{
	
    document.getElementById(type).style.background ="#fff";
		
}

   
function changeNickNamePopup()
{
    var option  = "location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,width=520,height=370";
    window.open("../HomeMain/NickNameChangePopup.aspx","GET",option);
}

function popupHundredDayOpenEvent()
{
    var option  = "location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,scrollbars=yes,width=840,height=800";
    window.open("../Event/HundredDayOpenEvent.aspx","GET",option);
}

function ViewMainImg(img)
{
	var imginfo = new Image();
	imginfo.src = img;
	var width = imginfo.width;
	var height = imginfo.height;
	window.open("../LockerRoom/MainImagePopup.aspx?url=" + img, 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=yes,resizable=no,width='+(width)+',height='+(height)+',copyhistory=no');
}

function SetClipBoardData(format, data, message)
{
     window.clipboardData.setData(format, data); 
     
     alert(message);
}

function GoLockerRoomPopup(path, url)
{
    var option  = "";
	window.open(path+url,"",option);
}

function moveBatooTVPopup()
{
	window.open('../Popup/BatooTVPopup.aspx', 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=556,height=672,copyhistory=no');
}

function GoHangameLogin()
{
    document.forms['loginform'].strmemberid.value = document.getElementById('txtMemberID').value;
    document.forms['loginform'].strpassword.value = document.getElementById('txtPassword').value;
    document.forms['loginform'].ssl.checked = document.getElementById('securedLogin').checked;
    goHangameLogin(document.forms['loginform']);
}

function GoNateLogin(url)
{
    window.open('http://xo.nate.com/popuplogin.jsp?pop=direct&redirect=http://batoo.game.nate.com/cooperate/NateLoginGateway.aspx?redirect=' + url, 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=314,copyhistory=no');
}


function PopupOpen(url, option)
{
	window.open(url, "", option);
}

function popupCupon()
{
    window.open('../Event/CuponEvent.aspx', '', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,top=400,left=650,width=450,height=276,copyhistory=no');
}

function GoRegChannelMember(url)
{
    if(confirm('바투 게임 및 글쓰기를 하기 위해서는 회원 정보 제공 동의 및 닉네임 입력이 필요 합니다. \n회원 정보 제공 동의 및 닉네임 입력 페이지로 이동하시겠습니까? '))
    {
         location.href = url;
    }
}

function CheckGoLogIn(retUrl)
{
    if(confirm('로그인이 필요합니다. \n로그인 페이지로 이동하시겠습니까? '))
    {
        location.href = "../MemberShip/Login.aspx?retUrl=" + retUrl;
    }
}


//전환가입 공용 Message
function RedirRegChannelMember(url)
{
    if(confirm('회원 정보 제공 동의 및 바투게임 전환가입 페이지로 이동하시겠습니까?'))
    {
         location.href = url;
    }
}

function GoDanalOpen(url)
{
    window.open(url,'','width=503,height=200');
}

function popOpen(url, width, height)
{
    window.open(url, "", "location=no,directories=no,resizable=no,status=no,toolbar=no,menubar=no,scrollbars=no,width="+ width +",height="+ height);
}


function PlayerLiveView(broadcastUrl, width, height)
{
      document.write ('<OBJECT ID="WMPlay" WIDTH=\"'+ width +'\" HEIGHT=\"'+ height +'\" classid= "clsid:22D6F312-B0F6-11D0-94AB-0080C74C7E95" CODEBASE="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab" standby="Loading Microsoft?Windows? Media Player components..." type="application/x-oleobject"> <param name="Filename" value=\"'+ broadcastUrl +'\"> <param name="ShowControls" value="1"> <param name="ShowPositionControls" value="0"> <param name="AutoStart" value="1"> <param name="EnableContextMenu" value="0"> <embed type="application/x-mplayer2"> </OBJECT>')
}

function play_embed(id, width, height)
{
    document.write('<EMBED src="'+ id +'" type="application/x-shockwave-flash" width="'+ width +'" height="'+ height +'" scale="exactfit" wmode="transparent" menu="0">');
}

//오프라인 대진팝업
function OpenOffLineMatchList()
{
    window.open('http://www.batooleague.com/Popup/OfflineMatches.aspx', 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=971,height=820,copyhistory=no');
}

function FlashGoPage(url,type,idx)
{
    if(type == 'link')
    {
        window.location.href = url;
    }
    else if(type == 'win')
    {
        window.open(url);
    }
}

function FlashGoPage(url,type)
{
    if(type == 'link')
    {
        window.location.href = url;
    }
    else if(type == 'win')
    {
        window.open(url);
    }
}

function PrepareMsg()
{
    alert("준비중 입니다.");
}



function onkeydownComment()
{    
    if (!e) var e = window.event;

    if (document.all) var key = e.keyCode; 
    else var key = e.which;
    
   if( key == 13 ) {
        return false;
    }        
}


//레벨토너먼트 오픈 팝업
function jsTournamentOpen(tno)
{
    window.open('../tournament/pop_tournament.aspx?tno='+tno, 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=400,height=287,copyhistory=no');
}

//동영상 뷰어 팝업
function popupShowMedia(mno, bno)
{
    window.open('../Popup/MediaViewPopup.aspx?mno='+mno+'&bno='+bno, 'POST', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=950,height=700,copyhistory=no');
}

function NotifyWebBlock()
{
    alert("회원님은 바투 서비스 이용 중 블럭 처리 되어 글 작성 및 댓글 쓰기가 제한 됩니다.");
}

function PlaypleOpen()
{
    window.open('http://www.playple.com/media/liveViewer.do?cmd=countBroad&broadId=2843', 'GET', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=640,height=480,copyhistory=no');
}

function OnstyleOpen()
{
    window.open("http://www.onstylei.com/guest/noticeView.sty?noticeIndex=701","","");
}