﻿/***** DEFAULT CONST SETTING *****/

// NOW POSITION SITE

var nowSiteCode;
var nowLocation = location.href;
var arrLocation = nowLocation.toLowerCase().split("/");
var nowSiteDomain = arrLocation[2].substring(arrLocation[2].indexOf("."), arrLocation[2].length);


if (arrLocation[2].indexOf("pristontale") != -1) {
	nowSiteCode = 1;
} else if (arrLocation[2].indexOf("clubaudition") != -1) {
	nowSiteCode = 2;
} else if (arrLocation[2].indexOf("pt2") != -1) {
	nowSiteCode = 3;
} else if (arrLocation[2].indexOf("aceonline") != -1) {
	nowSiteCode = 4;
} else if (arrLocation[2].indexOf("laxe") != -1) {
	nowSiteCode = 5;
} else if (arrLocation[2].indexOf("paeonline") != -1) {
	nowSiteCode = 7;
} else if (arrLocation[2].indexOf("ptw") != -1) {
	nowSiteCode = 8;
} else if (arrLocation[2].indexOf("bandmaster") != -1) {
	nowSiteCode = 9;
} else if (arrLocation[2].indexOf("audition2") != -1) {
	nowSiteCode = 11;
} else if (arrLocation[2].indexOf("maestia") != -1) {
	nowSiteCode = 13;
}else {
	nowSiteCode = 0;
}


// FAMILY DOMAIN URL
var domainStatic;
var GnbCss;
if (location.href.indexOf('http://') == 0) {
	domainStatic      = "http://static.ndolfin.com";
	domainStaticImg      = "http://ndolfin.web.ydonline.gscdn.com/static/201012";
	GnbCss            = "gnb.css";
} else {
	domainStatic      = "https://static.ndolfin.com";
	domainStaticImg      = "https://static.ndolfin.com/201012";
	GnbCss            = "gnb.css";
}


var domainWww, domainMembership, domainPayment, domainCscenter, domainPcbang;
var domainPristontale, domainPt2, domainPtw, domainAceonline;
var domainClubaudition, domainBandMaster, domainPaeOnline, domainCompany, domainEtc, domainAudition2;
var domainShotonline, domainXenepic;
	

if (location.href.indexOf('localhost') != -1 ) {
  domainWww         = "http://localhost:8000";
  domainMembership  = "http://localhost:8080";
}
else if (location.href.indexOf('dev') != -1) {
	domainStatic      = "http://static.ndolfin.com";
	domainWww         = "http://www.ndolfin.com";
	domainMembership  = "http://members.ndolfin.com";
	domainPayment	  =  "http://sev.payment.ndolfin.com";
	domainCscenter    = "http://dev.cscenter.ndolfin.com";
	domainPcbang	 = "http://pcbang.ndolfin.com";
	domainPristontale = "http://dev.pristontale.ndolfin.com";
	domainPt2         = "http://dev.pt2.ndolfin.com";
	domainPtw         = "http://dev.ptw.ndolfin.com";
	domainAceonline   = "http://dev.aceonline.ndolfin.com";
	domainClubaudition= "http://dev.clubaudition.ndolfin.com";
	domainBandMaster  = "http://dev.bandmaster.ndolfin.com";
	domainPaeOnline   = "http://dev.paeonline.ndolfin.com";
	domainCompany     = "http://dev.www.ydonline.co.kr";
	domainEtc 	  = "http://etc.ndolfin.com";
	domainAudition2   = "http://audition2.ndolfin.com";
	domainShotonline  = "http://shotonline.ndolfin.com";
	domainMaestia     = "http://maestia.ndolfin.com";
	domainXenepic     = "http://xenepic.ndolfin.com";
}
else
{
	domainWww         = "http://www.ndolfin.com";
	domainMembership  = "https://members.ndolfin.com";
	domainPayment	  = "https://payment.ndolfin.com";
	domainCscenter    = "http://cscenter.ndolfin.com";
	domainPcbang	 = "http://pcbang.ndolfin.com";	
	domainPristontale = "http://pristontale.ndolfin.com";
	domainPt2         = "http://pt2.ndolfin.com";
	domainPtw         = "http://ptw.ndolfin.com";
	domainAceonline   = "http://aceonline.ndolfin.com";
	domainClubaudition= "http://clubaudition.ndolfin.com";
	domainBandMaster  = "http://bandmaster.ndolfin.com";
	domainPaeOnline   = "http://paeonline.ndolfin.com";
	domainCompany     = "http://www.ydonline.co.kr";
	domainEtc 	  = "http://etc.ndolfin.com";
	domainAudition2   = "http://audition2.ndolfin.com";
	domainShotonline  = "http://shotonline.ndolfin.com";
	domainMaestia     = "http://maestia.ndolfin.com";
	domainXenepic     = "http://xenepic.ndolfin.com";
}



// FAMILY COMMON URL
var nDolfinLoginAct   = domainMembership +"/Common/Lib/sso.aspx";

var nDolfinLoginUrl = '';
/*
var retUrl = document.URL.substring(document.URL.indexOf('?url='), document.URL.length);
if(retUrl != '')	nDolfinLoginUrl   = domainMembership +"/Common/Lib/Login.aspx?url="+ retUrl;
else			nDolfinLoginUrl   = domainMembership +"/Common/Lib/Login.aspx?url="+ document.URL;
*/
var nDolfinLoginUrl   = domainMembership +"/Common/Lib/Login.aspx?url="+ escape(document.URL);
var nDolfinLogoutUrl  = domainMembership +"/Common/Lib/Logout.aspx?SiteCode="+ nowSiteCode;
var nDolfinJoinUrl    = domainMembership +"/Regist/AccountTypeSelect.aspx?SiteCode="+ nowSiteCode;
var nDolfinFindPWUrl  = domainMembership +"/Mypage/FindUserID/UserIDFind.aspx";
var nDolfinMyPageUrl  = domainMembership +"/Mypage/ChangeAccount/AccountChange.aspx";
var nDolfinCSdesc     = domainCscenter +"/csdesc/";
var nDolfinPolicy     = domainCscenter +"/policy/";
var nDolfinConsult    = domainCscenter +"/consult/";
var nDolfinAccuse     = domainCscenter +"/accuse/?seType=badUser";
var nDolfinMyQAList   = domainCscenter +"/consult/mylist.asp";


// FAMILY COMMON MASSAGE
var cmnDolfinTitle = "Let`s Play YD Online";
var cmMassageInput = function(str) { return str +"를 입력하세요"; }
var cmMassagePopup = "차단된 팝업창을 허용해 주세요";
var cmMassageIncIDPW = "아이디 또는 비밀번호 형식이 잘못되었습니다";


document.writeln("<link rel='icon' href=http://static.ndolfin.com/201012/images/Favicon/favicon.ico' type='image/x-icon' />");
document.writeln("<link rel='shortcut icon' href='http://static.ndolfin.com/201012/images/Favicon/favicon.ico' type='image/x-icon' />");

/* FAMILY COMMON FUNCTION */
var GNBWidth;
var GNBAlign;
var GNBGameCode;

var FooterGameCode;

var nDolfin = {
    	Footer: function(gGameCode){
        	gGameCode ? FooterGameCode = gGameCode : FooterGameCode = 0;
		var pszProto = (("https:" == document.location.protocol) ? "https://" : "http://");
		document.write(unescape("%3Cscript src='" + pszProto + "static.ndolfin.com/js/WebLog/wlo.js' type='text/javascript'%3E%3C/script%3E"));

        	document.writeln("<scr" + "ipt type='text/javascript' language='javascript' src='" + domainStatic + "/js/Footer.js'></scr" + "ipt>");
    	},
    	Footer2: function(gGameCode){
        	gGameCode ? FooterGameCode = gGameCode : FooterGameCode = 0;
		var pszProto = (("https:" == document.location.protocol) ? "https://" : "http://");
		document.write(unescape("%3Cscript src='" + pszProto + "static.ndolfin.com/js/WebLog/wlo.js' type='text/javascript'%3E%3C/script%3E"));

        	document.writeln("<scr" + "ipt type='text/javascript' language='javascript' src='" + domainStatic + "/js/Memer_Footer.js'></scr" + "ipt>");
    	},
	Footer3: function(gGameCode){
        	gGameCode ? FooterGameCode = gGameCode : FooterGameCode = 0;
		var pszProto = (("https:" == document.location.protocol) ? "https://" : "http://");
		document.write(unescape("%3Cscript src='" + pszProto + "static.ndolfin.com/js/WebLog/wlo.js' type='text/javascript'%3E%3C/script%3E"));

        	document.writeln("<script type='text/javascript' language='javascript' src='" + domainStatic + "/js/Footer_New.js'></script>");
    	},
	GNB: function(gWidth, gAlign, gGameCode) {
		gWidth ? GNBWidth = gWidth : GNBWidth = "100%";
		gAlign ? GNBAlign = gAlign : GNBAlign = "center";
	        gGameCode ? GNBGameCode = gGameCode : GNBGameCode = 0;

		document.writeln("<scr"+"ipt type='text/javascript' language='javascript' src='"+ domainStatic +"/js/gnbXml.asp'></scr"+"ipt>");
		document.writeln("<scr"+"ipt type='text/javascript' language='javascript' src='"+ domainStatic +"/js/gnb.js'></scr"+"ipt>");

		// 20102019 이강원
		// 이벤트 기간 지난 후 제거.
		//f_isLogin();
	},
	Kdfense: function() {
		document.write("<script type='text/javascript' src='http://aspglobal.ahnlab.com/aos/plugin/aosmgr_common.js'></script>");
		document.writeln("<scr"+"ipt type='text/javascript' language='javascript' src='"+ domainStatic +"/js/kdfense.js'></scr"+"ipt>");
		//document.writeln("<scr"+"ipt type='text/javascript' language='javascript' src='"+ domainStatic +"/js/kdfense.js'></scr"+"ipt>");
	},
	f_ExecAos: function(f){
		var aosSet = 'aos=1';
		var expireDate = new Date();
		expireDate.setDate(expireDate.getDate());

		if(f.aosCheck.checked){
			document.cookie = aosSet +  "; domain=ndolfin.com";	     

			document.location.reload();
		}
		else{
			//var expireDate = new Date();
			//expireDate.setDate(expireDate.getDate()-1);
			//document.cookie = 'aos' + "=" + "; expires=" + expireDate.toGMTString() + "; path=/";	     
			f.aosCheck.checked = true;
			//f.aosCheck.disabled = false;
			alert('보안 설정을 해제하시기 위해서는\n\n인터넷 브라우져 창을 모두 닫고 다시 접속해 주시기 바랍니다.');
		}

		if(document.cookie.indexOf('aos=1') >= 0)
		{
			// checkbox uncheck.

		}

		
	},
	Login: function(f, fic, fpc, fm) {
		try{
		!fic ? fic = f.FSWebID : null;
		!fpc ? fpc = f.FSWebPW : null;
		!fm ? fm = f : fm = fm;

		var fID = f.FSWebID.value.replace(/\s/g, '');
		var fPW = f.FSWebPW.value.replace(/\s/g, '');
		if(fID.length == 0) {
			alert(cmMassageInput("아이디"));
			fic.focus();
		} else if(fPW.length == 0) {
			alert(cmMassageInput("비밀번호"));
			fpc.focus();
		} else {

			f.RetUrl.value = document.URL;
			f.SiteCode.value = nowSiteCode;

		        if(!fm.aosCheck.checked){			
	            		nDolfinLogon2(f);
		        }
			else{
				nDolfinLogon(f);
			}
		}
		}
		catch(err){
		!fic ? fic = f.FSWebID : null;
		!fpc ? fpc = f.FSWebPW : null;
		var fID = f.FSWebID.value.replace(/\s/g, '');
		var fPW = f.FSWebPW.value.replace(/\s/g, '');
		if(fID.length == 0) {
			alert(cmMassageInput("아이디"));
			fic.focus();
		} else if(fPW.length == 0) {
			alert(cmMassageInput("비밀번호"));
			fpc.focus();
		} else {
			f.RetUrl.value = document.URL;
			f.SiteCode.value = nowSiteCode;
			nDolfinLogon(f);
		}			
		}
		
	},
	Button: function(bType) {
		switch (bType) {
		case "Login" :
			this.goLocation(nDolfinLoginUrl);
			break;
		case "Logout" :
			this.goLocation(nDolfinLogoutUrl);
			break;
		case "Join" :
			this.goLocation(nDolfinJoinUrl);
			break;
		case "FindPW" :
			this.goLocation(nDolfinFindPWUrl);
			break;
		case "Coupon" :
			var couponParams = "left="+ centerWinPoz('left', 500) +",top="+ centerWinPoz('top', 600) +",width=500,height=600,resizable=no,menubar=no,status=no";
			switch (nowSiteCode) {
			case 2: // audition
				couponUrl = domainPayment +"/clubaudition/coupon/couponmenu.np";
				break;
			default:
				couponUrl = "";
				break;
			}
			if (couponUrl == "") { break; }
			
			var couponWindow = window.open(couponUrl, "payWindow", couponParams);
				couponWindow ? couponWindow.focus() : alert(cmMassagePopup);
			break;
		case "Payment" :
			var payParams = "left="+ centerWinPoz('left', 500) +",top="+ centerWinPoz('top', 600) +",width=500,height=600,resizable=no,menubar=no,status=no";
			switch (nowSiteCode) {
			case 0: // nDolfin
				payUrl = domainPayment;
				break;
			case 2: // audition
				payUrl = domainPayment +"/clubaudition/";
				break;
			case 3: // pt2
				payUrl = domainPayment +"/pt2/";
				break;
			case 4: // aceonline
				payUrl = domainPayment +"/aceonline/";
				break;
                        case 9: // Bandmaster
                                payUrl = domainPayment +"/bandmaster/index.asp";
				payParams = "left="+ centerWinPoz('left', 460) +",top="+ centerWinPoz('top', 560) +",width=460,height=560,resizable=no,menubar=no,status=no";
				break; 
			default:
				payUrl = "";
				break;
			}
			if (payUrl == "") { break; }
			
			var payWindow = window.open(payUrl, "payWindow", payParams);
				payWindow ? payWindow.focus() : alert(cmMassagePopup);
			break;
		case "Refund" :
			var refundParams = "left="+ centerWinPoz('left', 500) +",top="+ centerWinPoz('top', 600) +",width=500,height=600,resizable=no,menubar=no,status=no,scrollbars=yes";
			switch (nowSiteCode) {
			case 0: // nDolfin
//				payUrl = domainPayment;
				break;
			case 3: // pt2
				payUrl = domainPayment +"/pt2/Refund/";
				break;
			case 9: // bandmaster
				payUrl = domainPayment +"/bandmaster/Refund/index.np";
				refundParams = "left="+ centerWinPoz('left', 480) +",top="+ centerWinPoz('top', 600) +",width=480,height=600,resizable=no,menubar=no,status=no,scrollbars=yes";
				break;
			default:
				payUrl = "";
				break;
			}
			if (payUrl == "") { break; }

			var refundWindow = window.open(payUrl, "refundWindow", refundParams);
				refundWindow ? refundWindow.focus() : alert(cmMassagePopup);
			break;
		case "MyPage" :
		        var userSignVal = getnDolfinCookie("YDSign");
		        var userSignKey = getnDolfinCookie("YDKey");
			if (userSignVal.length > 0 && userSignKey.length > 0) {
				this.goLocation(nDolfinMyPageUrl);
			}
			else{
				if(confirm('로그인이 필요한 서비스입니다. 로그인 하시겠습니까?')){
					this.goLocation(domainMembership +"/Common/Lib/Login.aspx?url=" + escape(nDolfinMyPageUrl))
				}
			
			}
			break;
		case "CSCenter" :
			this.goLocation(domainCscenter);
			break;
		case "CSdesc" :
			this.goLocation(nDolfinCSdesc);
			break;
		// GAME FAQ
		case "FAQ" :
			switch (nowSiteCode) {
			case 1: // pristontale
				this.goLocation(domainCscenter +"/faq/?cate=5");
				break;
			case 2: // audition
				this.goLocation(domainCscenter +"/faq/?cate=10");
				break;
			case 3: // pt2
				this.goLocation(domainCscenter +"/faq/?cate=6");
				break;
			case 4: // aceonline
				this.goLocation(domainCscenter +"/faq/?cate=9");
				break;
			case 5: // laxe
//				this.goLocation();
				break;
			case 7: // paeonline
				this.goLocation(domainCscenter +"/faq/?cate=8");
				break;
			case 8: // ptw
				this.goLocation(domainCscenter +"/faq/?cate=7");
				break;
			case 9: // bandmaster
				this.goLocation(domainCscenter +"/faq/?cate=12");
				break;
			default:
				this.goLocation(domainCscenter +"/faq/");
				break;
			}
			break;
		case "Consult" :
			this.goLocation(nDolfinConsult);
			break;
		case "Accuse" :
			this.goLocation(nDolfinAccuse);
			break;
		case "MyQA" :
			this.goLocation(nDolfinMyQAList);
			break;

		case "Agree" :
			this.goLocation(nDolfinPolicy +"?seType=Agree");
			break;
		case "Policy" :
			this.goLocation(nDolfinPolicy +"?seType=Private");
			break;
		case "Private" :
			this.goLocation(nDolfinPolicy +"?seType=Private");
			break;
		case "Teenager" :
			this.goLocation(nDolfinPolicy +"?seType=Teenager");
			break;
		case "Operation" :
			this.goLocation(nDolfinPolicy +"?seType=Operation&gameID="+ nowSiteCode);
			break;
		case "CashAgree" :
			this.goLocation(nDolfinPolicy +"?seType=CashAgree&gameID="+ nowSiteCode);
			break;
		case "Company" :
			this.goOpenLocation(domainCompany);
			break;
		case "Event" :
			this.goLocation(domainWww + "/Event/List.aspx");
			break;
		case "Security":
			this.goLocation(domainMembership + "/SecurityCenter/SecondPwd/Default.aspx");
			break;
		case "Note":
		        var userSignVal = getnDolfinCookie("YDSign");
		        var userSignKey = getnDolfinCookie("YDKey");
			if (userSignVal.length > 0 && userSignKey.length > 0) {
				this.goLocation(domainEtc + "/Note/RecvList.aspx");
			}
			else{
				if(confirm('로그인이 필요한 서비스입니다. 로그인 하시겠습니까?')){
					var noteDomain = "http://etc.ndolfin.com/Note/RecvList.aspx";
					this.goLocation(domainMembership +"/Common/Lib/Login.aspx?url=" + escape(noteDomain));
				}
			
			}
			break;
		case "otpPop":
			//document.write("<scr"+"ipt language='javascript' type='text/javascript' src='"+domainStatic+"/js/comm.js'></scr"+"ipt>");
			f_viewLayerPopup();
			break;	
		case "WebZin":
			this.goLocation(domainWww + "/Webzin/default.aspx");
			break;
		case "WWW":
			this.goLocation(domainWww);
			break;
		case "PCBang":
			this.goOpenLocation(domainPcbang);
			break;
		case "f_AosHelp":
			this.goOpenLocation('https://members.ndolfin.com/SecurityCenter/Keyboard/Info.aspx');
			break;	
		case "EmailPopup" :
			var emailParams = "left="+ centerWinPoz('left', 500) +",top="+ centerWinPoz('top', 600) +",width=400,height=220,resizable=no,menubar=no,status=no";
			emailUrl = "http://static.ndolfin.com/html/pop_refuse_mail_gather.html";
		
			window.open(emailUrl, "emailWindow", emailParams);

			break;
		default:
			break;
		}
	},
	goLocation: function(requestUrl) {
		top.location.href = requestUrl;
	},
	goOpenLocation: function(requestUrl) {
		window.open(requestUrl);
	},
	setStartPage: function(obj) {
		try {
			obj.style.behavior = "url(#default#homepage)";
			obj.setHomePage(domainWww);
		} catch (e){}
	},
	setBookMark: function() {
		if (window.sidebar) {
			window.sidebar.addPanel(cmnDolfinTitle, domainWww, "");
		} else if (window.external) {
			window.external.AddFavorite(domainWww, cmnDolfinTitle);
		}
	},
	ZeroCoupon:function(pGameCode){
		var couponParams = "left="+ centerWinPoz('left', 500) +",top="+ centerWinPoz('top', 600) +",width=400,height=120,resizable=no,menubar=no,status=no,scrollbars=no";
			couponUrl = domainEtc +"/coupon/coupon.aspx?gameID="+pGameCode;
		
		var couponWindow = window.open(couponUrl, "zeroCouponWindow", couponParams);
			couponWindow ? couponWindow.focus() : alert(cmMassagePopup);
	}
}


// FAMILY LOGIN SUB FUNCTION
function nDolfinLogon(f) {
	if (!IsValidMemberAcc(f.FSWebID.value, f.FSWebPW.value)) {
		alert(cmMassageIncIDPW);
		return;
	}
	if(!aos_loaded()){
		alert("키보드보안 모듈을 설치해주세요");
		return;
	}

	aos_copy_to_form(f);

	f.action = nDolfinLoginAct;
	f.method = "post";
	f.submit();

}
function nDolfinLogon2(f) {
	if (!IsValidMemberAcc(f.FSWebID.value, f.FSWebPW.value)) {
		alert(cmMassageIncIDPW);
		return;
	}		

	f.action = nDolfinLoginAct;
	f.method = "post";
	f.submit();

}

function IsValidMemberAcc(idValue, pwValue) {
	if (idValue.length < 4 || idValue.length > 16) return;
	if (pwValue.length < 4 || pwValue.length > 16) return;
	var reg = /^([a-z]|[A-Z]|[0-9]|[@])([@]|[0-9]|[a-z]|[A-Z]){1,16}$/g;
	return reg.test(idValue)
}




/***** COOKIE CONTROL *****/

// GET COOKIE
function getnDolfinCookie(cName) {
var found = false;
var ns, ne;
var i = 0;
cName = cName +"=";

while(i <= document.cookie.length) {
	ns = i;
	ne = ns + cName.length;
	if(document.cookie.substring(ns, ne) == cName) {
		found = true;
		break;
	}
	i++;
}
if(found == true) {
	ns = ne;
	ne = document.cookie.indexOf(";", ns);
	if(ne < ns) ne = document.cookie.length;
	return document.cookie.substring(ns, ne);
}
return "";
}

// SET COOKIE
function setnDolfinCookie(cName, cValue) {
var DyMilli = 1000 * 60 * 60 * 24;

var tomorrow = new Date();
	tomorrow.setTime(Math.round(tomorrow.getTime()/DyMilli + 1) * DyMilli);
	document.cookie = cName +"="+ escape(cValue) + "; path=/; domain="+ nowSiteDomain +"; expires=" + tomorrow.toGMTString() + ";"
}




/***** OTHER FUNCTION *****/

// RETURN WINDOW CENTER POSITION
var centerWinPoz = function(poz, wSize) {
	var winPoz;
	if (poz == "left") {
		winPoz = (screen.width) ? (screen.width - wSize) / 2 : 0;
	} else if (poz == "top") {
		winPoz = (screen.height) ? (screen.height - wSize) / 2 : 0;
	}
	return winPoz;
}

// SHOW FLASH OBJECT
function viewFlashobject(path, w, h, obj, t) {
var objtag = '';
	objtag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,115,0" width="'+ w +'" height="'+ h +'">'
	+'<param name="allowScriptAccess" value="always">'
	+'<param name="movie" value="'+ path +'">'
	+'<param name="wmode" value="'+ t +'">'
	+'<param name="quality" value="high">'
	+'<embed src="'+ path +'" wmode="'+ t +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed></object>';
	obj.innerHTML = objtag;
}

// SHOW FLASH OBJECT SSL
function viewFlashobjectSSL(path, w, h, obj, t) {
var objtag = '';
	objtag = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="/activex/swflash.cab#version=9,0,115,0" width="'+ w +'" height="'+ h +'">'
	+'<param name="allowScriptAccess" value="always">'
	+'<param name="movie" value="'+ path +'">'
	+'<param name="wmode" value="'+ t +'">'
	+'<param name="quality" value="high">'
	+'<embed src="'+ path +'" wmode="'+ t +'" quality="high" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="'+ w +'" height="'+ h +'"></embed></object>';
	obj.innerHTML = objtag;
}

function OnEnter(field) {
	field.style.backgroundImage = "url('')";
}

function OnExit(field, imgurl) {
	if( field.value.length == 0 || field.value == "" ) {
		field.style.backgroundImage = "url("+ imgurl +")";
		field.style.backgroundRepeat = "no-repeat";
		field.style.backgroundPosition = "4px 0";
	}
}

// 20102019 이강원
// 이벤트 기간 지난 후 제거.
//document.write("<scr"+"ipt language='javascript' type='text/javascript' src='"+domainStatic+"/js/comn.js'></scr"+"ipt>");
// 20100506 김주희
document.write("<scr"+"ipt language='javascript' type='text/javascript' src='"+domainStatic+"/js/otpPop.js'></scr"+"ipt>");


//ZeroBill Open 2010/06/10 geniusjh
function PaymentOpen(gameCode, retUrl) {
    var shape = "";
    var width = 430;
    var height = 700;
    var positionX, positionY;

    positionX = (screen.availWidth - width) / 2;
    positionY = (screen.availHeight - height) / 2;

    shape = "width=" + width + ",height=" + height + ",";
    shape += "left=" + positionX + ",top=" + positionY + ",toolbar=no,location=no,directories=no,status=no,";
    shape += "menubar=no,scrollbars=no,resizable=no";

    if (retUrl == undefined)
        retUrl = "";
    else
        retUrl = escape(retUrl);

    var paymentPop = window.open(domainPayment + "/ZeroCash/Cash/ChargeSelect.aspx?GameCode=" + gameCode + "&retUrl=" + retUrl, "zeroCashPop", shape);
    paymentPop.focus();
}

//Channeling Open 2010/11/09 geniusjh
var Channel = {

    //제3자 동의 페이지 이동
    ThirdpartyGo: function (gameCode, retUrl, cancelUrl) {
        var url = domainMembership + "/channel/thirdparty.aspx?gameCode=" + gameCode
        if (typeof (retUrl) == 'string') url += "&retUrl=" + escape(retUrl)
        if (typeof (cancelUrl) == 'string') url += "&cancelUrl=" + escape(cancelUrl);
        top.location.href = url;
    },

    //게임 개별 해지 페이지 이동
    TerminateGo: function (gameCode, retUrl, cancelUrl) {
        var url = domainMembership + "/channel/terminate.aspx?gameCode=" + gameCode
        if (typeof (retUrl) == 'string') url += "&retUrl=" + escape(retUrl)
        if (typeof (cancelUrl) == 'string') url += "&cancelUrl=" + escape(cancelUrl);
        top.location.href = url;
    },

    //ImageYDOnline
    YDOnlineCIImage: function () {
        return domainStatic + "/201012/images/channeling/YD_online_logo.jpg";
    },

    //YD Online Link
    YDOnlineLinkURL: function () {
        return domainWww;
    },

    //CI HTML
    YDOnlineCIHTML: function (width) {

        var ydImage = this.YDOnlineCIImage();
        var ydLInk = this.YDOnlineLinkURL();

        if (width != undefined && width != '')
            return "<a href=\"" + ydLInk + "\" target=\"_blank\"><img src=\"" + ydImage + "\" border=\"0\" alt=\"\" width=\"" + width + "\" /></a>";
        else
            return "<a href=\"" + ydLInk + "\" target=\"_blank\"><img src=\"" + ydImage + "\" border=\"0\" alt=\"\" /></a>";
    }
}


/* 구글 스크립트 */
  /*    
     var gaJsHost = (("https:" == document.location.protocol) ? "https://ssl." : "http://www.");
           document.write(unescape("%3Cscript src='" + gaJsHost + "google-analytics.com/ga.js' type='text/javascript'%3E%3C/script%3E"));

           try {
               var pageTracker = _gat._getTracker("UA-11240566-3");
               pageTracker._trackPageview();
           } catch (err) { }

*/
