document.domain = "gamejjang.com"; //브라우저 체크 함수 function browserVersionCheck(){ var agent = navigator.userAgent.toLowerCase(), name = navigator.appName, browser; if( name === "Microsoft Internet Explorer" || agent.indexOf("trident") > -1 || agent.indexOf("edge/") > -1 ){ browser = "ie"; if( name === "Microsoft Internet Explorer" ){ agent = /msie ([0-9]{1,}[\.0-9]{0,})/.exec(agent); browser += parseInt(agent[1]); } else { if( agent.indexOf("trident") > -1 ){ browser += 11; } else if( agent.indexOf("edge/") > -1 ){ browser = "edge"; } } } else if( agent.indexOf("safari") > -1 ){ if( agent.indexOf("chrome") > -1 ){ browser = "chrome"; } else if( agent.indexOf("safari") > -1 ) { browser = "safari"; } } else if( agent.indexOf("firefox") > -1 ){ browser = "firefox"; } return browser; } function popup(obj){ var url = obj.url; var name = obj.name || "popup"; var w = obj.width || 450; var h = obj.height || 650; var position = obj.position; var scroll = obj.scroll; var browserCheck = browserVersionCheck() || false; var tlOpt = 'top=0, left=0'; if(position == "center"){ var top = screen.height/2 - h/2 - 100; var left = screen.width/2 - w/2; if(top<0) top=0; if(left<0) left=0; tlOpt = ',top='+top +',left='+left; }else if( Object.prototype.toString.call(position) == "[object Object]" && "top" in position && "left" in position ){ tlOpt = ',top='+position.top+',left='+position.left; } if( browserCheck == "chrome" ){ w = w + 18; h = h - 20; } else if( browserCheck == "firefox" ){ w = w + 20; h = h - 5; } sOpt = (scroll == "scroll" || scroll === true) ? ",scrollbars=yes" : ""; // 창스크롤 winOptions = tlOpt+',width='+w +',height='+h +sOpt +', resizable=yes'; // top, left, width, height, location, menubar, resizable, scrollbar, status var popWin = window.open(url,name,winOptions); return popWin; } // 충전 function wgCashReserve(){ popup({ url:'', name:'popup', width:800, height:800, position:'center', scroll:true }); } // 로그아웃 function wgLogout(){ location.href = ""; } // jQuery.cookie 대체 function getCookie(cookieName){ var cookieValue=null; if(document.cookie){ var array=document.cookie.split((escape(cookieName)+'=')); if(array.length >= 2){ var arraySub=array[1].split(';'); cookieValue=unescape(arraySub[0]); } } return cookieValue; } // Header 생성 function HeaderCreate(){ var resultStyle = "" , resultHtml = ""; // Html resultHtml += '
'; resultHtml += '

'; resultHtml += ' '; resultHtml += ' GAMEJJANG game'; resultHtml += ' 모든 게임은 온디스크, 케이디스크에서 이용하실 수 있습니다.'; resultHtml += ' '; resultHtml += '

'; resultHtml += '
'; resultHtml += ' '; resultHtml += '
'; resultHtml += '
'; // Header 태그 생성 및 내용 생성 var header = document.createElement("header"); header.classList.add("game_header"); header.innerHTML = resultHtml; // Body안쪽 처음쪽에 붙임 document.body.insertBefore(header, document.body.firstChild); // Style resultStyle += '/* [Layout] - Game Header */'; resultStyle += '.game_header {position:relative; background:#fff; z-index:99;}'; resultStyle += '.game_header_in {width:1280px; height:95px; margin:0 auto;}'; resultStyle += '.game_header_in:after {content:""; display:block; clear:both;}'; resultStyle += '/* [Layout] - Game Header > Logo */'; resultStyle += '.game_header .logo {float:left;}'; resultStyle += '.game_header .logo img {vertical-align:top;}'; resultStyle += '/* [Layout] - Game Header > User Info */'; resultStyle += '.game_header .user_info {float:right; margin-top:34px; font-weight:500; color:#444; font-family:"Noto Sans KR", sans-serif !important;}'; resultStyle += '.game_header .user_info .webgame {display:inline-block; margin-right:30px;}'; resultStyle += '.game_header .user_info .webgame img {vertical-align:middle}'; resultStyle += '.game_header .user_info .nick_info {display:inline-block; padding:8px 27px; font-weight:700; font-size:16px; border-radius:23px; background:#f0f0f0;}'; resultStyle += '.game_header .user_info .nick, .game_header .user_info .charge {font-family:"Noto Sans KR", sans-serif !important;}'; resultStyle += '.game_header .user_info .nick {display:inline-block; max-width:105px; font-size:16px; color:#eb5e18;}'; resultStyle += '.game_header .user_info .charge {display:inline-block; margin-left:0; padding:5px 30px 7px; font-weight:700; font-size:17px; color:#151515; text-decoration:none; border:2px solid #444444; border-radius:19px;}'; var stylesForm = document.createElement("style"); stylesForm.setAttribute("type", "text/css"); stylesForm.innerHTML = resultStyle; // Body안쪽 처음쪽에 붙임 document.body.insertBefore(stylesForm, document.body.firstChild); } if( !getCookie("token") ){ } // 헤더 생성 실행 HeaderCreate();