/* ** »çÀÌµå ¹Ù °ü·Ã Config ** http://sidebar.netmarble.net/targetedpopup/popup.js.asp ÀÇ Javascript¸¦ Include ÇÑÈÄ¿¡ »ç¿ë ÇÒ¼ö ÀÖ´Ù. ** */ function _SidebarLib() { this.OpenScreenSize = 1280; this.FlagTargetPopup = false; this.DefaultOpen = ""; this.IsLogin = ""; this.C2ImgUrl=""; this.DomainSidebar=""; this.Cookie = { /*' '@name : SetOneTimeCookie '@desc : onetime ÄíŰ ¼³Á¤ */ SetOneTimeCookie : function(pCookieName, pCookieValue, pDomain ) { var strCookie = pCookieName + "=" + escape( pCookieValue ) + "; path=/;"; if( pDomain != null ) strCookie = strCookie + "domain=" + pDomain + ";"; document.cookie = strCookie; }, /*' '@name : SetCookie '@desc : ÄíŰ ¼³Á¤ */ SetCookie : function(pCookieName, pCookieValue, pExpireDate, pDomain ) { var todayDate = new Date(); todayDate.setDate( todayDate.getDate() + pExpireDate ); var strCookie = pCookieName + "=" + escape( pCookieValue ) + "; path=/; expires=" + todayDate.toGMTString() + ";"; if( pDomain != null ) strCookie = strCookie + "domain=" + pDomain+";"; document.cookie = strCookie; }, /*' '@name : GetCookie '@desc : ¸¸·áµÇÁö ¾ÊÀº ÁöÁ¤ÇÑ Äí۸íÀÌ Á¸ÀçÇÏ¸é ±× À̸§À» return ' ¾øÀ»¶§´Â ºó¹®ÀÚ¿­ "" À» return */ GetCookie : function(pCookieName) { var nameOfCookie = pCookieName + "="; var x = 0; while (x <= document.cookie.length) { var y = (x+nameOfCookie.length); if (document.cookie.substring(x,y) == nameOfCookie ) { endOfCookie=document.cookie.indexOf(";",y) if (endOfCookie == -1) endOfCookie = document.cookie.length; return unescape(document.cookie.substring(y,endOfCookie)); } x = document.cookie.indexOf(" ",x) + 1; if (x == 0) break; } return ""; } };; this.Common = { /* '@name : WindowOpen('/bit/open.asp', '300', '200', 'newPopup', pScroll, pResize, pTop, pLeft) '@desc : '@arguments : [0] url [1] window name [2] ÆË¾÷ÀÇ top [3] ÆË¾÷ÀÇ left [4] width [5] height [6] scrollbars »ç¿ë¿©ºÎ (0:¹Ì»ç¿ë/else:»ç¿ë) [7] resize »ç¿ë¿©ºÎ (0:¹Ì»ç¿ë/else:»ç¿ë) '@return : popup°´Ã¼ ¸í */ WindowOpen : function() { // WindowOpen('/bit/open.asp', 'newPopup', pTop, pLeft, pWidth, pLeft, pScroll, pResize,) var pURL = arguments[0]; var pName = arguments[1]; var pTop = arguments[2]; var pLeft = arguments[3]; var pWidth = arguments[4]; var pHeight = arguments[5]; var pScroll = arguments[6]; var pResize = arguments[7]; if(pTop == "undefined" || pTop == "" ) pTop = (screen.height - pHeight) / 2 - 40; if(pLeft == "undefined" || pLeft == "") pLeft = (screen.width - pWidth) / 2; if(pWidth == "undefined" || pWidth == "") pWidth = 300; if(pHeight == "undefined" || pHeight == "") pHeight = 400; if(pScroll == "undefined" ||pScroll == "") pScroll = "no" if(pResize == "undefined" || pResize == "") pResize = "no"; var strOption = "'toolbar=no,location=no,directories=no,status=0,menubar=no,copyhistory=no,"; strOption += " scrollbars=no,resizable=no,"; strOption += " top=" + pTop +",left=" + pLeft +","; strOption += " width="+ pWidth +",height="+ pHeight +"'"; var popup = window.open(pURL, pName, strOption); if (popup != null || !popup.close) popup.focus(); return popup; } }; } var SidebarLib = new _SidebarLib(); /* ** »çÀ̵å¹Ù¿¡¼­ »ç¿ëÇÒ ÄíŰ ¸Þ¸ð¸® Äí۸¦ »ý¼ºÇÑ´Ù. */ _SidebarLib.prototype.Debug = function() { alert( "_SidebarLib µð¹ö±×(1/2) \nÇØ»óµµ ¼³Á¤ °ª GetScreenSize() " + this.GetScreenSize() ); alert( "_SidebarLib µð¹ö±×(2/2) \n°øÁö»çÇ× ¼³Á¤ °ª GetIsTarget() : " + this.GetIsTarget() + "\nStop ÄíŰ GetIsStop() : " + TargetPopup.GetIsStop() ); alert( "_SidebarLib µð¹ö±×(2/3) \n»çÀ̵å¹Ù ¿­¸²/´ÝÈû °ª GetDefaultOpen() : " + this.GetDefaultOpen() ); alert( "_SidebarLib µð¹ö±×(2/4) \nÇǾ¾¹æÃ¼Å© GetPcbangInfo() : " + this.GetPcbangInfo() ); } /* ** »çÀÌÆ®ÀÇ ±âº» ÇØ»óµµ ÆäÀÌÁö¸¦ ¼³Á¤ ÇÑ´Ù. 3 ** ÇØ´ç °¡·Î ÇØ»óµµ º¸´Ù Å©¸é »çÀ̵å¹Ù¸¦ ¿­¾î µÐ´Ù. */ _SidebarLib.prototype.SetScreenSize = function( pWidth ) { this.OpenScreenSize = pWidth; return; } /* ** »çÀÌÆ®ÀÇ ±âº» ÇØ»óµµ ÆäÀÌÁö¸¦ ¼³Á¤ ÇÑ´Ù. ** ÇØ´ç °¡·Î ÇØ»óµµ º¸´Ù Å©¸é »çÀ̵å¹Ù¸¦ ¿­¾î µÐ´Ù. */ _SidebarLib.prototype.GetScreenSize = function() { return this.OpenScreenSize; } /* ** »çÀÌÆ®¿¡¼­ Ÿ°ÙÆÃ Popup ÆäÀÌÁö »ç¿ë ¿©ºÎ ¼Ó¼º°ªÀ» ³Ö¾îÁØ´Ù. */ _SidebarLib.prototype.SetTargetPopup = function( pFlag ) { this.FlagTargetPopup = pFlag; return; } /* ** »çÀÌÆ®¿¡¼­ Ÿ°ÙÆÃ Popup ÆäÀÌÁö »ç¿ë ¿©ºÎ ¼Ó¼º°ªÀ» °¡Á®¿Â´Ù. */ _SidebarLib.prototype.GetTargetPopup = function() { return this.FlagTargetPopup; } /* ** Ÿ°ÙÆÃ ÆË¾÷¿ë Äí۰¡ ÀÖ´ÂÁö È®ÀÎÇÑ´Ù. */ _SidebarLib.prototype.GetTargetPopupCookie = function() { return TargetPopup.GetCookieCache(); } /* ** Ÿ°ÙÆÃ ÆË¾÷¿ë Äí۸¦ ½É¾î ÁØ´Ù. */ _SidebarLib.prototype.SetTargetPopupCookie = function() { TargetPopup.SetCookieCache(); return; } /* ** Ÿ°ÙÆÃ ÆË¾÷ âÀ» ¶ç¿öÁØ´Ù. ±âº»ÀûÀ¸·Î "popup.js.asp" °¡ Include µÇ¾î ÀÖ¾î¾ß ÇÑ´Ù. */ _SidebarLib.prototype.ApiTargetPopup = function() { if( this.GetTargetPopup() && this.GetTargetPopupCookie() == false ){ this.SetTargetPopupCookie(); return TargetPopup.mUrl; TargetPopup.Debug(); ttj } else return ""; } /* ** Ÿ°ÙÆÃ ÆË¾÷ URL À» °¡Á®¿Â´Ù. */ _SidebarLib.prototype.GetTargetPopupUrl = function() { return TargetPopup.Url; } /* ** Ÿ°ÙÆÃ ÆË¾÷À» ¶ç¿ö¾ß ÇÏ´ÂÁö . */ _SidebarLib.prototype.GetIsTarget = function() { if( TargetPopup.GetIsStop() == false && TargetPopup.GetIsTarget() == true ) return true; else return false; } /* ** Ÿ°ÙÆÃ ÆË¾÷À» ¶ç¿ö¾ß ÇÏ´ÂÁö . */ _SidebarLib.prototype.SetTargetStop = function( pDay ) { TargetPopup.SetCookieTargetStop( pDay ); } /* ** ÄíŰ¼³Á¤ */ _SidebarLib.prototype.SetCookie = function(pName, pValue, pDay, pDomain) { return this.Cookie.SetCookie(pName, pValue, pDay, pDomain); } /* ** ÄíŰ¼³Á¤ */ _SidebarLib.prototype.SetOneTimeCookie = function(pName, pValue, pDomain) { return this.Cookie.SetOneTimeCookie(pName, pValue, pDomain); } /* ** ÄíŰ¾ò±â */ _SidebarLib.prototype.GetCookie = function(pName) { return this.Cookie.GetCookie(pName); } /* ** ±âº» open or close */ _SidebarLib.prototype.SetDefaultOpen = function(pValue) { if( pValue.length > 0 ) pValue = pValue.toLowerCase(); this.DefaultOpen = pValue; return; } _SidebarLib.prototype.GetDefaultOpen = function() { return this.DefaultOpen; } /* ** PC¹æ ¿©ºÎ */ _SidebarLib.prototype.GetPcbangInfo = function() { if ("undefined" == typeof(pcbang)) { return 0; } return pcbang.chk; } /* ** ·Î±×ÀÎ ¿©ºÎ */ _SidebarLib.prototype.SetIsLogin = function(pValue) { if( pValue.length > 0 ) pValue = pValue.toLowerCase(); this.IsLogin = pValue; return; } _SidebarLib.prototype.GetIsLogin = function() { return this.IsLogin; } _SidebarLib.prototype.SetC2ImgUrl = function(pValue) { return this.C2ImgUrl=pValue; } _SidebarLib.prototype.GetC2ImgUrl = function() { return this.C2ImgUrl; } _SidebarLib.prototype.SetDomainSidebar = function(pValue) { return this.DomainSidebar=pValue; } _SidebarLib.prototype.GetDomainSidebar = function() { return this.DomainSidebar; } _SidebarLib.prototype.WindowOpen = function(pUrl,pW,pH) { this.Common.WindowOpen ( pUrl, "_blank", "" , "", pW, pH ); return; }