function eBookOpener() { this.maxWin = null; this.winWidth = null; this.winHeight = 0; this.winLimitWidth = 1024; this.winLimitHeight = 768; this.winStyle = null; this.winStyleName = null; this.albumID; this.dirPage = 1; this.eBookUrl; this.ViewerStyleList = new Array("eBookFull", "eBookCustomer", "eBookDefault", "FullScreen"); this.GetWinStyle = GetWinStyle; this.OpenBook = OpenBook; this.reMax="N"; this.User = null; this.bUrl = null; this.reBook = null; this.SearchKey=""; this.SearchType=null; this.Search_year1 = null; this.Search_month1 = null; this.Search_day1 = null; this.Search_year2 = null; this.Search_month2 = null; this.Search_day2 = null; this.ClassInit = null; this.HTMLFILE = 0; this.Group = null; this.subGroup = null; this.BroswerCheck = "IE"; this.IEver = 5; this.openChk = 1; this.openType = "WIN"; // 20100427 this.iPhone = iPhone; this.chg_script = chg_script; this.GetValue = GetValue; } // 20100427 function iPhone() { var osx = window.navigator.appVersion; if(osx.indexOf("iPhone") > 0) return true; else return false; } function chg_script(js) { var pLoad = false; var head = document.getElementsByTagName("head")[0]; var script = document.createElement("script"); if (head.getElementsByTagName("script").length > 1) { for (var i = (head.childNodes.length - 1); i >= 0; i--) { if (head.childNodes[i].nodeName == 'SCRIPT' && head.childNodes[i].id == 'prototypeSc') { //head.removeChild(head.childNodes[i]); pLoad = true; break; } } } if(!pLoad) { script.src = js; script.type = 'text/javascript'; script.id= 'prototypeSc'; head.appendChild(script); } } function GetValue(url, res) { try{ new Ajax.Request( url , { onSuccess: function( transport ) { var domain = "http://"+transport.responseText+"/autoalbum/connectBook.html" + res; try{ location.href="SoftBook:"+domain; }catch(e){alert('false');} } } ); }catch(e){ setTimeout("this.GetValue('"+url+"', '"+res+"')", "500"); } } // function browserVersion(){ this.BroswerCheck = (function x(){})[-5]=='x'?'FF3':(function x(){})[-6]=='x'?'FF2':/a/[-1]=='a'?'FF':'\v'=='v'?'IE':/a/.__proto__=='//'?'Saf':/s/.test(/a/.toString)?'Chr':/^function \(/.test([].sort)?'Op':'Unknown' ; if(this.BroswerCheck == "IE") this.IEversionCheck(); } function IEversionCheck() { var ver = 5; if( navigator.appName.indexOf("Microsoft") > -1 ) // IE? { if( navigator.appVersion.indexOf("MSIE 6") > -1) // IE6? ver= 6; else if(navigator.appVersion.indexOf( "MSIE 7") > -1) // IE7?IE7? ver = 7; else if(navigator.appVersion.indexOf("MSIE 8") > -1) // IE8?IE8? ver = 8; } this.IEver = ver; } function GetWinStyle() { if(this.maxWin == "Y") { var tmpFullScreen =""; this.winStyle = 0; } else var tmpFullScreen = "" ; if ( this.winStyle == null ) { this.winStyle = 2 ; } if( ( screen.width <= this.winLimitWidth || screen.height <= this.winLimitHeight) ) { this.winStyle = 0 ; } switch ( this.winStyle ) { case 0 : // Default window this.winStyleName = this.ViewerStyleList[0]; this.winTop = 0 ; this.winLeft = 0 ; this.winWidth = screen.width ; this.winHeight = screen.height ; if ( screen.width != screen.availWidth ) { this.winWidth = screen.availWidth } // TaskBar Width if ( screen.height != screen.availHeight ) { this.winHeight = screen.availHeight } // TaskBar Heigh if(this.BroswerCheck=="Saf") this.winHeight -= 25; this.maxWin = "Y"; break; case 1 : // corporation customer window this.winStyleName = this.ViewerStyleList[1]; if(this.winWidth < this.winLimitWidth) { this.winWidth = this.winLimitWidth; } if(this.winHeight < this.winLimitHeight) { this.winHeight = this.winLimitHeight; } this.winLeft = (screen.width - this.winWidth) / 2; this.winTop = (screen.height - this.winHeight) / 2; break; case 2 : // user customer window environemnt this.winStyleName = this.ViewerStyleList[2]; this.winWidth = this.winLimitWidth; this.winHeight = this.winLimitHeight; this.winLeft = (screen.width - this.winWidth) / 2; this.winTop = (screen.height - this.winHeight) / 2; break; case 3 : // Full Screen this.winStyleName = this.ViewerStyleList[3]; this.winWidth = screen.width; this.winHeight = screen.height; this.winLeft = 0; this.winTop = 0; break; default : ; } this.winStyle = "top=" + this.winTop + ", left=" + this.winLeft + ", width=" + this.winWidth + ", height=" + this.winHeight + ", directories=no, location=no, menubar=no, resizable=yes, scrollbars=no, status=no, toolbar=no" + tmpFullScreen ; } function OpenBook() { // NOTE : process v1.6 , v1.8 param type for naver var bro_status_chk=null; this.GetWinStyle(); var eBookClient = null; try { var u = this.eBookUrl; if(u.indexOf('view.html') > 0) var formPage = u.replace('view.html', 'connectBook.html'); else if(u.indexOf('bbb.html') > 0) var formPage = u.replace('bbb.html', 'connectBook.html'); // 20100427 var resOpt = "?Falbum="+this.albumID+"&FmaxWin="+this.maxWin+"&FdirectPageNum="+this.dirPage+"&Fbhi="+this.winHeight+"&UserDumy="+this.User+"&scw="+screen.width+"&sch="+screen.height+"&bUrl="+this.bUrl+"&openerHTML="+this.HTMLFILE+"&SearchKey="+this.SearchKey+"&SearchType="+this.SearchType+"&Search_year1="+this.Search_year1+"&Search_month1="+this.Search_month1+"&Search_year2="+this.Search_year2+"&Search_month2="+this.Search_month2+"&fspGroup="+this.Group+"&subGroup="+this.subGroup; var sQuery2 = formPage + resOpt; // 20100427 if(this.iPhone()) { var urlStart = u.indexOf("http://"); if(urlStart != "0") { var basePath = formPage.replace("connectBook.html", ""); var prototypeJS = basePath+"js/prototype/prototype.js"; var domainPath = basePath+"common/lib/getDomain.html?UserDumy="+this.User; this.chg_script(prototypeJS); var realdomain = this.GetValue(domainPath,resOpt); } else { location.href = "SoftBook:"+sQuery2; } } else if(this.openType == "WIN") eBookClient = window.open(sQuery2, this.winStyleName +"_"+ Math.round(Math.random() * 100), this.winStyle); else location.href = sQuery2; this.openChk = eBookClient.closed; } catch (e) { //alert("ÆË¾÷âÀÌ Â÷´ÜµÇ¾î Ã¥ÀÚ¸¦ ¿­Áö ¸øÇÏ¿´½À´Ï´Ù.\n\n¾Æ·¡ \"ÀüÀÚºÏ º¸±â\" ¹öư ¶Ç´Â Ã¥ÀÚ Ç¥Áö¸¦ Ŭ¸¯ Çϰųª\n\nÀ§ ³ë¶õ Ç¥½ÃÁÙÀÇ ÆË¾÷ Â÷´ÜÀ» ÇØÁ¦ ÇÏ¿© Áֽøé Ã¥ÀÚ¸¦ ¿­¶÷ ÇϽǼö ÀÖ½À´Ï´Ù."); bro_status_chk = "block"; } if(this.reMax == "Y") { self.opener = self; self.close(); } if(this.ClassInit==1) { OpenEBook = new eBookOpener(); } return bro_status_chk; } OpenEBook = new eBookOpener(); var beForUrl = ""; function mbookzView2(domain,args,pn,max,User,winStyles) { if(!args) { alert('Ãʱâ Ä«Å×°í¸®°¡ ¼³Á¤ µÇÁö ¾Ê¾Ò½À´Ï´Ù.'); return; } if(!beForUrl) { beForUrl = encodeURIComponent(location.href); } OpenEBook.albumID = args; if(max) OpenEBook.maxWin =max; if(pn) OpenEBook.dirPage = pn; if(User) OpenEBook.User = User; if(beForUrl) OpenEBook.bUrl = beForUrl; if(winStyles) OpenEBook.winStyle = parseInt(winStyles); OpenEBook.eBookUrl="http://"+domain+"/autoalbum/view.html"; var op = OpenEBook.OpenBook(); OpenEBook = new eBookOpener(); } function mbookzView3(domain,args,pn,max,User,winStyles,SearchKey) { if(!args) { alert('Ãʱâ Ä«Å×°í¸®°¡ ¼³Á¤ µÇÁö ¾Ê¾Ò½À´Ï´Ù.'); return; } if(!beForUrl) { beForUrl = encodeURIComponent(location.href); } OpenEBook.albumID = args; if(max) OpenEBook.maxWin =max; if(pn) OpenEBook.dirPage = pn; if(User) OpenEBook.User = User; if(beForUrl) OpenEBook.bUrl = beForUrl; if(winStyles) OpenEBook.winStyle = parseInt(winStyles); if(SearchKey) OpenEBook.SearchKey = encodeURIComponent(SearchKey); OpenEBook.eBookUrl="http://"+domain+"/autoalbum/view.html"; var op = OpenEBook.OpenBook(); OpenEBook = new eBookOpener(); }