/** * @fileoverview ui/core.js * * - nj.TabSwitcher * - rollOverImage * - popupWin * - nj.fx * - nj.HgAlert * - SwfPutter * - DD_belatedPNG * - String.prototype.byteLength */ /** * nj.TabSwitcher * * Jindo: 2.1.2.2 * Added: 2009.7.27 * Modified: 2009.8.28 (cookie option) */ ( function( namespace ) { var pkg = $.verifyPackageName( namespace ); pkg.container[ pkg.name ] = $Class({ // ------------------------------------------------- // Initialize // ------------------------------------------------- $init: function(){ var htOptions = this.htOptions = this.getOptionSet( arguments[0] ); this.elHolder = $( htOptions.holderID ); this.aController = $$( '.' + htOptions.controller + ' a', this.elHolder ); this.aDisplay = $$( '.' + htOptions.display, this.elHolder ); if( this.elHolder == null ){ throw new Error(); }; this.oCookie = $Cookie(); this.sCookieKey = location.pathname.split('/').reverse()[0] + '_TABSWITCHER_' + htOptions.holderID + '_LAST_TAB_ID'; this.nLastTabIndex = null; /** * TabSwither 基本動作 * this.aDisplayの表示/非表示を制御 */ this.hideAllViews(); this.setTabSwitcher(); this.showDefaultView(); /** * 拡張Option */ if( this.htOptions.tabOptions !== undefined ){ /** * tabOptions{}の値を受け取って、Text Tab / Image Tab の見た目を制御 */ switch( this.htOptions.tabOptions.tabStyle ){ case 'text': this.setTextTabOption( this.htOptions.tabOptions ); break; case 'image': this.setImageTabOption( this.htOptions.tabOptions ); break; case undefined: throw new Error(); break; }; /** * 最後に見たタブをクッキーに保存 this.setLastTab2Cookieで、タブClick時に$cookie.setするイベントを登録 onloadでcookieを読んで、表示するするタブを決める挙動は this.showDefaultView内で定義 */ if( this.htOptions.rememberLastTab ){ this.setLastTab2Cookie(); }; }; }, // ------------------------------------------------- // 拡張Option定義 // ------------------------------------------------- /** * タブにimgを使う場合のoption */ setImageTabOption: function( htTabOptions ){ var self = this; var sHover = htTabOptions.hover; var sActive = htTabOptions.active; var sEventHandler = this.fixEventHandler( this.htOptions.eventHandler ); $A( this.aController ).forEach(function( elController ){ /** * タブhover時に付与する画像名前が渡された場合かつ、 * タブ切り替えイベントハンドラーがmouseover以外の場合に、 * hover画像に切り替えるイベント登録 */ if( sHover !== undefined && !(/mouse/i.test( sEventHandler) ) ){ /** * mouseover, mouseout時に * 画像を切り替えるイベント登録 */ $Fn(function( e ){ var elImg = e.element; var sSrc = elImg.src; if( sActive !== undefined && sActive != '' ){ if( new RegExp( sActive + '\.[a-z]+$', 'i' ).test( sSrc ) ){ return; }; }; sSrc = sSrc.replace( new RegExp( '\.([a-z]+)$', 'i' ), sHover + '.$1' ); elImg.src = sSrc; }).attach( elController, 'mouseover' ); $Fn(function( e ){ var elImg = e.element; if( elImg._active ){ return }; var sSrc = elImg.src; if( sActive !== undefined && sActive != '' ){ if( new RegExp( sActive + '\.[a-z]+$', 'i' ).test( sSrc ) && (sActive != sHover) ){ return; }; }; sSrc = sSrc.replace( new RegExp( sHover + '\.([a-z]+)$', 'i' ), '.$1' ); elImg.src = sSrc; }).attach( elController, 'mouseout' ); }; if( sActive !== undefined ){ /** * click時に * タブ画像の活性化をさせるクラスを付与 */ $Fn(function( e ){ var elActiveImg = e.element; var sActiveSrc = elActiveImg.src; var sTargetViewID = $Element( elActiveImg ).parent().attr( 'href' ).split('#')[1]; sActiveSrc = sActiveSrc.replace( new RegExp( sHover + '\.([a-z]+)$', 'i' ), '.$1' ); sActiveSrc = sActiveSrc.replace( new RegExp( '\.([a-z]+)$', 'i' ), sActive + '.$1' ); var bUseHoverClass = self.htOptions.tabOptions.imgHoverClass !== undefined; $A( self.aController ).forEach(function( elController ){ if( elController.href.split( '#' )[1] == sTargetViewID ){ /** * クリックされたイメージを活性化、 * this.controller内に、同一の役割のtriggerがある場合に、全てのトリガーの見た目を変更 */ var elImg = $$.getSingle( 'img', elController ); if( !(new RegExp( sActive ).test( elImg.src )) || (sHover == sActive) ){ elImg.src = sActiveSrc; elImg._active = true; }; if( bUseHoverClass ){ $Element( elController.parentNode ).addClass(self.htOptions.tabOptions.imgHoverClass); }; }else{ /** * 全imgをdefault */ var elImg = $$.getSingle( 'img', elController ); var sSrc = elImg.src; sSrc = sSrc.replace( new RegExp( sActive + '\.([a-z]+)$', 'i' ), '.$1' ); elImg.src = sSrc; elImg._active = false; if( bUseHoverClass ){ $Element( elController.parentNode ).removeClass(self.htOptions.tabOptions.imgHoverClass); } }; }); }).attach( elController, sEventHandler ); }; }); }, /** * タブにtextを使う場合のoption */ setTextTabOption: function( htTabOptions ){ var self = this; var sHover = htTabOptions.hover; var sActive = htTabOptions.active; var sEventHandler = this.fixEventHandler( this.htOptions.eventHandler ); $A( this.aController ).forEach(function( elController ){ /** * タブhover時に付与するclass名が渡された場合かつ、 * タブ切り替えイベントハンドラーがmouseover以外の場合に、 * hoverクラスを付与・除去イベント登録 */ if( sHover !== undefined && !(/mouse/i.test( sEventHandler) ) ){ /** * mouseover, mouseout時に * タブのclassの付与/除去をするイベント登録 */ $Fn(function( e ){ $Element( elController ).parent().addClass( sHover ); }).attach( elController, 'mouseover' ); $Fn(function( e ){ $Element( elController ).parent().removeClass( sHover ); }).attach( elController, 'mouseout' ); }; if( sActive !== undefined ){ /** * click時に * タブの活性化をさせるクラスを付与 */ $Fn(function( e ){ var sTargetViewID = e.element.href.split( '#' )[1]; $A( self.aController ).forEach(function( elController ){ if( elController.href.split( '#' )[1] == sTargetViewID ){ /** * クリックされたイメージを活性化 * this.controller内に、同一の役割のtriggerがある場合に、全てのトリガーの見た目を変更 */ $Element( elController ).parent().addClass( sActive ); }else{ /** * 全textをactive => default */ $Element( elController ).parent().removeClass( sActive ); }; }); }).attach( elController, sEventHandler ); }; }); }, /** * ロード時に活性化させたいタブをactivate * @param {Number} */ setLastTab2Cookie: function(){ /** * 各タブをクリック時にcookieにhrefを保存するイベントを登録 */ var self = this; $A( this.aController ).forEach(function( elController ){ $Fn(function( e ){ var elTabTrigger = e.element; while( elTabTrigger.tagName.toLowerCase() != 'a' ){ elTabTrigger = elTabTrigger.parentNode; }; self.oCookie.set( self.sCookieKey, elTabTrigger.href.split( '#' )[1] ); }).attach( elController, 'click' ); }); }, // ------------------------------------------------- // TabSwither 基本動作 // ------------------------------------------------- /** * 全ディスプレイを非表示に * @param {Array} */ hideAllViews: function(){ $A( this.aDisplay ).forEach(function( elDisplay ){ $Element( elDisplay ).hide(); }); }, /** * 各タグにイベント登録 * @param {Array} */ setTabSwitcher: function(){ var self = this; var sEventHandler = this.fixEventHandler( this.htOptions.eventHandler ) $A( this.aController ).forEach(function( elController ){ $Fn(function( e ){ self.switchTabs( e ) }).attach( elController, sEventHandler ); $Fn(function( e ){ e.stop(); }).attach( elController, 'click' ); }); }, /** * 表示したい要素の挙動詳細 * @param {Event} */ switchTabs: function( e ){ var elTabTrigger = e.element; while( elTabTrigger.tagName.toLowerCase() != 'a' ){ elTabTrigger = elTabTrigger.parentNode; }; var sTargetViewID = elTabTrigger.href.split('#')[1] var welTargetDisplay = $Element( sTargetViewID ); this.hideAllViews(); welTargetDisplay.show(); }, // ------------------------------------------------- // utility // ------------------------------------------------- /** * ロード時に表示させたい要素をdisplay:block; * @param {Array} */ showDefaultView: function(){ var self = this; var i = 1; var sLastTabID = self.oCookie.get( this.sCookieKey ); if( sLastTabID !== null ){ $A( this.aController ).forEach(function( elController, _index ){ if( elController.href.split('#')[1] == sLastTabID && self.nLastTabIndex == null){ /** * this.aController[0] をthis.htOptions.defaultViewで指定する値は「1」なので * _indexに1を加算 */ self.nLastTabIndex = _index + 1; }; }); }; var nDefaultView = ( this.htOptions.rememberLastTab ) ? self.nLastTabIndex : this.htOptions.defaultView; if( nDefaultView !== undefined ){ switch( (typeof nDefaultView).toLowerCase() ){ case 'number': /** * this.aController[0] をthis.htOptions.defaultViewで指定する値は「1」なので * nDefaultView配列の適切な添え字に使える値にするため1減算 */ nDefaultView -= 1; $Element( this.aDisplay[nDefaultView] ).show(); this.activateDefaultTab( nDefaultView ); break; case 'string': if( nDefaultView == '*' ){ var nRandom = Math.floor( Math.random() * this.aDisplay.length ); $Element( this.aDisplay[nRandom] ).show(); this.activateDefaultTab( nRandom ); }else{ throw new Error(); }; break; default: $Element( this.aDisplay[0] ).show(); this.activateDefaultTab( 0 ); break; }; }else{ $Element( this.aDisplay[0] ).show(); this.activateDefaultTab( 0 ); }; }, /** * ロード時に活性化させたいタブをactivate * @param {Number} */ activateDefaultTab: function( nDefaultTab ){ if( this.htOptions.tabOptions === undefined ){ return; }; var self = this; var sHover = this.htOptions.tabOptions.hover; var sActive = this.htOptions.tabOptions.active; var _targetViewID = this.aController[nDefaultTab].href.split( '#' )[1]; switch( this.htOptions.tabOptions.tabStyle ){ case 'image': var _activeImg = $$.getSingle( 'img', this.aController[nDefaultTab] ); var _activeSrc = _activeImg.src; _activeSrc = _activeSrc.replace( new RegExp( sHover + '\.([a-z]+)$', 'i' ), '.$1' ); _activeSrc = _activeSrc.replace( new RegExp( '\.([a-z]+)$', 'i' ), sActive + '.$1' ); _activeImg.src = _activeSrc; $A( self.aController ).forEach(function( elController ){ var _img = $$.getSingle( 'img', elController ); _img._active = false; if( elController.href.split( '#' )[1] == _targetViewID ){ _img.src = _activeSrc; _img._active = true; }; }); break; case 'text': $A( self.aController ).forEach(function( elController ){ if( elController.href.split( '#' )[1] == _targetViewID ){ $Element( elController ).parent().addClass( sActive ); }; }); break; }; }, /** * tabOptionsに渡されたイベントハンドラーを調整 */ fixEventHandler: function( sEventHandler ){ if( /mouse/i.test(sEventHandler) ){ /** * これらのイベントハンドラーは全て、 * MouseOverによるタブ切り替えと判別する。 * * onMouseDown * onMouseUp * onMouseOver * onMouseOut * onMouseMove */ return 'mouseover'; }else if( /click/i.test(sEventHandler) ){ /** * これらのイベントハンドラーは全て、 * sEventHandlerをそのままAddEventListenerに渡す。 * * onClick * onDblClick */ return sEventHandler.toLowerCase(); }else{ /** * 上記以外のイベントハンドラーは全て、 * エラーとして扱う。 */ throw new Error(); }; }, /** * getOptionSet * インスタンス生成時のオプションセットを取得します。 * * @return * Hash Table */ getOptionSet: function( htArgu ) { var _option = { holderID : null, // {String} controllerとdisplayのコンテナ controller : null, // {String} class="controller"配下のタグを収集 display : null, // {String} class="display"が付与された要素のdisplay値をcontrollerから操作 rememberLastTab : false, eventHandler : "click", defaultView : 1 // tabOptions : { // tabStyle : "text", {String} text || image // hover : "_hover", {String} // active : "_active", {String} // imgHoverClass : "li_hov" {String} // } }; if( typeof htArgu === undefined ) htArgu = new Object; for( var x in htArgu ) _option[x] = htArgu[x]; return _option; } }); })( 'nj.TabSwitcher' ); /** * rollOverImage * * Jindo: 2.1.0.1 * Added: 2009-10-06 */ if (typeof rollOverImage == 'undefined') { var rollOverImage = $Class({ $init : function(){ var options = this.opt = this._getOptionSet( arguments[0] ); this._base = $( options.id ); if ( !this._base ) return; this.imgArr = $$("#"+this.opt.id+" ."+this.opt.imgCss); this._addEvent(); }, _getOptionSet : function(argu) { var option = { imgCss : "_rollOver", imgOn : "_on" }; if (typeof argu == "undefined") argu = new Object; for(var x in argu) option[x] = argu[x]; return option; }, _addEvent : function() { var len = $A(this.imgArr).length(); var arr = $A(this.imgArr).$value(); $Fn(this.over, this).attach(arr, "mouseover"); $Fn(this.out, this).attach(arr, "mouseout"); }, over : function(e){ e = e.currentElement; var src = e.src; var on = this.opt.imgOn; src = src.replace(new RegExp('(^.+)(\..{3}$)'), "$1"+on+"$2"); e.src = src; }, out : function(e){ e = e.currentElement; var src = e.src; var on = this.opt.imgOn; src = src.replace(new RegExp('(^.*)'+on+'(\..{3}$)'), "$1$2"); e.src = src; } }); } /** * popupWin * * Jindo: 2.0.3.5 * Added: 2009-10-06 */ if (typeof popupWin == 'undefined') { var popupWin = $Class({ $init : function(){ var options = this.opt = this._getOptionSet( arguments[0] ); this._base = $( options.id ); if ( !this._base ) return; this.openArr = $$("#"+this.opt.id+" ."+this.opt.openClass, this._base); this.closeArr = $$("#"+this.opt.id+" ."+this.opt.closeClass, this._base); this.openerArr = $$("#"+this.opt.id+" ."+this.opt.opener, this._base); this._addEvent(); }, _getOptionSet : function(argu) { var option = { openClass : 'popup', closeClass : 'close', opener : 'opener', position : null }; if (typeof argu == "undefined") argu = new Object; for(var x in argu) option[x] = argu[x]; return option; }, _addEvent : function() { if(this.openArr.length > 0) $Fn(this.open, this).attach(this.openArr, "click"); if(this.closeArr.length > 0) $Fn(this.close, this).attach(this.closeArr, "click"); if(this.openerArr.length > 0) $Fn(this.opener, this).attach(this.openerArr, "click"); }, opener : function(e){ var el = e.currentElement; var url = el.href; if (!window.opener) return; window.opener.top.location = url; e.stop(); }, open : function(e){ var el = e.currentElement; var winLink = el.href; var option = this.option = el.rel; var winName = el.target || el.name; if(!winName) winName = ""; if(!option) option = ""; if(this.opt.position && option != "") { option = this.winPos() + "," + option; } var w = window.open(winLink, winName, option); w.focus(); e.stop(); }, winPos : function(){ var p = this.opt.position; var l, t, w, h; var el = this.option; var reg1 = /^.*width=([0-9]+)\,.*$/; var reg2 = /^.*height=([0-9]+)\,.*$/; if(reg1.test(el)) w = RegExp.$1; if(reg2.test(el)) h = RegExp.$1; switch(p){ case "center" : l = (window.screen.width - w) / 2; t = (window.screen.height - h) / 2; break; case "right" : l = window.screen.width - w - 10; t = 0; break; case "left" : l = 0; t = 0; break; } var pos = "top="+ t +",left="+ l; return pos; }, close : function(){ window.close(); } }); } /** * nj.fx * * Jindo: 2.1.2.2 * Added: 2009.11.13 */ if (typeof nj.fx == 'undefined') { ( function( namespace ) { var pkg = $.verifyPackageName( namespace ); pkg.container[ pkg.name ] = $Class({ $init : function(){ this.easeObj = $(arguments[0]); if(!this.easeObj) return; this.defaultOptions = { sec : 1, ease : 'linear', delay : 0, onStart : null, onStartParams :null, onUpdate : null, onUpdateParams : null, onComplete : null, onCompleteParams : null, axis : null }; this.onEasing = false; this.objects = []; this.easingFunctionsLowerCase = {}; for (var key in easingFunctions) { this.easingFunctionsLowerCase[key.toLowerCase()] = easingFunctions[key]; } }, _toNum : function(v){ return (v+'').match(/[0-9\.]/) ? Number((v+'').replace(/[^0-9\.]/g,'')) : 0; }, _fill : function(v,p){ return v.replace(/\[(.*?)\]/g, function($0,$1){ var key = $1.replace(/^\s*(.*?)\s*/,'$1'); return p[key] ? p[key] : p[key] == 0 ? p[key] : ''; } ) }, _easeFunc : function(easeName){ return !easeName? null : (typeof easeName == 'function')? easeName : this.easingFunctionsLowerCase[easeName.toLowerCase()]; }, tween : function(options){ var o = {}; o.target = this.easeObj; o.targetPropeties = {}; for(var key in this.defaultOptions){ if(options[key] || options[key] == 0){ o[key] = options[key]; delete options[key]; }else{ o[key] = this.defaultOptions[key]; } } o.easing = this._easeFunc.call(this,o.ease); for(var key in options){ var param = options[key]; var from = (!!param.from || param.from == 0) ? param.from : this._toNum($Element(this.easeObj).css(key)); if(key == 'alpha'){ var from = (!!param.from || param.from == 0) ? param.from : this._toNum($Element(this.easeObj).css('opacity')); } o.targetPropeties[key] = { direct:{ from:from ,to:param.to - from } ,unit:param.unit || '' ,template:param.template || '[value]px' ,filter:param.filter || function(val){return {value:val}} ,easing:this._easeFunc.call(this,param.ease) || o.easing }; if(key == 'height' && o.axis == 'center'){ o.targetPropeties['top'] = { direct:{ from:this._toNum($Element(this.easeObj).css('top')) ,to:-(param.to - from)/2 } ,unit:param.unit || '' ,template:param.template || '[value]px' ,filter:param.filter || function(val){return {value:val}} ,easing:this._easeFunc.call(this,param.ease) || o.easing }; } if(key == 'width' && o.axis == 'center'){ o.targetPropeties['left'] = { direct:{ from:this._toNum($Element(this.easeObj).css('left')) ,to:-(param.to - from)/2 } ,unit:param.unit || '' ,template:param.template || '[value]px' ,filter:param.filter || function(val){return {value:val}} ,easing:this._easeFunc.call(this,param.ease) || o.easing }; } } var _this = this; setTimeout(function(){ o.startTime = (new Date() - 0); o.endTime = (o.sec * 1000) + o.startTime; if(typeof o.onStart == 'function'){ if(o.onStartParams){ o.onStart.apply(o,o.onStartParams); }else{ o.onStart(); } } _this.objects.push(o); if(!_this.onEasing){ _this.onEasing = true; _this._eventLoop.call(_this); } }, o.delay * 1000); }, _eventLoop : function(){ var now = (new Date() - 0); for (var i = 0; i < this.objects.length; i++) { var o = this.objects[i]; var t = now - o.startTime; var d = o.endTime - o.startTime; if (t >= d) { for (var property in o.targetPropeties) { var prop = o.targetPropeties[property]; var b = prop.direct.from; var c = prop.direct.to; if (property == 'alpha') { // $Element(o.target).opacity(this._fill(prop.template, prop.filter(c+b))); $Element(o.target).opacity(prop.filter(c+b).value); }else { $Element(o.target).css(property,this._fill(prop.template,prop.filter(c+b))); } } this.objects.splice(i, 1); if (typeof o.onComplete == 'function') { if (o.onCompleteParams) { o.onComplete.apply(o, o.onCompleteParams); } else { o.onComplete(); } } } else { for (var property in o.targetPropeties) { var prop = o.targetPropeties[property]; var b = prop.direct.from; var c = prop.direct.to; var val = prop.easing(t, b, c, d); if (property == 'alpha') { // $Element(o.target).opacity(this._fill(prop.template, prop.filter(val)); $Element(o.target).opacity(prop.filter(val).value); }else{ $Element(o.target).css(property, this._fill(prop.template, prop.filter(val))); } } if (typeof o.onUpdate == 'function') { if (o.onUpdateParams) { o.onUpdate.apply(o, o.onUpdateParams); } else { o.onUpdate(); } } } } if (this.objects.length > 0) { var _this = this; setTimeout(function() { _this._eventLoop() }, 20); } else { this.onEasing = false; } } }); var easingFunctions = { linear: function(t, b, c, d) { return c*t/d + b; }, easeInQuad: function(t, b, c, d) { return c*(t/=d)*t + b; }, easeOutQuad: function(t, b, c, d) { return -c *(t/=d)*(t-2) + b; }, easeInOutQuad: function(t, b, c, d) { if((t/=d/2) < 1) return c/2*t*t + b; return -c/2 *((--t)*(t-2) - 1) + b; }, easeInCubic: function(t, b, c, d) { return c*(t/=d)*t*t + b; }, easeOutCubic: function(t, b, c, d) { return c*((t=t/d-1)*t*t + 1) + b; }, easeInOutCubic: function(t, b, c, d) { if((t/=d/2) < 1) return c/2*t*t*t + b; return c/2*((t-=2)*t*t + 2) + b; }, easeOutInCubic: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutCubic(t*2, b, c/2, d); return easingFunctions.easeInCubic((t*2)-d, b+c/2, c/2, d); }, easeInQuart: function(t, b, c, d) { return c*(t/=d)*t*t*t + b; }, easeOutQuart: function(t, b, c, d) { return -c *((t=t/d-1)*t*t*t - 1) + b; }, easeInOutQuart: function(t, b, c, d) { if((t/=d/2) < 1) return c/2*t*t*t*t + b; return -c/2 *((t-=2)*t*t*t - 2) + b; }, easeOutInQuart: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutQuart(t*2, b, c/2, d); return easingFunctions.easeInQuart((t*2)-d, b+c/2, c/2, d); }, easeInQuint: function(t, b, c, d) { return c*(t/=d)*t*t*t*t + b; }, easeOutQuint: function(t, b, c, d) { return c*((t=t/d-1)*t*t*t*t + 1) + b; }, easeInOutQuint: function(t, b, c, d) { if((t/=d/2) < 1) return c/2*t*t*t*t*t + b; return c/2*((t-=2)*t*t*t*t + 2) + b; }, easeOutInQuint: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutQuint(t*2, b, c/2, d); return easingFunctions.easeInQuint((t*2)-d, b+c/2, c/2, d); }, easeInSine: function(t, b, c, d) { return -c * Math.cos(t/d *(Math.PI/2)) + c + b; }, easeOutSine: function(t, b, c, d) { return c * Math.sin(t/d *(Math.PI/2)) + b; }, easeInOutSine: function(t, b, c, d) { return -c/2 *(Math.cos(Math.PI*t/d) - 1) + b; }, easeOutInSine: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutSine(t*2, b, c/2, d); return easingFunctions.easeInSine((t*2)-d, b+c/2, c/2, d); }, easeInExpo: function(t, b, c, d) { return(t==0) ? b : c * Math.pow(2, 10 *(t/d - 1)) + b - c * 0.001; }, easeOutExpo: function(t, b, c, d) { return(t==d) ? b+c : c * 1.001 *(-Math.pow(2, -10 * t/d) + 1) + b; }, easeInOutExpo: function(t, b, c, d) { if(t==0) return b; if(t==d) return b+c; if((t/=d/2) < 1) return c/2 * Math.pow(2, 10 *(t - 1)) + b - c * 0.0005; return c/2 * 1.0005 *(-Math.pow(2, -10 * --t) + 2) + b; }, easeOutInExpo: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutExpo(t*2, b, c/2, d); return easingFunctions.easeInExpo((t*2)-d, b+c/2, c/2, d); }, easeInCirc: function(t, b, c, d) { return -c *(Math.sqrt(1 -(t/=d)*t) - 1) + b; }, easeOutCirc: function(t, b, c, d) { return c * Math.sqrt(1 -(t=t/d-1)*t) + b; }, easeInOutCirc: function(t, b, c, d) { if((t/=d/2) < 1) return -c/2 *(Math.sqrt(1 - t*t) - 1) + b; return c/2 *(Math.sqrt(1 -(t-=2)*t) + 1) + b; }, easeOutInCirc: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutCirc(t*2, b, c/2, d); return easingFunctions.easeInCirc((t*2)-d, b+c/2, c/2, d); }, easeInElastic: function(t, b, c, d, a, p) { var s; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(!a || a < Math.abs(c)) { a=c; s=p/4; } else s = p/(2*Math.PI) * Math.asin(c/a); return -(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p )) + b; }, easeOutElastic: function(t, b, c, d, a, p) { var s; if(t==0) return b; if((t/=d)==1) return b+c; if(!p) p=d*.3; if(!a || a < Math.abs(c)) { a=c; s=p/4; } else s = p/(2*Math.PI) * Math.asin(c/a); return(a*Math.pow(2,-10*t) * Math.sin((t*d-s)*(2*Math.PI)/p ) + c + b); }, easeInOutElastic: function(t, b, c, d, a, p) { var s; if(t==0) return b; if((t/=d/2)==2) return b+c; if(!p) p=d*(.3*1.5); if(!a || a < Math.abs(c)) { a=c; s=p/4; } else s = p/(2*Math.PI) * Math.asin(c/a); if(t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p )) + b; return a*Math.pow(2,-10*(t-=1)) * Math.sin((t*d-s)*(2*Math.PI)/p )*.5 + c + b; }, easeOutInElastic: function(t, b, c, d, a, p) { if(t < d/2) return easingFunctions.easeOutElastic(t*2, b, c/2, d, a, p); return easingFunctions.easeInElastic((t*2)-d, b+c/2, c/2, d, a, p); }, easeInBack: function(t, b, c, d, s) { if(s == undefined) s = 1.70158; return c*(t/=d)*t*((s+1)*t - s) + b; }, easeOutBack: function(t, b, c, d, s) { if(s == undefined) s = 1.70158; return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b; }, easeInOutBack: function(t, b, c, d, s) { if(s == undefined) s = 1.70158; if((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b; return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b; }, easeOutInBack: function(t, b, c, d, s) { if(t < d/2) return easingFunctions.easeOutBack(t*2, b, c/2, d, s); return easingFunctions.easeInBack((t*2)-d, b+c/2, c/2, d, s); }, easeInBounce: function(t, b, c, d) { return c - easingFunctions.easeOutBounce(d-t, 0, c, d) + b; }, easeOutBounce: function(t, b, c, d) { if((t/=d) <(1/2.75)) { return c*(7.5625*t*t) + b; } else if(t <(2/2.75)) { return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b; } else if(t <(2.5/2.75)) { return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b; } else { return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b; } }, easeInOutBounce: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeInBounce(t*2, 0, c, d) * .5 + b; else return easingFunctions.easeOutBounce(t*2-d, 0, c, d) * .5 + c*.5 + b; }, easeOutInBounce: function(t, b, c, d) { if(t < d/2) return easingFunctions.easeOutBounce(t*2, b, c/2, d); return easingFunctions.easeInBounce((t*2)-d, b+c/2, c/2, d); } }; })( "nj.fx" ); } /** * nj.HgAlert * * Require: nj.fx * Jindo: 2.1.2.2 * Added: 2009.11.24 */ (function(namespace) { var pkg = $.verifyPackageName(namespace); pkg.container[pkg.name] = $Class({ ALERT: 1, CONFIRM: 2, $init: function(oOpt) { this.opt = this._getOptions(oOpt); this._loadCss(); }, _getOptions: function(args) { var options = { css: "#hgAlertMask{position:absolute;left:0;top:0;z-index:2147483646;width:100%;height:100%;background-color: #000;opacity:0;filter:alpha(style=0, opacity=0);}#hgAlert{position:absolute;left:0;top:0;z-index:2147483647;width:352px;padding:4px 0 0;color:#666;font-family:'Hiragino Kaku Gothic Pro', 'MS PGothic', sans-serif;font-size:13px;line-height:1.333;}/* head------------------------- */#hgAlert .h{height:34px;padding:0 12px;background:url(http://images.hangame.co.jp/hangame/common/alert/bg_t.png) no-repeat 0 0;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/alert/bg_t.png', sizingMethod='crop');}#hgAlert .h p{position:relative;zoom:1;margin:0;cursor:default;}#hgAlert .h p img{position:absolute;right:6px;top:9px;cursor:pointer;}/* contents------------------------- */#hgAlert .c{zoom:1;padding:10px 22px 8px;background:url(http://images.hangame.co.jp/hangame/common/alert/bg_m.png) repeat-y 0 0;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/alert/bg_m.png', sizingMethod='scale');}#hgAlert .c p{position:relative;margin:0;text-align:center;}/* ul------------------------- */#hgAlert ul{height:60px;margin:0;padding:0 22px;background:url(http://images.hangame.co.jp/hangame/common/alert/bg_b.png) repeat-y 0 bottom;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/alert/bg_b.png', sizingMethod='crop');list-style:none;text-align:center;}#hgAlert li{display:inline;position:relative;margin:0;}#hgAlert li button{font-family:'Hiragino Kaku Gothic Pro', 'MS PGothic';cursor:pointer;height:22px;margin:0 2px;color:#000;*line-height:14px;}html>/**/body #hgAlert li button{line-height /*\**/:14px\9;}#hgAlert li button.s{*padding:0 3px 0 4px;}", // css: "#hgAlertMask{position:absolute;left:0;top:0;z-index:2147483646;width:100%;height:100%;background-color: #000;opacity:0;filter:alpha(style=0, opacity=0);}#hgAlert{position:absolute;left:0;top:0;z-index:2147483647;width:352px;padding:4px 0 0;color:#666;font-family:'Hiragino Kaku Gothic Pro', 'MS PGothic', sans-serif;font-size:13px;line-height:1.333;}#hgAlert .h{height:34px;padding:0 12px;background:url(http://images.hangame.co.jp/hangame/common/alert/bg_t.png) no-repeat 0 0;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/alert/bg_t.png', sizingMethod='crop');}#hgAlert .h p{position:relative;zoom:1;margin:0;cursor:default;}#hgAlert .h p img{position:absolute;right:5px;top:9px;cursor:pointer;}#hgAlert .c{zoom:1;padding:10px 22px 8px;background:url(http://images.hangame.co.jp/hangame/common/alert/bg_m.png) repeat-y 0 0;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/alert/bg_m.png', sizingMethod='scale');}#hgAlert .c p{position:relative;margin:0;text-align:center;}#hgAlert ul{height:60px;margin:0;padding:0 22px;background:url(http://images.hangame.co.jp/hangame/common/alert/bg_b.png) repeat-y 0 bottom;_background:none;_filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src='https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/alert/bg_b.png', sizingMethod='crop');list-style:none;text-align:center;}#hgAlert li{display:inline;position:relative;margin:0;}#hgAlert li button{font-family:'Hiragino Kaku Gothic Pro', 'MS PGothic';cursor:pointer;height:22px;*line-height:14px;}html>/**/body #hgAlert li button{line-height /*\**/:14px\9;}#hgAlert li button.s{*padding:0 3px 0 4px;}", tweenOn: true, mask: { node: '
', id: 'hgAlertMask' }, alert: { node: '
', id: 'hgAlert', head: { node: '
', className: 'h', inner: { node: '

', close: { node: '', src : 'https://web.archive.org/web/20110819122812/http://images.hangame.co.jp/hangame/common/ico_note.gif', width: 14, height: 12, alt: '閉じる' } } }, msgBox: { node: '

', className: 'c', msg: { node: '

' } }, btnBox: { node: '

    ', list: { node: '
  • ', display: 'inline', buttons: { node: '