//if(typeof hgoAl == "undefined"){var hgoAl = {}}; //$j(document).ready(function(){ // gcSubmenu = new hg.Submenu(); //}) if(typeof hg == "undefined"){var hg = {}}; hg.Submenu = function(){ this.hOption = this._getOpts(arguments[0]); this._getGlobalMenu(); this._setEvent(); } hg.Submenu.prototype = { _getOpts : function(opt){ var option = { }; if(typeof opt == 'undefined') opt = new Object; for(var v in opt) option[v] = opt[v]; return option; }, _getGlobalMenu : function(){ this.aGlobalMenuA = $j('#globalNavi ul:first a'); this.aGlobalMenuIMG = $j('#globalNavi ul:first img'); this.aSubMenuSet = $j('#subMenu ul'); $j.each(this.aSubMenuSet,function(i,v){ }); }, _setEvent : function(){ var _this = this; $j.each(this.aGlobalMenuA,function(i,v){ $j(v).mouseover(function(){ _this._onGlobalMenu(i); }) $j(v).mouseout(function(){ _this._outGlobalMenu(i); }) }); $j.each(this.aSubMenuSet,function(i,v){ $j(v).mouseenter(function(){ _this._onSubMenu(i); }) $j(v).mouseleave(function(){ _this._outSubMenu(i); }) }) }, _onGlobalMenu : function(num){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } this.nCurrentOverNum = num; this._resetGlobalMenu(); this._activeGlobalMenu(num); this._resetSubMenu(); this._activeSubMenu(num); //console.log(this.nGLeft); //console.log(this.nGWidth); //console.log(this.nSWidth); this.nSLeft = (this.nGWidth/2 + this.nGLeft) - this.nSWidth/2; //console.log(this.nSLeft); this.nMinSLeft = 0; this.nMaxSLeft = 880 - this.nSWidth; if(this.nSLeft > this.nMaxSLeft){ this.nSLeft = this.nMaxSLeft; } if(this.nSLeft < this.nMinSLeft){ this.nSLeft = this.nMinSLeft; } $j(this.aSubMenuSet[num]).css('left',this.nSLeft+'px') //console.log($j(this.aSubMenuSet[num])) }, _outGlobalMenu : function(){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } var _this = this; this.oResetTimer = setTimeout(function(){_this._resetAll()},300); }, _resetAll : function(){ this._resetGlobalMenu(); this._resetSubMenu(); }, _onSubMenu : function(num){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } //this.this.aSubMenuSet.hide(); //this._resetSubMenu(); }, _outSubMenu : function(){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } var _this = this; this.oResetTimer = setTimeout(function(){_this._resetAll()},300); }, _activeGlobalMenu : function(num){ var elm = this.aGlobalMenuIMG[num]; var src = elm.src; var on = '_on'; elm.src = src.replace(new RegExp('(^.+)(\..{3}$)'), "$1"+on+"$2"); this.nGLeft = $j(elm).position().left; this.nGWidth = $j(elm).width(); }, _resetGlobalMenu : function(){ $j.each(this.aGlobalMenuIMG,function(i,v){ var src = v.src; var on = '_on'; v.src = src.replace(new RegExp('(^.*)'+on+'(\..{3}$)'), "$1$2"); }) }, _activeSubMenu : function(num){ $j(this.aSubMenuSet[num]).fadeIn(200); this.nSWidth = $j(this.aSubMenuSet[num]).width(); }, _resetSubMenu : function(){ $j.each(this.aSubMenuSet,function(i,v){ //$j(v).fadeOut(200); $j(v).hide(); }) } } hg.SwitchCont = function(){ this.hOption = this._getOpts(arguments[0]); this.aThumbElm = this.hOption.thumbElmList; this.aContElm = this.hOption.contElmList; this.eImageElm = this.hOption.imageElmList; this.weImageElm = $j(this.eImageElm); this._setThumbEvent(); //this._getGlobalMenu(); //this._setEvent(); if(this.aContElm){ this.changeCont(this.aThumbElm[0],0); }else if(this.eImageElm){ this.changeImage(null,this.aThumbElm[0],0); } } hg.SwitchCont.prototype = { _getOpts : function(opt){ var option = { }; if(typeof opt == 'undefined') opt = new Object; for(var v in opt) option[v] = opt[v]; return option; }, _setThumbEvent : function(){ var _this = this; $j.each(this.aThumbElm,function(i,v){ $j(v).click(function(event){ if(_this.aContElm){ _this.changeCont(this,i); }else if(_this.eImageElm){ _this.changeImage(event,this,i); } }) }) }, changeCont : function(e,num){ if(this.nActiveNum == num) return; this._setActiveThumb(e); this.nActiveNum = num; if(this.welActiveCont) this.welActiveCont.fadeOut(100); this.welActiveCont = $j(this.aContElm[num]); this.welActiveCont.fadeIn(100); }, changeImage : function(ev,e,num){ if(ev) ev.preventDefault(); if(this.nActiveNum == num) return; this._setActiveThumb(e); this.nActiveNum = num; this.weImageElm.fadeOut(100); if(e) this.eImageElm[0].src = e.href; this.weImageElm.fadeIn(100); }, _setActiveThumb : function(e){ if(this.welActiveThumb) this.welActiveThumb.removeClass('active'); this.welActiveThumb = $j(e); this.welActiveThumb.addClass('active'); }, _getGlobalMenu : function(){ this.aGlobalMenuA = $j('#globalNavi ul:first a'); this.aGlobalMenuIMG = $j('#globalNavi ul:first img'); this.aSubMenuSet = $j('#subMenu ul'); $j.each(this.aSubMenuSet,function(i,v){ }); }, _setEvent : function(){ var _this = this; $j.each(this.aGlobalMenuA,function(i,v){ $j(v).mouseover(function(){ _this._onGlobalMenu(i); }) $j(v).mouseout(function(){ _this._outGlobalMenu(i); }) }); $j.each(this.aSubMenuSet,function(i,v){ $j(v).mouseenter(function(){ _this._onSubMenu(i); }) $j(v).mouseleave(function(){ _this._outSubMenu(i); }) }) }, _onGlobalMenu : function(num){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } this.nCurrentOverNum = num; this._resetGlobalMenu(); this._activeGlobalMenu(num); this._resetSubMenu(); this._activeSubMenu(num); //console.log(this.nGLeft); //console.log(this.nGWidth); //console.log(this.nSWidth); this.nSLeft = (this.nGWidth/2 + this.nGLeft) - this.nSWidth/2; //console.log(this.nSLeft); this.nMinSLeft = 0; this.nMaxSLeft = 880 - this.nSWidth; if(this.nSLeft > this.nMaxSLeft){ this.nSLeft = this.nMaxSLeft; } if(this.nSLeft < this.nMinSLeft){ this.nSLeft = this.nMinSLeft; } $j(this.aSubMenuSet[num]).css('left',this.nSLeft+'px') //console.log($j(this.aSubMenuSet[num])) }, _outGlobalMenu : function(){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } var _this = this; this.oResetTimer = setTimeout(function(){_this._resetAll()},300); }, _resetAll : function(){ this._resetGlobalMenu(); this._resetSubMenu(); }, _onSubMenu : function(num){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } //this.this.aSubMenuSet.hide(); //this._resetSubMenu(); }, _outSubMenu : function(){ if(this.oResetTimer){ clearTimeout(this.oResetTimer); this.oResetTimer = null; } var _this = this; this.oResetTimer = setTimeout(function(){_this._resetAll()},300); }, _activeGlobalMenu : function(num){ var elm = this.aGlobalMenuIMG[num]; var src = elm.src; var on = '_on'; elm.src = src.replace(new RegExp('(^.+)(\..{3}$)'), "$1"+on+"$2"); this.nGLeft = $j(elm).position().left; this.nGWidth = $j(elm).width(); }, _resetGlobalMenu : function(){ $j.each(this.aGlobalMenuIMG,function(i,v){ var src = v.src; var on = '_on'; v.src = src.replace(new RegExp('(^.*)'+on+'(\..{3}$)'), "$1$2"); }) }, _activeSubMenu : function(num){ $j(this.aSubMenuSet[num]).fadeIn(200); this.nSWidth = $j(this.aSubMenuSet[num]).width(); }, _resetSubMenu : function(){ $j.each(this.aSubMenuSet,function(i,v){ //$j(v).fadeOut(200); $j(v).hide(); }) } } /* spot deck.js */ var SpotDeckCI = $Class({ $init : function(){ var options = this.opt = this._getOptions(arguments[0]); this.active = null; this.thumbHrefAry = new Array(); this.thumbSrcAry = new Array(); this.thumbTitleAry = new Array(); this.thumbObjAry = new Array(); this.ssObjAry = new Array(); this.navThumbObjAry = new Array(); this.animID = 'ssuianimated'; this.ssImgObj = null; this.ssDisc = null; this.easeItvID = null; this.currentIndex = null; //this.moving = false; this.thumbObj = $(this.opt.thumbID); this._setThumbEvent(); this._easeS = 3; //this._animated = false; this.bodyElm = $Element(document.body); }, _getOptions : function(param){ var option = { //animated : false, close : true }; if (typeof param == "undefined") param = new Object; for(var x in param) option[x] = param[x]; return option; }, _setThumbEvent : function(){ this.thumbObjAry = cssquery("a."+this.opt.aClass, this.thumbObj); this.thumbLength = this.thumbObjAry.length; var onThumbClickFn = $Fn(this.onThumbClick, this).bind(); var _this = this; $A(this.thumbObjAry).forEach( function(v, i){ _this.thumbSrcAry.push($$("img", v)[0].src); _this.thumbHrefAry.push(v.href); _this.thumbTitleAry.push(v.title); $Fn(onThumbClickFn, _this).attach(v, "click"); } ); this._preLoad(this.thumbHrefAry); }, _preLoad : function(hrefAry){ var _this = this; $A(hrefAry).forEach( function(v, i){ var imgObj = new Image(); imgObj.src = v; _this.ssObjAry.push(imgObj); } ); }, onThumbClick : function(e){ e.stop(); if(this.moving) return; this._mask(); if($(this.opt.layerID)){ //2回目以降 if($Element($(this.opt.layerID)).css('display') != 'block'){ //非表示中 this._chgLayerVis(false); this._chgImg($A(this.thumbHrefAry).indexOf(e.currentElement.href)); this._setLayer(); //if(this.opt.animated)this._openAnimation(e); else this._showLayer(); this._showLayer(); return; }else{ //表示中 this._resize(); this._chgImg($A(this.thumbHrefAry).indexOf(e.currentElement.href)); //this.closeLayer(); return; } } //初回 this._makeLayerTag($A(this.thumbHrefAry).indexOf(e.currentElement.href)); //if(this.opt.animated) this._openAnimation(e); else this._showLayer(); this._showLayer(); }, _maskClick : function(){ this.closeLayer(); }, _closeEnd : function(){ this.ssImgObj.src = ''; //this._chgMovingFlg(false); }, _getPosition : function(el) { var p = { x: el.offsetLeft, y: el.offsetTop }; while (el.offsetParent) { el = el.offsetParent; p.x += el.offsetLeft; p.y += el.offsetTop; if (el != document.body && el != document.documentElement) { p.x -= el.scrollLeft; p.y -= el.scrollTop; } } return p; }, _setActiveThumb : function(num){ $A(this.navThumbObjAry).forEach( function(v, i){ $Element(v).removeClass('active'); } ); $Element(this.navThumbObjAry[num]).addClass('active'); }, _setLayerPos : function(elm){ this._setElmCenter(elm); }, _setElmCenter : function(elm){ elm = $Element(elm); var wSize = this._getWindowSize(); var pSize = this._getPageSize(); var cSizeObj = this._getContentSize(elm); var st = document.documentElement.scrollTop || document.body.scrollTop; var sl = document.documentElement.scrollLeft || document.body.scrollLeft; elm.css({left:'0px',top:'0px'}); elm.css({left:parseInt(pSize["2"]/2-cSizeObj["w"]/2 + sl)+"px",top:parseInt(pSize["3"]/2-cSizeObj["h"]/2 + st) + "px"}); }, _getPageSize : function(){ var xScroll,yScroll; if(document.compatMode && document.compatMode != "BackCompat"){ //Standard xScroll = document.documentElement.scrollWidth; yScroll = document.documentElement.scrollHeight; }else{ //Quirks xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.compatMode && document.compatMode != "BackCompat") { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else{ windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } var pageHeight = Math.max(windowHeight,yScroll); var pageWidth = Math.max(windowWidth,xScroll); arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; }, _getContentSize : function(elm){ elm = $Element(elm); if(elm.css('display') == 'none'){ elm.css('visibility','hidden'); elm.show(); var hideFlg = true; } var w = elm.width(); var h = elm.height(); if(hideFlg){ elm.hide(); elm.css('visibility','visible'); } return {w:w, h:h}; }, _getWindowSize : function(){ var wSize = new Object(); if($Agent().navigator().ie) { wSize.w = document.documentElement.clientWidth; wSize.h = document.documentElement.clientHeight; } else { wSize.w = window.innerWidth; wSize.h = window.innerHeight; } return wSize; }, _chgImg : function(e){ if(typeof(e) == 'object'){ e.stop(); //blur(); $(this.opt.layerID).focus(); var ssIndex = $A(this.thumbHrefAry).indexOf(e.currentElement.href); }else{ var ssIndex = e } this.ssImgObj.src = this.ssObjAry[ssIndex].src; this._chgTitle(ssIndex); ////this.ssDisc.innerHTML = this.thumbTitleAry[ssIndex]; //this._setActiveThumb(ssIndex); this.currentIndex = ssIndex; }, _chgTitle : function(i){ if(this.ssDisc.firstChild) this.ssDisc.removeChild(this.ssDisc.firstChild); var p = $('

'); p.innerHTML = this.thumbTitleAry[i]; this.ssDisc.appendChild(p); }, _chgImgNP : function(e,type){ e.stop(); $(this.opt.layerID).focus(); if(type == 'next'){ var nextIndex = ++this.currentIndex; if(nextIndex >= this.thumbLength)nextIndex = 0; }else{ var nextIndex = --this.currentIndex; if(nextIndex < 0)nextIndex = this.thumbLength-1; } this.ssImgObj.src = this.ssObjAry[nextIndex].src; this._chgTitle(nextIndex); this.currentIndex = nextIndex; }, _makeLayerTag : function(num){ var rootDiv = $('

'); rootDiv.id = this.opt.layerID; var rootDivElm = $Element(rootDiv); var ssImgDiv = $('
'); ssImgDiv.className = 'ssImgDiv'; var ssImg = $(''); ssImg.className = 'ssImg'; ssImg.border = 0; ssImg.alt = ''; ssImg.width = this.opt.width; ssImg.height = this.opt.height; this.ssImgObj = ssImg; $Element(ssImgDiv).append($Element(ssImg)); rootDivElm.append($Element(ssImgDiv)); var navP = $('
'); navP.className = 'linerNav'; var navPElm = $Element(navP); var prevImg = $('
'); prevImg.className='previous'; prevImg.innerHTML='前へ'; $Element(prevImg).css('cursor','pointer'); $Fn(function(e){this._chgImgNP(e,'prev');},this).attach(prevImg,'click'); var nextImg = $('
'); nextImg.className='next'; nextImg.innerHTML='次へ'; $Element(nextImg).css('cursor','pointer'); $Fn(function(e){this._chgImgNP(e,'next');},this).attach(nextImg,'click'); this.ssDisc = $('
'); this.ssDisc.className='ssDisc'; //this.ssDisc.innerHTML = this.thumbTitleAry[num]; navPElm.append(prevImg); navPElm.append(this.ssDisc); navPElm.append(nextImg); rootDivElm.append(navPElm); var closeDiv = $('
'); var closeDivElm = $Element(closeDiv); closeDiv.className = 'ssClose'; closeDivElm.css('cursor','pointer'); closeDiv.href = '#'; closeDivElm.text('close'); $Fn(this.closeLayer, this).attach(closeDiv, 'click'); rootDivElm.append($Element(closeDiv)); this._chgImg(num); this.bodyElm.append(rootDiv); $Element($(this.opt.layerID)).css({'zIndex':99999,'position':'absolute'}); this._chgLayerVis(false); this._setLayer(); }, closeLayer : function(e){ if(e)e.stop(); $Element(this.opt.layerID).hide(); var maskObj = $('sdjs_mask'); if(maskObj) maskObj.parentNode.removeChild(maskObj); this._clearEvent(); this._closeEnd(); }, _setLayer : function(e){ if($(this.opt.layerID)){ $Element(this.opt.layerID).show(); this._setLayerPos($(this.opt.layerID)); if(this.opt.close){ this.closeFn = $Fn(this.closeLayer, this).attach(document, 'click'); $Fn(this._layerClick, this).attach($Element(this.opt.layerID), "click"); } } }, _resize : function(){ this._setLayerPos($(this.opt.layerID)); }, _showLayer : function(){ this._chgLayerVis(true) $Element(this.opt.layerID).show(); }, _mask : function(){ var mask = $("
"); mask.id = 'sdjs_mask'; var maskElem = $Element(mask); maskElem.css({"position":"absolute","left":"0px","top":"0px","width":"100%","height":(this._getPageSize()[1]+0)+"px","zIndex":"99997"}) $Element(document.body).append(mask); var maskResize = function(){ $Element(mask).css("width","100%"); $Element(mask).css("height",(this._getPageSize()[1]+0)+"px"); this._setElmCenter($(this.opt.layerID)); //this._setLayerCloseBtnPos($Element('sdjs_layClose')); }; this.resizeFn = $Fn(maskResize, this).attach(window, "resize"); $Fn(this._maskClick, this).attach(maskElem, "click"); }, _chgLayerVis : function(flg){ var state; (flg)? state = 'visible': state = 'hidden'; $Element(this.opt.layerID).css('visibility',state); }, _getthumbSize : function(elm){ return {w:elm.width(),h:elm.height()}; }, _layerClick : function(e){ e.stop(); }, _clearEvent : function(){ if(this.resizeFn){ this.resizeFn.detach(window,'resize'); this.resizeFn = null } if(this.scrollFn){ this.scrollFn.detach(window,'scroll'); this.scrollFn = null; } if(this.closeFn){ this.closeFn.detach(document,'click'); this.closeFn = null; } } }); var SpotDeckIF=$Class({ $init : function(){ var options = this.opt = this._getOptionSet( arguments[0] ); this._base = $( options.id ); if ( !this._base ) return; //default type this.type = 'image'; this.aClass = this.opt.aClass; this.bodyElm = $Element(document.body); this.loadFnAry = new Array(); this._addEvent(); }, _getOptionSet : function(argu) { var option = {}; if (typeof argu == "undefined") argu = new Object; for(var x in argu) { option[x] = argu[x]; } return option; }, _addEvent : function(){ $Fn(this.disp,this).attach($$('#' + this.opt.id + ' .' + this.opt.className),"click"); $Fn(this.close,this).attach($('sdjs_layClose'),"click"); }, disp : function(e){ e.stop(); //var rel = e.currentElement.rel; var rel = e.currentElement.getAttribute('rel'); if(!rel) return; var json = $Json(rel).$value().data[0]; this._makeLayerHTML(json); }, _getLayerHTML : function(){ var layer = $(this.opt.layerId); document.body.removeChild(layer); return layer; }, _makeLayerHTML : function(json){ if(!json) return; if(json.type)this.type = json.type; var layer = $(this.opt.layerId); if(json.title)$Element($$('#'+this.opt.layerId + ' .sdjs_title')[0]).html(json.title); if(json.no)$Element($$('#'+this.opt.layerId + ' .sdjs_no')[0]).html(json.no); if(json.caption) $Element($$('#'+this.opt.layerId + ' .sdjs_caption')[0]).html(json.caption); if (this.type == 'image') { this.imgTagAry = $$('#' + this.opt.layerId + ' .sdjs_image');console.log(this.imgTagAry); if(this.imgTagAry.length == 0) return; var loadingTagAry = $$('#' + this.opt.layerId + ' .sdjs_loading'); var image = json.image; if (typeof image != 'object')image = [image]; for (var i = 1; i <= image.length; i++) { this.loadFnAry[i - 1] = $Fn(function(e){ this._imgLoaded(e); }, this).attach(this.imgTagAry[i - 1], "load"); this.imgTagAry[i - 1].src = image[i - 1]; } } if(this.type == 'flash'){ var sp = new SwfPutter({src:json.swf, w:json.w, h:json.h}); if(json.addVars) sp.addVars(json.addVars); sp.put('sdjs_movie'); } this._disp(); }, _imgLoaded : function(e){ var num = (e.currentElement.parentNode.className).replace('sdjs_image',''); this.loadFnAry[num-1].detach(this.imgTagAry[num - 1], "load"); $Element(e.currentElement.nextSibling).hide(); }, _disp : function(){ var layerElem = $Element(this.opt.layerId); layerElem.css({"zIndex":"99999","position":"absolute"}); this._setElmCenter($(this.opt.layerId)); layerElem.show(); this._mask(); /*$A($$('select')).forEach(function(v,i){ $Element(v).hide(); })*/ }, _mask : function(){ var mask = $("
"); mask.id = 'sdjs_mask'; var maskElem = $Element(mask); maskElem.css({"position":"absolute","left":"0px","top":"0px","width":"100%","height":(this._getPageSize()[1]+0)+"px","zIndex":"99997"}) $Element(document.body).append(mask); var maskResize = function(){ $Element(mask).css("width","100%"); $Element(mask).css("height",(this._getPageSize()[1]+0)+"px"); this._setElmCenter($(this.opt.layerId)); }; this.resizeFn = $Fn(maskResize, this).attach(window, "resize"); $Fn(this._maskClick, this).attach(maskElem, "click"); }, _maskClick : function(){ this.close(); }, close : function(){ var maskObj = $('sdjs_mask'); if(maskObj) maskObj.parentNode.removeChild(maskObj); $Element(this.opt.layerId).hide(); this._clearLayer(); if(this.resizeFn)this.resizeFn.detach(window, "resize"); /*$A($$('select')).forEach(function(v,i){ $Element(v).show(); })*/ }, _clearLayer : function(){ if($$('#'+this.opt.layerId + ' .sdjs_title')[0])$Element($$('#'+this.opt.layerId + ' .sdjs_title')[0]).html(''); if($$('#'+this.opt.layerId + ' .sdjs_no')[0]) $Element($$('#'+this.opt.layerId + ' .sdjs_no')[0]).html(''); if($$('#'+this.opt.layerId + ' .sdjs_caption')[0]) $Element($$('#'+this.opt.layerId + ' .sdjs_caption')[0]).html(''); $A($$('#'+this.opt.layerId + ' .sdjs_image')).forEach(function(v,i){ v.src = ''; }) $A($$('#'+this.opt.layerId + ' .sdjs_loading')).forEach(function(v,i){ $Element(v).show(); }) if(this.type == 'flash') $Element('sdjs_movie').html(''); }, _setElmCenter : function(elm){ elm = $Element(elm); var wSize = this._getWindowSize(); var pSize = this._getPageSize(); var cSizeObj = this._getContentSize(elm); var st = document.documentElement.scrollTop || document.body.scrollTop; var sl = document.documentElement.scrollLeft || document.body.scrollLeft; elm.css({left:'0px',top:'0px'}); elm.css({left:parseInt(pSize["2"]/2-cSizeObj["w"]/2 + sl)+"px",top:parseInt(pSize["3"]/2-cSizeObj["h"]/2 + st) + "px"}); }, _getPageSize : function(){ var xScroll,yScroll; if(document.compatMode && document.compatMode != "BackCompat"){ //Standard xScroll = document.documentElement.scrollWidth; yScroll = document.documentElement.scrollHeight; }else{ //Quirks xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.compatMode && document.compatMode != "BackCompat") { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else{ windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } var pageHeight = Math.max(windowHeight,yScroll); var pageWidth = Math.max(windowWidth,xScroll); arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; }, _getContentSize : function(elm){ elm = $Element(elm); if(elm.css('display') == 'none'){ elm.css('visibility','hidden'); elm.show(); var hideFlg = true; } var w = elm.width(); var h = elm.height(); if(hideFlg){ elm.hide(); elm.css('visibility','visible'); } return {w:w, h:h}; }, _getWindowSize : function(){ var wSize = new Object(); if($Agent().navigator().ie) { wSize.w = document.documentElement.clientWidth; wSize.h = document.documentElement.clientHeight; } else { wSize.w = window.innerWidth; wSize.h = window.innerHeight; } return wSize; } }); var Static = $Class({ $init : function(id){ this.options = this._getOptionSet( arguments[1] ); this.obj = $(id); var topSpace = 170; var startTop = this._getPageSize()[3]- this.getPos($(this.options.limitArea))[0] - 100; $Element(this.obj).css({'top':startTop + 'px'}); this.init = true; var offset = this.getPos(this.obj)[0]; var bannerElm = $('extraBnrArea'); if(bannerElm){ this.bannerHeight = Math.max($Element('extraBnrArea').height(),topSpace); }else{ this.bannerHeight = topSpace; } if (this.obj.style.position == "") { this.obj.style.position = 'absolute'; if (offset != this.getPos(this.obj)[0]) { this.obj.style.position = 'relative'; } } if (this.obj.style.position == 'absolute') { this.obj.style.top = this.obj.offsetTop+'px'; } else { if (offset == this.getPos(this.obj)[0]) this.obj.style.top = '0px'; else this.obj.style.top = (this.getPos(this.obj)[0] - offset) + 'px'; } this._scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); this._startTop = parseInt(this.obj.style.top); this._startPosY = this.getPos(this.obj)[0]; $Fn(this.onScroll, this).attach(window,"scroll"); $Fn(this.onScroll, this).attach(window,"resize"); this.onScroll(); }, _getOptionSet : function( argu ) { var option = { enable : true, slowDown : false, topTrack : false, topMargin : 0, division : 50, limitArea : null }; if (typeof argu == "undefined") argu = new Object; for(var x in argu) { option[x] = argu[x]; } return option; }, onScroll : function(e) { if (!this.options.enable) return; var scrollTop = Math.max(document.documentElement.scrollTop, document.body.scrollTop); var diff = scrollTop - this._scrollTop; if (this._timer != null) { clearTimeout(this._timer); this._timer = null; } this._targetTop = this._startTop + diff; if (this.options.topTrack) { if (scrollTop + this.options.topMargin > this._startPosY) { this._targetTop -= this._startPosY - this.options.topMargin; } else { this._targetTop = this._startTop; } diff = this._targetTop - this._startTop; } if (this.options.limitArea) { var objY = this.getPos(this.obj)[0]; var area = $(this.options.limitArea); var posY = this.getPos(area)[0]; if (this._startPosY + diff + this.obj.offsetHeight > posY + area.offsetHeight) { diff = posY + area.offsetHeight - this._startPosY - this.obj.offsetHeight; this._targetTop = this._startTop + diff; } } this._changeVisible(); this.init = false; this._timer = setTimeout($Fn(this.animate, this).bind(), 1); }, animate : function() { var currTop = parseInt(this.obj.style.top); var unit = (this._targetTop-currTop)<0?-1:1; var step = Math.ceil(this._targetTop - this._startTop / 100); if (this.options.slowDown) { step = parseInt((this._targetTop - currTop) / this.options.division); if (step == 0) step = unit; } if ((step > 0 && currTop + step > this._targetTop) || (step < 0 && currTop + step < this._targetTop)) { step = this._targetTop - currTop; } if (this._targetTop != currTop) { this.obj.style.top = (currTop+step)+'px'; setTimeout($Fn(this.animate, this).bind(), 10); } }, getPos : function(obj) { var top=0, left=0; while(obj.offsetParent) { top += obj.offsetTop; left += obj.offsetLeft; obj = obj.offsetParent; } return [top, left]; }, setEnable : function(enable) { this.options.enable = enable; }, _getPageSize : function(){ var xScroll,yScroll; if(document.compatMode && document.compatMode != "BackCompat"){ //Standard xScroll = document.documentElement.scrollWidth; yScroll = document.documentElement.scrollHeight; }else{ //Quirks xScroll = document.body.scrollWidth; yScroll = document.body.scrollHeight; } var windowWidth, windowHeight; if (self.innerHeight) { windowWidth = self.innerWidth; windowHeight = self.innerHeight; } else if (document.compatMode && document.compatMode != "BackCompat") { windowWidth = document.documentElement.clientWidth; windowHeight = document.documentElement.clientHeight; } else{ windowWidth = document.body.clientWidth; windowHeight = document.body.clientHeight; } var pageHeight = Math.max(windowHeight,yScroll); var pageWidth = Math.max(windowWidth,xScroll); arrayPageSize = new Array(pageWidth,pageHeight,windowWidth,windowHeight) return arrayPageSize; }, _getContentSize : function(elm){ elm = $Element(elm); var w = elm.width(); var h = elm.height(); return {w:w, h:h}; }, _getWindowSize : function(){ var wSize = new Object(); if($Agent().navigator().ie) { wSize.w = document.documentElement.clientWidth; wSize.h = document.documentElement.clientHeight; } else { wSize.w = window.innerWidth; wSize.h = window.innerHeight; } return wSize; }, _changeVisible : function(){ var yScroll = document.documentElement.scrollTop || document.body.scrollTop; if(yScroll <= 2 || this._targetTop < this.bannerHeight){ if(this.init){ $Element(this.obj).opacity(0); }else{ $Element(this.obj).disappear(0.1); } }else{ if(this.init){ $Element(this.obj).opacity(1); }else{ $Element(this.obj).appear(0.1); } } } }); //bbs iframe function resizeIfr(obj, minHeight) { minHeight = minHeight || 10; try { var getHeightByElement = function(body) { var last = body.lastChild; try { while (last && last.nodeType != 1 || !last.offsetTop) last = last.previousSibling; return last.offsetTop+last.offsetHeight; } catch(e) { return 0; } } var doc = obj.contentDocument || obj.contentWindow.document; if (doc.location.href == 'about:blank') { $Element(obj).height(minHeight); return; } if ($Agent().navigator().ie) { var h = doc.body.scrollHeight; } else { var s = doc.body.appendChild(document.createElement('DIV')) $Element(s).css("clear","both"); var h = s.offsetTop; s.parentNode.removeChild(s); } if (h < minHeight) h = minHeight; $Element(obj).height(h); if (typeof resizeIfr.check == 'undefined') resizeIfr.check = 0; if (typeof obj._check == 'undefined') obj._check = 0; if (obj._check < 5) { obj._check++; setTimeout(function(){ resizeIfr(obj,minHeight) }, 200); // check 5 times for IE bug } else { obj._check = 0; } } catch (e) { alert(e); } } (function($,ns) { $.fn[ns] = function(options) { var elements = this; var prms = $.extend({ }, options); var currentBtnElm; var _switch = function(e,elm,autoPlay){ if(e) e.preventDefault(); var videoPath = eval('(' + elm.rel + ')').videoPath; var movie = new SwfPutter({src:addPath + "moviePlayer.swf", id:"movie_swf", w:"509", h:"401"}); movie.addVars({videoPath:eval('(' + elm.rel + ')').videoPath,autoPlay:autoPlay}); movie.put('movie'); $(elm).addClass('active'); $(currentBtnElm).removeClass('active'); currentBtnElm = elm; } //var btnElms = []; elements.each(function(i){ var elm = this; $(this).click(function(event){ _switch(event,elm,'true'); }) }); //$(elements[0]).trigger('click') _switch(null,elements[0],'false'); return this; }; })($j,'hgSwitchMovie'); (function($,ns) { $.fn[ns] = function(options) { var elements = this; var prms = $.extend({ showClass:'open', btnClass:'nextBtn' }, options); var _switch = function(e,n){ e.preventDefault(); $(elements[n]).removeClass(prms.showClass); switch(n){ case 0: $(elements[1]).addClass(prms.showClass); break; case 1: $(elements[0]).addClass(prms.showClass); break; } } var btnElms = []; elements.each(function(i){ btnElms[i] = $('.'+prms.btnClass+' a',this); $('.'+prms.btnClass+' a',this).click(function(event){ _switch(event,i); }) }); return this; }; })($j,'hgSwitchContPage'); var SetDateSelect = $Class({ $init : function(){ var vYear = ""; var vMonth = ""; var vDay = ""; }, myinit : function(nInitDate,bInitSet){ var yy,mm; var birthyyV, syear, smonth, sday, birthmmV; syear = $("birthyy").value; birthyyV = syear; birthmmV = $("birthmm").value; smonth = parseInt(birthmmV, 10); sday = "1"; if (syear == "" ) { syear = "1900"; smonth = 1; } d = new Date(parseInt(syear, 10), smonth - 1, sday); yy = d.getFullYear(); mm = d.getMonth() + 1; smonth = mm; sdate = d; edate = new Date(yy, mm, 0); if (!(nInitDate && !bInitSet)) { this.dispCal(sdate, edate, nInitDate); } }, dispCal : function(sdate, edate, nInitDate) { var sday; var tdate=new Date(sdate); var sdate=new Date(tdate); //初期化 var elDate = $('birthdd'); var welDate = $Element(elDate); elDate.innerHTML = ''; var elOption = $('