﻿/*
 * core.scroll.js JavaScript plugin
 * http://www.geometry.ne.jp/
 * Copyright 2011, GEOMETRY graphics
 *
*/
var _sc=(function(geo){var _target=null;var _tmode=0;var _offm={x:0,y:0};var _reg1=new RegExp('^(a|dd|li|div|table|body|form|p|input|textarea|select|option|button|embed|object)$');var _reg2=new RegExp('^(input|textarea|select|option|button|embed|object)$');var _anchorsp=3;var _speedX=0;var _speedY=0;var _speedYs=0;var _speedXs=0;var url='../lib/img/';var _pos=function(){this.start={x:0,y:0,t:0};this.end={x:0,y:0,t:0};this.prv={x:0,y:0,t:0};this.content={x:0,y:0};this.cstart={x:0,y:0,t:0};this.mode=0};_pos.start={x:0,y:0,t:0};_pos.end={x:0,y:0,t:0};_pos.prv={x:0,y:0,t:0};_pos.content={x:0,y:0};_pos.cstart={x:0,y:0,t:0};_pos.mode=0;var _px=(is.smf)?4:1;var _sz=(is.smf)?0.2:0.1;var _wt=(is.smf)?10:5;var _sens=(is.smf)?2500:1900;var _sensb=(is.smf)?800:550;function draging(now){_speedX=(Math.abs(now.x-_pos.prv.x)>=_px)?(now.x-_pos.prv.x)*_sz:0;_speedY=(Math.abs(now.y-_pos.prv.y)>=_px)?(now.y-_pos.prv.y)*_sz:0;_pos.prv=now}function touch_move(ev){if(_target===null)return;if(ev.touches.length>1)return;var mx,my;var touche=ev.changedTouches;var tc=touche[0];if(_tmode===1){var pos,off=_target.tmpoff;mx=tc.pageX;my=tc.pageY;mx-=(off.x+_offm.x);my-=(off.y+_offm.y);pos=(_scmode==='xb')?mx:my;_target.moveBar(pos,_scmode);_target.getflickpos({m:'xb',p:_target.msgx.x,s:0});_target.getflickpos({m:'yb',p:_target.msg.y,s:0})}else if(_tmode===2){var p=_target.getpos(tc);if(_target.anchor_node!==null){var e=_target.anchor_node.adata;if(Math.abs(e.pos.x-p.x)>_anchorsp||Math.abs(e.pos.y-p.y)>_anchorsp){e.anchorfg=false;_target.anchor_node=null}}if(p.t-_pos.prv.t>100){_speedX=0;_speedY=0;_target.queueptX=0;_target.queueptY=0;_target.startpointY=_target.cursectionY;_target.startpointX=_target.cursectionX}draging(p);if(!_pos.mode){var xp=_pos.start.x-p.x;var yp=_pos.start.y-p.y;var sz=Math.sqrt(Math.pow(Math.abs(xp),2)+Math.pow(Math.abs(yp),2));if(sz>=_wt){if(_target.slidep.movefg){_pos.mode=3}else{var s=Math.atan2(yp,xp);var deg=Math.abs((s/Math.PI)*180.0);deg=(deg>90)?180-deg:deg;if(deg<40)_pos.mode=1;else if(deg>50)_pos.mode=2;else _pos.mode=(_target.slidep.fixfg)?(deg<25)?1:2:3}_offm.x=(_target.msgx.x>0)?p.x-_target.msgx.x:Math.abs(_target.msgx.x)+p.x;_offm.y=(_target.msg.y>0)?p.y-_target.msg.y:Math.abs(_target.msg.y)+p.y;_pos.cstart=p}else{return}}var tg=_target.getParentObj();if(tg!==undefined&&_pos.mode&_target.slidep.movemode){if(tg){_pos.mode=_target.slidep.movemode;_target.alphafg=true;_target.clearBar();_target=tg;_target.tmpoff=_target.obj.getOff();var p=_target.getpos(tc);_pos.prv=p;draging(p);_offm.x=(_target.msgx.x>0)?p.x-_target.msgx.x:Math.abs(_target.msgx.x)+p.x;_offm.y=(_target.msg.y>0)?p.y-_target.msg.y:Math.abs(_target.msg.y)+p.y;_target.queueptX=0;_target.queueptY=0;_target.startpointX=_target.cursectionX;_target.startpointY=_target.cursectionY}else{}return}else{switch(_target.slidep.movemode){case 1:_pos.mode=2;break;case 2:_pos.mode=1;break}}if(tg===null){ev.preventDefault();ev.stopPropagation()}if(_target.hidefg){var e1=_target.barareaX;var e2=_target.barareaY;if(e1.easingState()){e1.stopEasing()}if(e2.easingState()){e2.stopEasing()}if(_pos.mode){if(!is.ie){e1.setAlpha(100);e2.setAlpha(100)}var xfg=(_target.msg.w>_target.view.w);var yfg=(_target.msg.h>_target.view.h);if(xfg)e1.Display(true);if(yfg)e2.Display(true)}}if(!checkPointer(tc)){touch_up(ev)}else{mx=p.x-_offm.x;my=p.y-_offm.y;var rule;switch(_pos.mode){case 1:rule={x:mx};break;case 2:rule={y:my};break;case 3:rule={x:mx,y:my};break;default:rule={};break}_target.moveTextBounce(rule);_target.getflickpos({m:'xb',p:_target.msgx.x,s:0});_target.getflickpos({m:'yb',p:_target.msg.y,s:0})}}}function touch_up(ev){if(_target===null)return;_target.mfg=0;_target.offmsvp.x=null;_target.offmsvp.y=null;_target.offmtmp.x=null;_target.offmtmp.y=null;_target.offmfg.x=false;_target.offmfg.y=false;_target.actfg=false;if(ev.touches.length>1)return;var touche=ev.changedTouches;var tc=touche[0];if(_tmode===1){((_scmode==='xb')?_target.barX:_target.barY).css.backgroundColor=_target.barcolor;if(_target.section.length){_target.setNearSection(_target.msgx.x,_target.msg.y,true)}}else if(_tmode===2){if(_target.anchor_node!==null){_target.anchor_node.onclick();_target.anchor_node.adata.anchorfg=false;_target.anchor_node=null;_target=null;_tmode=0;return}var p=_target.getpos(tc);_pos.end=p;var es='easeOutCubic';var fs=_sens;var fsb=_sensb;var obj=_target.view;var objc=_target.msg;var objcx=_target.msgx;var ptx=objcx.x;var pty=objc.y;var thx=(obj.w<objc.w)?obj.w-objc.w:0;var thy=(obj.h<objc.h)?obj.h-objc.h:0;var mvfgx=0;var mvfgy=0;if(p.t-_pos.prv.t>100){_speedX=0;_speedY=0;_target.queueptX=0;_target.queueptY=0;_target.startpointY=_target.cursectionY;_target.startpointX=_target.cursectionX}else{if(!_speedX||(_speedX<0&&_speedXs>0)||(_speedX>0&&_speedXs<0)){_target.queueptX=0;_target.startpointX=_target.cursectionX}if(!_speedY||(_speedY<0&&_speedYs>0)||(_speedY>0&&_speedYs<0)){_target.queueptY=0;_target.startpointY=_target.cursectionY}}var nx,ny;if(_target.section.length){var v=(_target.fcblock!==undefined)?_target.fcblock.priority||0:0;nx=(v===2)?_target.speed:1;ny=(v===1)?_target.speed:1}else{nx=_target.speed;ny=_target.speed}ptx+=_speedX*nx;pty+=_speedY*ny;if(_pos.mode===0){if(_target.anchor_node!==null){var e=_target.anchor_node.adata;if(e.anchorfg){_target.clearBar();_target=null;_tmode=0;return}}if(_target.section.length){_target.setNearSection(ptx,pty,true);_target.clearBar();_target=null;_tmode=0;return}}var obj1,obj2;switch(_pos.mode){case 1:if(!_target.slidep.movemode||_target.slidep.movemode===2)obj1=checkPoint(_speedX,ptx,thx,fs,fsb,es,objcx.x,'xb');break;case 2:if(!_target.slidep.movemode||_target.slidep.movemode===1)obj2=checkPoint(_speedY,pty,thy,fs,fsb,es,objc.y,'yb');break;case 3:if(!_target.slidep.movemode||_target.slidep.movemode===3){obj1=checkPoint(_speedX,ptx,thx,fs,fsb,es,objcx.x,'xb');obj2=checkPoint(_speedY,pty,thy,fs,fsb,es,objc.y,'yb')}break}if(obj1!==undefined){ptx=obj1.pt;thx=obj1.th;esx=obj1.es;fsx=obj1.fs;mvfgx=obj1.mvfg}if(obj2!==undefined){pty=obj2.pt;thy=obj2.th;esy=obj2.es;fsy=obj2.fs;mvfgy=obj2.mvfg}if(_target.hidefg)_target.alphafg=true;if(objcx.x===ptx||objc.y===pty){if(objcx.x===ptx)_target.queueptX=0;if(objc.y===pty)_target.queueptY=0;if(objcx.x===ptx&&objc.y===pty){if(_target.scfunc!==null){_target.scfunc(objcx.x,objc.y,objc.w,objc.h)}_target.clearBar();_target=null;_tmode=0;return}}_speedYs=_speedY;_speedXs=_speedX;switch(_pos.mode){case 1:if(!_target.slidep.movemode||_target.slidep.movemode===2)setTimerBounce(_target,mvfgx,thx,ptx,esx,fsx,fsb,'xb');break;case 2:if(!_target.slidep.movemode||_target.slidep.movemode===1)setTimerBounce(_target,mvfgy,thy,pty,esy,fsy,fsb,'yb');break;case 3:if(!_target.slidep.movemode||_target.slidep.movemode===3){setTimerBounce(_target,mvfgx,thx,ptx,esx,fsx,fsb,'xb');setTimerBounce(_target,mvfgy,thy,pty,esy,fsy,fsb,'yb')}break}}_target=null;_tmode=0}function checkPointer(ev){if(!_target.outfg)return true;var o=_target;var c=0;var fg=true;while(o){p=o.getpos(ev,1);c++;if(p.y<0||p.y>=o.obj.h||p.x<0||p.x>=o.obj.w){if(_target.outfg<=c){fg=false;break}}o=(o.parentobj)?o.parentobj:null}return fg}function mouse_move(ev){if(_target===null)return;var mx,my;if(_tmode===1){if(is.ie){mx=event.clientX-2;my=event.clientY-2;cancelBubble=true;event.returnValue=false}else{mx=ev.pageX;my=ev.pageY}var pos,off=_target.tmpoff;mx-=(off.x+_offm.x);my-=(off.y+_offm.y);pos=(_scmode==='xb')?mx:my;_target.moveBar(pos,_scmode);_target.getflickpos({m:'xb',p:_target.msgx.x,s:0});_target.getflickpos({m:'yb',p:_target.msg.y,s:0})}else if(_tmode===2){var p=_target.getpos(ev);if(_target.anchor_node!==null){var e=_target.anchor_node.adata;if(Math.abs(e.pos.x-p.x)>_anchorsp||Math.abs(e.pos.y-p.y)>_anchorsp){e.anchorfg=false;_target.anchor_node=null}}if(is.ie){cancelBubble=true;event.returnValue=false;ev=event}if(p.t-_pos.prv.t>100){_speedX=0;_speedY=0;_target.queueptX=0;_target.queueptY=0;_target.startpointY=_target.cursectionY;_target.startpointX=_target.cursectionX}draging(p);if(!_pos.mode){var xp=_pos.start.x-p.x;var yp=_pos.start.y-p.y;var sz=Math.sqrt(Math.pow(Math.abs(xp),2)+Math.pow(Math.abs(yp),2));if(sz>=_wt){if(_target.slidep.movefg){_pos.mode=3}else{var s=Math.atan2(yp,xp);var deg=Math.abs((s/Math.PI)*180.0);deg=(deg>90)?180-deg:deg;if(deg<30)_pos.mode=1;else if(deg>60)_pos.mode=2;else _pos.mode=(_target.slidep.fixfg)?(deg<25)?1:2:3}_offm.x=(_target.msgx.x>0)?p.x-_target.msgx.x:Math.abs(_target.msgx.x)+p.x;_offm.y=(_target.msg.y>0)?p.y-_target.msg.y:Math.abs(_target.msg.y)+p.y;_pos.cstart=p}else{return}}var tg=_target.getParentObj();if(tg!==undefined&&_pos.mode&_target.slidep.movemode){if(tg){_pos.mode=_target.slidep.movemode;_target.alphafg=true;_target.clearBar();_target=tg;_target.tmpoff=_target.obj.getOff();var p=_target.getpos(ev);_pos.prv=p;draging(p);_offm.x=(_target.msgx.x>0)?p.x-_target.msgx.x:Math.abs(_target.msgx.x)+p.x;_offm.y=(_target.msg.y>0)?p.y-_target.msg.y:Math.abs(_target.msg.y)+p.y;_target.queueptX=0;_target.queueptY=0;_target.startpointX=_target.cursectionX;_target.startpointY=_target.cursectionY}else{}return}else{switch(_target.slidep.movemode){case 1:_pos.mode=2;break;case 2:_pos.mode=1;break;case 3:_pos.mode=3;break}}if(_target.hidefg){var e1=_target.barareaX;var e2=_target.barareaY;if(e1.easingState()){e1.stopEasing()}if(e2.easingState()){e2.stopEasing()}if(_pos.mode){if(!is.ie){e1.setAlpha(100);e2.setAlpha(100)}var xfg=(_target.msg.w>_target.view.w);var yfg=(_target.msg.h>_target.view.h);if(xfg)e1.Display(true);if(yfg)e2.Display(true)}}if(!checkPointer(ev)){mouse_up(ev)}else{mx=p.x-_offm.x;my=p.y-_offm.y;var rule;switch(_pos.mode){case 1:rule={x:mx};break;case 2:rule={y:my};break;case 3:rule={x:mx,y:my};break;default:rule={}}_target.moveTextBounce(rule);_target.getflickpos({m:'xb',p:_target.msgx.x,s:0});_target.getflickpos({m:'yb',p:_target.msg.y,s:0})}}}function checkPoint(spd,pt,th,fs,fsb,es,ps,md){var mvfg=0;console.log('checkPoint spd['+spd+']');if(spd<0){if(pt<th&&ps>th){mvfg=1;console.log('checkPoint fsb['+fsb+']')}else{if(ps>0){if(ps+pt>0){pt=0;fs=fsb}}else if(ps<=th){pt=th;fs=fsb}}}else if(spd>0){if(pt>0&&ps<0){th=0;mvfg=2;console.log('checkPoint fsb['+fsb+']')}else{if(pt<th){pt=th;fs=fsb}else if(ps>=0){pt=0;fs=fsb}}}else{fs=fsb;if(pt>0){pt=0}else if(pt<th){pt=th}}if(mvfg){fs=800}var dobj=_target.getflickpos({m:md,p:pt,f:fs,e:es,s:spd});pt=dobj.p;fs=dobj.f;es=dobj.e;return{th:th,pt:pt,fs:fs,es:es,mvfg:mvfg}}function setTimerBounce(delm,mvfg,th,pt,es,fs,fsb,md){var stopfg=0;var rules,rule,obj,dobj;var xfg=(md==='xb');if(xfg){rules={x:pt};rule={x:null};obj=delm.msgx;dobj=delm.msg;if(obj.x===rules.x)fs=1}else{rules={y:pt};rule={y:null};obj=delm.msg;dobj=delm.msgx;if(obj.y===rules.y)fs=1}obj.alphafg=true;obj.timerTo(rules,es,fs,function(){if(this.easingState()){delm.moveTextBounce(rule);if(mvfg){var pos=(xfg)?this.x:this.y;if(mvfg===2&&pos>=0){fs=100;stopfg=pt*0.15;this.stopEasing()}else if(mvfg===1&&pos<=th){fs=100;stopfg=th+(pt-th)*0.15;this.stopEasing()}}}else if(stopfg&&!delm.actfg){rules=(xfg)?{x:stopfg}:{y:stopfg};obj.timerTo(rules,es,fs,function(){if(this.easingState()){delm.moveTextBounce(rule)}else if(!delm.actfg){pt=th;rules=(xfg)?{x:pt}:{y:pt};obj.timerTo(rules,es,fsb,function(){if(this.easingState()){delm.moveTextBounce(rule)}else{if(delm.scfunc!==null){delm.scfunc(delm.msgx.x,delm.msg.y,delm.msg.w,delm.msg.h)}this.alphafg=false;if(!dobj.alphafg)delm.clearBar()}},is.ios)}},is.ios)}else{if(delm.scfunc!==null){delm.scfunc(delm.msgx.x,delm.msg.y,delm.msg.w,delm.msg.h)}this.alphafg=false;if(!dobj.alphafg)delm.clearBar()}},is.ios)}function mouse_up(ev){if(_target===null)return;_target.mfg=0;_target.offmsvp.x=null;_target.offmsvp.y=null;_target.offmtmp.x=null;_target.offmtmp.y=null;_target.offmfg.x=false;_target.offmfg.y=false;_target.actfg=false;if(_tmode===1){((_scmode==='xb')?_target.barX:_target.barY).css.backgroundColor=_target.barcolor;if(_target.section.length){_target.setNearSection(_target.msgx.x,_target.msg.y,true)}}else if(_tmode===2){ev=(is.ie)?event:ev;var p=_target.getpos(ev);_pos.end=p;var es='easeOutCubic';var fs=_sens;var fsb=_sensb;var obj=_target.view;var objc=_target.msg;var objcx=_target.msgx;var ptx=objcx.x;var pty=objc.y;var thx=(obj.w<objc.w)?obj.w-objc.w:0;var thy=(obj.h<objc.h)?obj.h-objc.h:0;var mvfgx=0;var mvfgy=0;if(p.t-_pos.prv.t>50){_speedX=0;_speedY=0;_target.queueptX=0;_target.queueptY=0;_target.startpointY=_target.cursectionY;_target.startpointX=_target.cursectionX}else{if(!_speedX||(_speedX<0&&_speedXs>0)||(_speedX>0&&_speedXs<0)){_target.queueptX=0;_target.startpointX=_target.cursectionX}if(!_speedY||(_speedY<0&&_speedYs>0)||(_speedY>0&&_speedYs<0)){_target.queueptY=0;_target.startpointY=_target.cursectionY}}var nx,ny;if(_target.section.length){var v=(_target.fcblock!==undefined)?_target.fcblock.priority||0:0;nx=(v===2)?_target.speed:1;ny=(v===1)?_target.speed:1}else{nx=_target.speed;ny=_target.speed}if(_pos.mode===0){if(_target.anchor_node!==null){var e=_target.anchor_node.adata;if(e.anchorfg){_target.clearBar();_target=null;_tmode=0;return}}if(_target.section.length){_target.setNearSection(ptx,pty,true);_target.clearBar();_target=null;_tmode=0;return}}ptx+=_speedX*nx;pty+=_speedY*ny;var obj1,obj2;switch(_pos.mode){case 1:if(!_target.slidep.movemode||_target.slidep.movemode===2){obj1=checkPoint(_speedX,ptx,thx,fs,fsb,es,objcx.x,'xb')}break;case 2:if(!_target.slidep.movemode||_target.slidep.movemode===1)obj2=checkPoint(_speedY,pty,thy,fs,fsb,es,objc.y,'yb');break;case 3:if(!_target.slidep.movemode||_target.slidep.movemode===3){obj1=checkPoint(_speedX,ptx,thx,fs,fsb,es,objcx.x,'xb');obj2=checkPoint(_speedY,pty,thy,fs,fsb,es,objc.y,'yb')}break}if(obj1!==undefined){ptx=obj1.pt;thx=obj1.th;esx=obj1.es;fsx=obj1.fs;mvfgx=obj1.mvfg}if(obj2!==undefined){pty=obj2.pt;thy=obj2.th;esy=obj2.es;fsy=obj2.fs;mvfgy=obj2.mvfg}if(_target.hidefg)_target.alphafg=true;if(objcx.x===ptx||objc.y===pty){if(objcx.x===ptx)_target.queueptX=0;if(objc.y===pty)_target.queueptY=0;if(objcx.x===ptx&&objc.y===pty){if(_target.scfunc!==null){_target.scfunc(objcx.x,objc.y,objc.w,objc.h)}_target.clearBar();_target=null;_tmode=0;return}}_speedYs=_speedY;_speedXs=_speedX;switch(_pos.mode){case 1:if(!_target.slidep.movemode||_target.slidep.movemode===2)setTimerBounce(_target,mvfgx,thx,ptx,esx,fsx,fsb,'xb');break;case 2:if(!_target.slidep.movemode||_target.slidep.movemode===1)setTimerBounce(_target,mvfgy,thy,pty,esy,fsy,fsb,'yb');break;case 3:if(!_target.slidep.movemode||_target.slidep.movemode===3){setTimerBounce(_target,mvfgx,thx,ptx,esx,fsx,fsb,'xb');setTimerBounce(_target,mvfgy,thy,pty,esy,fsy,fsb,'yb')}break}}_target=null;_tmode=0}var funcgrp=function(dat,p){this.init(dat,p)};funcgrp.prototype={obj:null,minbar:0,barw:0,imgh:0,barcolor:'',barcoloract:'',anchor_node:null,anchorid:0,parentobj:null,child:0,alphafg:false,hidefg:false,outfg:0,section:[],cursectionX:0,cursectionY:0,startpointX:0,startpointY:0,queueptX:0,queueptY:0,svflickp:{xb:0,yb:0},fcmd:{xb:0,yb:0},topobj:null,view:null,msg:null,msgx:null,actfg:false,balpha:0,speed:0,wheelfg:false,barareaX:null,barcoverX:null,barX:null,barbX:null,defszX:null,barMovepX:null,barareaY:null,barcoverY:null,barY:null,barbY:null,defszY:null,barMovepY:null,offmsvp:{},offmtmp:{},offmfg:{},mfg:0,killfg:false,clearSection:function(){this.section=[];this.cursectionX=this.cursectionY=0;this.startpointX=this.startpointY=0;this.queueptX=this.queueptY=0},resetSection:function(){this.clearSection();this.setSection()},setSection:function(){var obj,fg,p=0,buf=[];if(this.fcblock===undefined)return;var id=this.id;var scb=this.fcblock;scb.sens=(scb.sens===undefined)?0.2:parseFloat(scb.sens);if(scb.stop){scb.stop.xb=(scb.stop.xb===undefined)?1:(scb.stop.xb<1||scb.stop.xb>3)?1:scb.stop.xb;scb.stop.yb=(scb.stop.yb===undefined)?1:(scb.stop.yb<1||scb.stop.yb>3)?1:scb.stop.yb}scb.classname='';scb.tagname='';if(scb.sblock!==undefined){if(scb.sblock.charAt(0)==='.'){scb.classname=scb.sblock.substr(1);scb.tagname='*'}else if(scb.sblock!==''){scb.classname='';scb.tagname=scb.sblock}}if(scb.tagname==='')return;var elm=document.getElementById(id).getElementsByTagName(scb.tagname);for(var p=0;p<elm.length;p++){obj=elm[p];if(obj===null||obj===undefined){break}fg=false;if(scb.classname!==''){var cname=obj.getAttribute((is.ie7under)?'className':'class')||'';if(cname.indexOf(scb.classname)!==-1){fg=true}}else{fg=true}if(fg){buf.push({'left':obj.offsetLeft,'top':obj.offsetTop,'width':obj.offsetWidth,'height':obj.offsetHeight})}}var defhz=null,defvt=null,hz=0,vt=0;for(var i=0;i<buf.length;i++){if(i===0){defhz=buf[i].left;defvt=buf[i].top}else{if(scb.stop){switch(scb.stop.xb){case 1:if(buf[i].left===defhz)hz++;if(buf[i].top===defvt)vt++;break;case 2:if(buf[i].width);break;case 3:break}}}}this.section=buf},cssposition:function(e){e.style.marginTop=0;e.style.marginLeft=0;e.style.marginRight=0;e.style.marginBottom=0;e.style.paddingTop=0;e.style.paddingLeft=0;e.style.paddingRight=0;e.style.paddingBottom=0},scrollbar:function(prt,info,md){var mode=(md==='xb')?1:2;var id=this.id;var div1,div2,div3,attr,p,img;var obj=this.obj;var sz=[];if(md==='xb'){sz[0]=info.barpos.xb.sz;sz[1]=info.barw;sz[2]=info.minb;sz[3]=sz[1];sz[4]=info.imgh;sz[5]=sz[1];sz[6]=sz[2]-sz[4]*2;sz[7]=sz[1];sz[8]=sz[4];sz[9]=sz[1];sz[10]=sz[0];sz[11]=sz[1]}else{sz[0]=info.barw;sz[1]=info.barpos.yb.sz;sz[2]=sz[0];sz[3]=info.minb;sz[4]=sz[0];sz[5]=info.imgh;sz[6]=sz[0];sz[7]=sz[3]-sz[5]*2;sz[8]=sz[0];sz[9]=sz[3];sz[10]=sz[0];sz[11]=sz[1]}div1=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_bararea_'+md;div1.setAttributeNode(attr);div1.style.position='absolute';div1.style.zIndex=2;this.cssposition(div1);if(info.barpos[md]!==undefined){div1.style.left=(info.barpos[md].x||0)+'px';div1.style.top=(info.barpos[md].y||0)+'px'}else{if(mode===1)div1.style.left=(this.view.h-info.barw)+'px';else div1.style.left=(this.view.w-info.barw)+'px'}div1.style.width=(sz[0]||0)+'px';div1.style.height=(sz[1]||0)+'px';div1.style.backgroundColor=this.scbgc;div1.style.zIndex=2;div2=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_bar_'+md;div2.setAttributeNode(attr);div2.style.position='absolute';div2.style.left=0;div2.style.top=0;div2.style.width=sz[2]+'px';div2.style.height=sz[3]+'px';div2.style.backgroundColor=this.barcolor;div2.style.zIndex=1;this.cssposition(div2);div1.appendChild(div2);if(info.imgh&&info.imgurl[md].imgt){p=document.createElement('p');p.style.display='block';p.style.width=sz[4]+'px';p.style.height=sz[5]+'px';p.style.backgroundImage='url('+info.imgurl[md].imgt+')';p.style.backgroundRepeat='no-repeat';p.style.backgroundPosition='bottom center';this.cssposition(p);if(md==='xb'){if(is.ie)p.style.styleFloat='left';else p.style.cssFloat='left'}div2.appendChild(p)}p=document.createElement('p');attr=document.createAttribute('id');attr.value=id+'_barb_'+md;p.setAttributeNode(attr);p.style.display='block';p.style.width=sz[6]+'px';p.style.height=sz[7]+'px';p.style.backgroundImage='url('+info.imgurl[md].imgm+')';this.cssposition(p);if(md==='xb'){if(is.ie)p.style.styleFloat='left';else p.style.cssFloat='left';p.style.backgroundRepeat='repeat-x'}else{p.style.backgroundRepeat='repeat-y'}div2.appendChild(p);if(info.imgh&&info.imgurl[md].imgb){p=document.createElement('p');p.style.display='block';p.style.width=sz[8]+'px';p.style.height=sz[9]+'px';p.style.backgroundImage='url('+info.imgurl[md].imgb+')';p.style.backgroundRepeat='no-repeat';p.style.backgroundPosition='top center';this.cssposition(p);if(md==='xb'){if(is.ie)p.style.styleFloat='left';else p.style.cssFloat='left'}div2.appendChild(p)}div3=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_barcover_'+md;div3.setAttributeNode(attr);div3.style.position='absolute';div3.style.left=0;div3.style.top=0;div3.style.width=(sz[10]||0)+'px';div3.style.height=(sz[11]||0)+'px';div3.style.zIndex=2;this.cssposition(div3);div1.appendChild(div3);img=document.createElement('img');img.setAttribute('src','img/spc.gif');img.setAttribute('width',sz[10]);img.setAttribute('height',sz[11]);this.cssposition(img);div3.appendChild(img);prt.appendChild(div1);var bararea=geo.$(id+'_bararea_'+md);var barcover=geo.$(id+'_barcover_'+md);var bar=geo.$(id+'_bar_'+md);var barb=geo.$(id+'_barb_'+md);if(md==='xb'){this.barareaX=bararea;this.barcoverX=barcover;this.barX=bar;this.barbX=barb}else{this.barareaY=bararea;this.barcoverY=barcover;this.barY=bar;this.barbY=barb}if(!is.ie||this.balpha!=100)bararea.setAlpha(this.balpha);if(this.hidefg){if(!is.ie)bararea.setAlpha(0);bararea.Display(false)}var belm=div3;var self=this;if(document.addEventListener){if(is.smf){belm.addEventListener('touchstart',function(ev){self.touch_down(ev,1,md)},false)}else{belm.addEventListener('mousedown',function(ev){self.mouse_down(ev,1,md)},false);if(this.wheelfg){if(is.sf||is.op)belm.onmousewheel=function(ev){self.wheel(ev,md)};else belm.addEventListener('DOMMouseScroll',function(ev){self.wheel(ev,md)},false)}}}else{belm.attachEvent('onmousedown',function(ev){self.mouse_down(ev,1,md)});if(this.wheelfg){belm.attachEvent('onmousewheel',function(ev){self.wheel(ev,md)})}}},init:function(info,pobj){var div,div1,div2,div3,p,img,attr;var id=info.id;var obj=geo.$(id);var prt=obj.elm;var self=this;this.parentobj=pobj;obj.dt=this;this.id=id;this.obj=obj;this.wheelfg=info.wheelfg||0;this.obj.slideX=0;this.obj.slideY=0;this.barcolor=info.barcol||'transparent';this.barcoloract=info.barcola||'transparent';this.scbgc=info.scbgc||'transparent';this.balpha=info.balpha||100;this.anchor_node=null;this.anchorid=0;this.slidep=info.slidep||{movefg:false,movemode:0,parent:0,fixfg:false};if(this.slidep!==undefined){this.slidep.movefg=this.slidep.movefg||false;this.slidep.movemode=this.slidep.movemode||0;this.slidep.parent=this.slidep.parent||0;this.slidep.fixfg=this.slidep.fixfg||false}this.outfg=info.outfg||0;this.alphafg=false;this.hidefg=info.hidefg||false;this.child=(info.child!==undefined)?info.child.length:0;this.speed=info.spd||((is.ios)?200:400);this.fcblock=info.fcblock||undefined;this.scfunc=info.scfunc||null;this.resizefunc=info.resizefunc||null;this.nowblock=0;this.offmsvp.x=this.offmsvp.y=null;this.offmtmp.x=this.offmtmp.y=null;this.offmfg.x=this.offmfg.y=false;this.mfg=0;this.setSection();var tree=prt.childNodes;var buffer=[];for(var i=0;i<tree.length;i++){if(tree[i].nodeType===1){var nd=tree[i];buffer.push(nd.cloneNode(true))}}while(prt.hasChildNodes()){prt.removeChild(prt.firstChild)}div=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_top';div.setAttributeNode(attr);div.style.position='relative';div.style.width='100%';div.style.height='100%';div.style.left=0;div.style.top=0;div.style.zIndex=1;var w=(info.scaw!==undefined&&parseInt(info.scaw)>0)?info.scaw:obj.w;var h=(info.scah!==undefined&&parseInt(info.scah)>0)?info.scah:obj.h;div1=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_view';div1.setAttributeNode(attr);div1.style.position='absolute';div1.style.width=w+'px';div1.style.height=h+'px';div1.style.left=0;div1.style.top=0;div1.style.zIndex=1;div1.style.backgroundColor=info.bgcol||'transparent';div.appendChild(div1);div3=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_msgx';div3.setAttributeNode(attr);div3.style.position='absolute';div3.style.left=0;div3.style.top=0;div3.style.width='100%';div3.style.backgroundColor=info.sccol||'transparent';div1.appendChild(div3);div2=document.createElement('div');attr=document.createAttribute('id');attr.value=id+'_msg';div2.setAttributeNode(attr);div2.style.position='absolute';div2.style.left=0;div2.style.top=0;div2.style.width=((info.ctsw!==undefined&&parseInt(info.ctsw)>0)?info.ctsw:w)+'px';div2.style.backgroundColor=info.sccol||'transparent';div3.appendChild(div2);while(node=buffer.shift()){div2.appendChild(node)}prt.appendChild(div);this.obj.moveEvent(function(){});this.topobj=geo.$(id+'_top');this.view=geo.$(id+'_view');this.msgx=geo.$(id+'_msgx');this.msg=geo.$(id+'_msg');this.msg.resizeEvent(function(){if(self.resizefunc){self.resizefunc(self)}else{self.resetScroll('xb');self.resetScroll('yb')}if(self.section.length){if(self.fcblock.func){self.fcblock.func(self)}else{self.resetSection()}}});if(is.ios){this.topobj.css.webkitTransform='translate3d(0,0,0) scale(1,1)';this.view.css.webkitTransform='translate3d(0,0,0) scale(1,1)';this.msg.css.webkitTransform='translate3d(0,0,0) scale(1,1)';this.msgx.css.webkitTransform='translate3d(0,0,0) scale(1,1)'}if(info.bgimg!==undefined){this.view.backImg(info.bgimg.url,info.bgimg.rep,info.bgimg.pos)}this.view.css.overflow='hidden';prt.style.overflow='hidden';this.defimgfg=!(info.imgurl);if(this.defimgfg){info.imgurl={xb:{imgt:url+'blft.png',imgm:url+'bctr.png',imgb:url+'brit.png'},yb:{imgt:url+'btop.png',imgm:url+'bmdl.png',imgb:url+'bbtm.png'}};info.minb=info.minb||34;info.barw=info.barw||7;info.imgh=info.imgh||3;var scx=this.view.w-(info.barw+1);var scy=this.view.h-(info.barw+1);var xfg=(this.msg.w>this.view.w);var yfg=(this.msg.h>this.view.h);var maxw,maxh;if(xfg&&yfg){maxw=scx;maxh=scy}else{maxw=obj.w-2;maxh=obj.h-2}if(info.barpos){if(info.barpos.xb){info.barpos.xb.x=info.barpos.xb.x||1;info.barpos.xb.y=info.barpos.xb.y||scy;info.barpos.xb.sz=info.barpos.xb.sz||maxw}else{info.barpos.xb={x:1,y:scy,sz:maxw}}if(info.barpos.yb){info.barpos.yb.x=info.barpos.yb.x||scx;info.barpos.yb.y=info.barpos.yb.y||1;info.barpos.yb.sz=info.barpos.yb.sz||maxh}else{info.barpos.yb={x:scx,y:1,sz:maxh}}}else{info.barpos=info.barpos||{xb:{x:1,y:scy,sz:maxw},yb:{x:scx,y:1,sz:maxh}}}}this.minbar=info.minb;this.barw=info.barw;this.imgh=info.imgh||0;this.scrollbar(div,info,'xb');this.scrollbar(div,info,'yb');this.events=info.events||null;var celm=(w===obj.w&&h===obj.h)?this.obj.elm:this.view.elm;this.targetelm=celm;if(document.addEventListener){if(is.smf){celm.addEventListener('touchstart',function(ev){self.touch_down(ev,2)},false)}else{celm.addEventListener('mousedown',function(ev){self.mouse_down(ev,2)},false);if(this.wheelfg){if(is.sf||is.op)celm.onmousewheel=function(ev){self.wheel(ev)};else celm.addEventListener('DOMMouseScroll',function(ev){self.wheel(ev)},false)}}}else{celm.attachEvent('onmousedown',function(ev){self.mouse_down(ev,2)});if(this.wheelfg){celm.attachEvent('onmousewheel',function(ev){self.wheel(ev)})}}this.resetScroll('xb');this.resetScroll('yb');this.setSection();if(is.ios){this.createMask('input');this.createMask('textarea')}var stpos=this.setStopPosition(info.startpos||{x:0,y:0});this.mfg=-1;this.moveTextBounce(stpos);this.mfg=0},setStopPosition:function(stpos){var obj;if(stpos.x!==undefined){obj=this.getStopPos('xb',stpos.x);stpos.x=obj.p;this.cursectionX=obj.s;console.log('setStopPosition ['+this.cursectionX+']')}if(stpos.y!==undefined){obj=this.getStopPos('yb',stpos.y);stpos.y=obj.p;this.cursectionY=obj.s}return stpos},getCurntPosition:function(md){var obj;var stpos={};if(md==='xb')stpos.x=this.getStopPos('xb',(arguments.length>1)?arguments[1]:this.cursectionX).p;if(md==='yb')stpos.y=this.getStopPos('yb',(arguments.length>1)?arguments[1]:this.cursectionY).p;return stpos},getStopPos:function(md,stp){var p,d,c,t;if(md==='xb'){p='width';d='left';c='x';t='w'}else{p='height';d='top';c='y';t='h'}var ptr=stp||0;if(this.section&&this.section.length&&this.fcblock){var n=(this.fcblock.stop)?this.fcblock.stop[md]:1;if(ptr>=this.section.length)ptr=this.section.length-1;switch(n){case 1:stp=(ptr)?-this.section[ptr][d]:0;break;case 2:stp=(ptr)?-this.section[ptr][d]:0;stp+=Math.round((this.view[t]-this.section[ptr][p])/2);break;case 3:stp=(ptr)?-this.section[ptr][d]:0;stp+=this.view[t]-this.section[ptr][p];break}}return{p:stp,s:ptr}},touch_down2:function(ev){var touche=ev.changedTouches;var tc=touche[0];switch(ev.type){case'touchstart':this.startx=tc.pageX;this.starty=tc.pageY;this.svx=this.startx;this.svy=this.starty;break;case'touchmove':this.svx=tc.pageX;this.svy=tc.pageY;break;case'touchend':if(this.startx===this.svx&&this.starty===this.svy){document.getElementById(ev.target.id).style.display='none';document.getElementById(ev.target.id.split('_')[1]).focus()}}ev.stopPropagation();ev.preventDefault()},setfuncs:function(e,org){var self=this;e.addEventListener('touchstart',function(ev){self.touch_down2(ev)},false);e.addEventListener('touchmove',function(ev){self.touch_down2(ev)},false);e.addEventListener('touchend',function(ev){self.touch_down2(ev)},false)},createMask:function(ename){var o=this.obj.elm.getElementsByTagName(ename);for(var i=0;i<o.length;i++){var org=o[i];var e=document.createElement('img');e.setAttribute('src','img/spc.gif');e.setAttribute('width',org.offsetWidth);e.setAttribute('height',org.offsetHeight);e.style.position='absolute';e.setAttribute((is.ie7under)?'className':'class','maskarea');e.id='maskarea_'+(org.name||org.id);org.parentNode.insertBefore(e,org);this.setfuncs(e,org)}},resizeMask:function(id,sz){var e=document.getElementById('maskarea_'+id);if(e){e.setAttribute('width',(sz.w||e.getAttribute('width')));e.setAttribute('height',(sz.h||e.getAttribute('height')))}},coverMask:function(id,fg){var e=document.getElementById('maskarea_'+id);if(e){e.style.display=(fg)?'block':'none'}},getHrefSize:function(c){var sz={xb:0,yb:0};var obj=this.section[c];if(this.section.length&&obj!==undefined){var csz1=obj.width;var vsz1=this.view.w;var csz2=obj.height;var vsz2=this.view.h;if(this.fcblock&&this.fcblock.stop){if(this.fcblock.stop.xb===2)sz.xb=Math.round((csz1-vsz1)/2);if(this.fcblock.stop.yb===2)sz.yb=Math.round((csz2-vsz2)/2)}}return sz},setNearSection:function(ptx,pty,fg){var pt=this.getStopPosition({xp:ptx,yp:pty,ns:0});console.log('setNearSection    pt.xp['+pt.xp+']  pt.yp['+pt.yp+']   slidep.movemode['+this.slidep.movemode+']');var fsb=_sensb;var thx=(this.view.w<this.msg.w)?this.view.w-this.msg.w:0;var thy=(this.view.h<this.msg.h)?this.view.h-this.msg.h:0;ptx=pt.xp;pty=pt.yp;var fs=550;var es='easeOutQuart';var movemode=this.slidep.movemode;var priority=this.fcblock.priority||0;switch((movemode===1||priority===2)?1:(movemode===2||priority===1)?2:(movemode===3||priority===3)?3:0){case 1:if(fg)setTimerBounce(this,0,thy,pty,es,fs,fsb,'yb');this.setStopPosition({y:pt.ns});break;case 2:if(fg)setTimerBounce(this,0,thx,ptx,es,fs,fsb,'xb');this.setStopPosition({x:pt.ns});break;case 3:case 0:if(fg){setTimerBounce(this,0,thx,ptx,es,fs,fsb,'xb');setTimerBounce(this,0,thy,pty,es,fs,fsb,'yb')}this.setStopPosition({x:pt.ns,y:pt.ns});break}console.log('setNearSection   cursectionX['+this.cursectionX+']  cursectionY['+this.cursectionY+']')},getStopPosition:function(pos){var sz=this.section.length;console.log('getStopPosition   xp['+pos.xp+'] yp['+pos.yp+']');var vw=this.view.w-1;var vh=this.view.h-1;var ax=this.getCenterArea('xb');var ay=this.getCenterArea('yb');console.log('getStopPosition   a.st['+ax.st+'] a.ed['+ay.ed+']');var ptx=Math.round(pos.xp);var pty=Math.round(pos.yp);var e,sx,sy,ex,ey,bp,wd,hi,ap,area=[];for(var i=0;i<sz;i++){e=this.section[i];sx=e.left+ptx;sy=e.top+pty;ex=sx+e.width-1;ey=sy+e.height-1;bp=0;if(ex<0||ey<0||sx>vw||sy>vh){wd=hi=ap=undefined}else{if(sx<=0&&ex>=vw){wd=vw}else{if(sx>=0&&sx<=vw)bp|=1;if(ex>=0&&ex<=vw)bp|=2;if(bp&1){wd=(bp&2)?e.width:vw-sx+1}else if(bp&2){wd=(bp&1)?e.width:ex}}if(sy<=0&&ey>=vh){hi=vh}else{if(sy>=0&&sy<=vh)bp|=4;if(ey>=0&&ey<=vh)bp|=8;if(bp&4){hi=(bp&8)?e.height:vh-sy+1}else if(bp&8){hi=(bp&4)?e.height:ey}}ap=(wd*hi)/(e.width*e.height)*100;area.push({a:ap,s:i})}console.log('getStopPosition   ['+(i+1)+'] ptx['+ptx+'] pty['+pty+'] ['+sx+','+sy+','+ex+','+ey+'] bp('+bp+') wd['+wd+'] hi['+hi+'] area['+ap+'%] vw['+vw+'] vh['+vh+']')}if(area.length){var n={a:area[0].a,s:area[0].s};for(var c=1;c<area.length;c++){console.log('getStopPosition   area.a['+area[c].a+'%] area.s['+(area[c].s+1)+']');if(area[c].a>n.a){n=area[c]}}pos.xp=this.getStopPos('xb',n.s).p;pos.yp=this.getStopPos('yb',n.s).p;pos.ns=n.s;console.log('getStopPosition   n.a['+n.a+'%] s['+(n.s+1)+'] pos.xp['+pos.xp+'] pos.yp['+pos.yp+']')}return pos},getflickpos:function(arg){var self=this;var sz=self.section.length;if(sz){var fg=false;var queue,stp,j,t;if(self.fcblock!==undefined){var fc=self.fcblock.priority||0;if(arg.m==='xb'&&fc===2){fg=true}else if(arg.m==='yb'&&fc===1){fg=true}else{}}if(fg){return arg}if(arg.m==='xb'){j='left';t='width';v='w';queue=self.queueptX;stp=self.startpointX}else{j='top';t='height';v='h';queue=self.queueptY;stp=self.startpointY}var argp=(arg.p<0)?Math.abs(arg.p):0;var fcfg=(Math.abs(arg.s)>=self.fcblock.sens);var dfg=false;if(arg.s)console.log('getflickpos   '+arg.s+'  '+self.fcblock.sens);if(arg.e!==undefined){if(fcfg){queue++}else if(queue>0){queue--}dfg=true}arg.q=queue;var tmpfg=(arg.e!==undefined&&arg.m==='xb');var c,p,fcmd=0;if(arg.s>0){c=sz-1;p=-1;console.log('getflickpos   右にフリックされた queue['+queue+']')}else if(arg.s<0){c=0;p=1;console.log('getflickpos   左にフリックされた queue['+queue+']')}else{c=0;p=1;if(self.svflickp[arg.m]<arg.p){fcmd=1}else if(self.svflickp[arg.m]>arg.p){fcmd=0}else{fcmd=self.fcmd[arg.m]}self.fcmd[arg.m]=fcmd;self.svflickp[arg.m]=arg.p}var obj1,obj2,pls1,pls2,pls;while(sz--){obj1=self.section[c];pls1=this.getHrefSize(c)[arg.m];if((p>0&&argp<obj1[j]+pls1)||(p<0&&argp>obj1[j]+pls1)){obj2=self.section[c-p];pls2=this.getHrefSize(c-p)[arg.m];pls=pls1+pls2;if(!fcmd)pls=0;if(obj2!==undefined&&argp<obj2[j]+obj2[t]*0.5+pls&&!fcfg){arg.p=-obj2[j]}else{arg.p=-obj1[j]}if(--arg.q<=0||!fcfg){break}}c+=p}if(typeof obj2!=='object'){arg.p=-obj1[j]}arg.f=(is.ios)?600:550;arg.e='easeOutQuart';if(queue){var limit,pt;if(p===1){pt=stp+queue;if(pt>=self.section.length)pt=self.section.length-1;limit=-self.section[pt][j];if(limit>arg.p){arg.p=limit}}else{pt=stp-queue;if(pt<0)pt=0;limit=-self.section[pt][j];if(limit<arg.p){arg.p=limit}}}for(c=0;c<self.section.length;c++){if(self.section[c][j]===-arg.p){if(self.fcblock.stop){if(self.fcblock.stop[arg.m]===2)arg.p+=Math.round((self.view[v]-self.section[c][t])/2);else if(self.fcblock.stop[arg.m]===3)arg.p-=self.section[c][t]-self.view[v]}break}}if(arg.m==='xb'){if(dfg)self.cursectionX=c;self.queueptX=queue}else{if(dfg)self.cursectionY=c;self.queueptY=queue}}return arg},clearBar:function(){if(this.alphafg){this.alphafg=false;if(is.ie){this.barareaX.Display(false);this.barareaY.Display(false)}else{var self=this;this.barareaX.timerTo({'opacity':0},'swing',200,function(){if(!this.easingState()){if(!self.alphafg){this.Display(false)}}});this.barareaY.timerTo({'opacity':0},'swing',200,function(){if(!this.easingState()){if(!self.alphafg){this.Display(false)}}})}}},movemsg:function(x,y){if(is.ios){this.msg.transTo(null,y);this.msgx.transTo(x,null)}else{this.msg.moveTo(null,y);this.msgx.moveTo(x,null)}},resetScroll:function(md){var c,p,sz,np,msgpt;var bararea;var fg=false;var xfg=(this.msg.w>this.view.w);var yfg=(this.msg.h>this.view.h);if(xfg&&yfg){fg=true}if(md==='xb'){c='w';p='x';msgpt=this.msgx[p];if(this.defimgfg){var sz=(fg)?this.view.w-(this.barw+1):this.view.w-2;this.barareaX.resizeTo(sz,null);this.barcoverX.resizeTo(sz,null)}bararea=this.barareaX}else{c='h';p='y';msgpt=this.msg[p];if(this.defimgfg){var sz=(fg)?this.view.h-(this.barw+1):this.view.h-2;this.barareaY.resizeTo(null,sz);this.barcoverY.resizeTo(null,sz)}bararea=this.barareaY}if(this.msg[c]>this.view[c]){sz=Math.floor(bararea[c]*(this.view[c]/this.msg[c]));if(sz<this.minbar){sz=this.minbar}var maxsz=bararea[c]-sz;np=maxsz/(this.msg[c]-this.view[c]);if(md==='xb')this.barMovepX=np;else this.barMovepY=np}else{sz=bararea[c];np=sz/this.view[c];if(md==='xb')this.barMovepX=np;else this.barMovepY=np}if(md==='xb')this.defszX=sz;else this.defszY=sz;var ct=sz-this.imgh*2;var pt=-msgpt*np;if(pt+sz>bararea[c]){pt=bararea[c]- +sz;var pos=0;if(np>0)pos=Math.round(pt/np);if(md==='xb')this.movemsg(-pos,null);else this.movemsg(null,-pos)}if(md==='xb'){this.barX.resizeTo(sz,null);this.barbX.resizeTo(ct,null);this.barX.moveTo(pt,null)}else{this.barY.resizeTo(null,sz);this.barbY.resizeTo(null,ct);this.barY.moveTo(null,pt)}},setBounce:function(txtp,md){var c,p,t;var barsz,barmvp,defsz,msgpt,sc;if(md==='xb'){c='w';p='x';t='width';barsz=this.barareaX.w;barmvp=this.barMovepX;defsz=this.defszX;msgpt=this.msgx.x;sc=this.cursectionX}else{c='h';p='y';t='height';barsz=this.barareaY.h;barmvp=this.barMovepY;defsz=this.defszY;msgpt=this.msg.y;sc=this.cursectionY}var objsz=this.view[c];var msgsz=this.msg[c];var a=this.getCenterArea(md);var minsz=0;var maxsz=(objsz<msgsz)?objsz-msgsz:0;var pt,sz,ct;var pos=(txtp!==null)?txtp:msgpt;var svp=Math.abs(pos);var np=0;if(sc===0||sc===this.section.length-1){var dnp=(sc===0)?a.st:a.ed;if(dnp&&!this.offmfg[p]&&this.mfg!==-1){if(msgpt>Math.min(a.st,minsz)||msgpt<Math.max(a.ed,maxsz)){np=dnp;pos=(txtp!==null)?Math.round(txtp+np)*0.5:msgpt;svp=Math.abs(pos)}}}if(pos>a.st){if(pos>minsz){if(np===0)pos=(txtp)?txtp*0.5:msgpt;sz=Math.round(defsz-svp*0.5);var minb=(this.defimgfg)?7:this.minbar;if(sz<minb){sz=minb}ct=sz-this.imgh*2;pt=0}else{sz=defsz;ct=sz-this.imgh*2;pt=Math.round(barmvp*-pos)}}else if(pos<a.ed){if(pos<maxsz){if(np===0)pos=(txtp)?(maxsz+txtp)*0.5:msgpt;sz=Math.round(defsz-(svp+maxsz)*0.5);var minb=(this.defimgfg)?7:this.minbar;if(sz<minb){sz=minb}ct=sz-this.imgh*2;pt=barsz-sz}else{sz=defsz;ct=sz-this.imgh*2;pt=Math.round(barmvp*-pos)}}else{var dfg=true;if(pos<maxsz&&dfg){if(this.mfg===0&&txtp){if(this.offmsvp[p]!==null){_offm[p]=this.offmsvp[p];this.offmsvp[p]=null}this.mfg=1}else{if(np===0)pos=(txtp)?(maxsz+txtp)*0.5:msgpt;sz=Math.round(defsz-(svp+maxsz)*0.5);var minb=(this.defimgfg)?7:this.minbar;if(sz<minb){sz=minb}ct=sz-this.imgh*2;pt=barsz-sz}}else if(pos>minsz&&dfg){if(this.mfg===0&&txtp){if(this.offmsvp[p]!==null){_offm[p]=this.offmsvp[p];this.offmsvp[p]=null}this.mfg=2}else{if(np===0)pos=(txtp)?(minsz+txtp)*0.5:msgpt;sz=Math.round(defsz-(svp+minsz)*0.5);var minb=(this.defimgfg)?7:this.minbar;if(sz<minb){sz=minb}ct=sz-this.imgh*2;pt=0}}else{if(this.mfg>0&&txtp){this.offmsvp[p]=_offm[p];if(this.offmtmp[p]===null){var ctp;if(this.mfg===2){ctp=this.section[0];var fg=(_pos.content[p]<=0);_offm[p]=(_pos.content[p]<=0)?-_pos.content[p]+_pos.cstart[p]:_pos.cstart[p]-a.st*2}else if(this.mfg===1){ctp=this.section[this.section.length-1];var fg=(_pos.content[p]<=a.ed);if(!this.offmfg[p])_offm[p]=-a.ed+_pos.cstart[p]+(objsz-ctp[t])/((this.fcblock.stop[md]===2)?2:1)}var tmp=(msgpt>0)?_pos.prv[p]-msgpt:Math.abs(msgpt)+_pos.prv[p];this.offmtmp[p]=_offm[p]}else{_offm[p]=this.offmtmp[p]}this.mfg=0}else{pos=(txtp!==null)?txtp:msgpt;sz=defsz;ct=sz-this.imgh*2;pt=Math.round(barmvp*-pos)}}}if(md==='xb'){this.barX.resizeTo(sz,null);this.barbX.resizeTo(ct,null);this.movemsg(pos,null);this.barX.moveTo(pt,null);this.obj.slideX=pos}else{this.barY.resizeTo(null,sz);this.barbY.resizeTo(null,ct);this.movemsg(null,pos);this.barY.moveTo(null,pt);this.obj.slideY=pos}},autoBounce:function(txtp,md){var c,p;var barsz,barmvp,defsz,msgpt,sc;if(md==='xb'){c='w';p='x';barsz=this.barareaX.w;barmvp=this.barMovepX;defsz=this.defszX;msgpt=this.msgx.x;sc=this.cursectionX}else{c='h';p='y';barsz=this.barareaY.h;barmvp=this.barMovepY;defsz=this.defszY;msgpt=this.msg.y;sc=this.cursectionY}var objsz=this.view[c];var msgsz=this.msg[c];var a=this.getCenterArea(md);var minsz=0;var maxsz=(objsz<msgsz)?objsz-msgsz:0;var pt,sz,ct;var pos=(txtp!==null)?txtp:msgpt;var svp=Math.abs(pos);if(pos<=a.st&&pos>=a.ed){if(pos<maxsz){sz=Math.round(defsz-(svp+maxsz)*0.5);var minb=(this.defimgfg)?7:this.minbar;if(sz<minb){sz=minb}ct=sz-this.imgh*2;pt=barsz-sz}else if(pos>minsz){sz=Math.round(defsz-(svp+minsz)*0.5);var minb=(this.defimgfg)?7:this.minbar;if(sz<minb){sz=minb}ct=sz-this.imgh*2;pt=0}else{pos=(txtp!==null)?txtp:msgpt;sz=defsz;ct=sz-this.imgh*2;pt=Math.round(barmvp*-pos)}if(md==='xb'){this.barX.resizeTo(sz,null);this.barbX.resizeTo(ct,null);this.movemsg(pos,null);this.barX.moveTo(pt,null);this.obj.slideX=pos}else{this.barY.resizeTo(null,sz);this.barbY.resizeTo(null,ct);this.movemsg(null,pos);this.barY.moveTo(null,pt);this.obj.slideY=pos}}},moveTextBounce:function(arg){var md;if(arg.x!==undefined){md='xb';if(arg.fg)this.autoBounce(arg.x,md);else this.setBounce(arg.x,md)}if(arg.y!==undefined){md='yb';if(arg.fg)this.autoBounce(arg.y,md);else this.setBounce(arg.y,md)}},moveBar:function(pt,md){var c,p;var barcoever,bar,bmp;var fg=false;if(md==='xb'){c='w';p='x';barcover=this.barcoverX;bar=this.barX;bmp=this.barMovepX}else{c='h';p='y';barcover=this.barcoverY;bar=this.barY;bmp=this.barMovepY}var sz=(this.view[c]<this.msg[c])?barcover[c]-bar[c]:0;if(pt<0){pt=0;fg=true}if(pt>=sz){pt=sz;fg=true}var pos=0;if(this.view[c]<this.msg[c])pos=Math.round(pt/bmp);if(md==='xb'){bar.moveTo(pt,null);this.movemsg(-pos,null)}else{bar.moveTo(null,pt);this.movemsg(null,-pos)}return fg},moveText:function(txtp,md){var c,p,t,pt;var bmp,bar,sbar,fg=false;if(md==='xb'){c='w';t='x';bar=this.barX;bmp=this.barMovepX;sbar=this.barareaX;p=this.msgx.x}else{c='h';t='y';bar=this.barY;bmp=this.barMovepY;sbar=this.barareaY;p=this.msg.y}var a=this.getCenterArea(md);var maxsz=a.st;var minsz=a.ed;var pos=txtp;if(pos>maxsz){pos=maxsz;fg=true}if(pos<minsz){pos=minsz;fg=true}var pt=bmp*-pos;var dmax=sbar[c]-bar[c];if(md==='xb'){this.movemsg(pos,null);bar.moveTo((pt<0)?0:(pt>dmax)?dmax:pt,null)}else{this.movemsg(null,pos);bar.moveTo(null,(pt<0)?0:(pt>dmax)?dmax:pt)}return fg},setAnchor:function(){var p=0,obj,scp;while(true){obj=document.getElementById(this.id).getElementsByTagName('a').item(p);if(obj===undefined||obj===null){break}if(!obj.anchorsetfg){var cid=this.id+'_anchor_'+p;var classname=obj.getAttribute((is.ie7under)?'className':'class');obj.setAttribute((is.ie7under)?'className':'class',(classname)?classname+' '+cid:cid);if(dhasAttribute(obj,'onclick')){scp=String(obj.getAttribute('onclick'));if(scp.indexOf('function anonymous()')!==-1)scp=scp.replace(/\n/g,'').replace(/function anonymous\(\)\{/,'').replace(/;\}$/,'');else scp=scp.replace(/;$/,'');obj.removeAttribute('onclick');scp='return _sc.callAnchor(this,"'+scp+'")'}else{scp='return _sc.callAnchor(this)'}if(is.ie7under)obj.setAttribute('onclick',new Function(scp));else obj.setAttribute('onclick',scp);if(dhasAttribute(obj,'onfocus')){scp=String(obj.getAttribute('onfocus'));if(scp.indexOf('function anonymous()')!==-1)scp=scp.replace(/\n/g,'').replace(/function anonymous\(\)\{/,'').replace(/;\}$/,'');else scp=scp.replace(/;$/,'');obj.removeAttribute('onfocus');scp+=';this.blur()'}else{scp='this.blur()'}if(is.ie7under)obj.setAttribute('onfocus',new Function(scp));else obj.setAttribute('onfocus',scp);var self=this;obj.adata={elment:self,link:dhasAttribute(obj,'href')?obj.getAttribute('href'):'',atarget:dhasAttribute(obj,'target')?obj.getAttribute('target'):'',anchorfg:false};obj.anchorsetfg=true}p++}},callAnchors:function(e,func){var obj=e.adata;if(obj.anchorfg){if(func!==null){(new Function(func))()}if(obj.link.indexOf('http')===0||obj.link.slice(-5)==='.html'||obj.link.slice(-4)==='.htm'||obj.link.slice(-4)==='.php'){if(obj.atarget)window.open(obj.link,obj.atarget);else location.href=obj.link}obj.anchorfg=false}return false},wheel:function(ev,md){if((md!==undefined&&this.hidefg)||this.wheelfg<0)return;console.log(md);this.msg.stopEasing();this.msgx.stopEasing();this.obj.stopEasing();this.defscbar('xb');this.defscbar('yb');this.queueptX=0;this.queueptY=0;md=(md===undefined)?'yb':md;var fg=false;var delta=0;if(!ev)ev=window.event;if(ev.wheelDelta){var j=0;if(is.ie)j=120;else if(is.p==='mac'&&is.cr)j=3;else if(is.sf)j=120;else j=40;delta=ev.wheelDelta/j}else if(ev.detail){delta=-ev.detail}var self=this;if(delta){var tg=this.getParentObj();if(tg!==undefined){if(tg){tg.msg.stopEasing();tg.msgx.stopEasing();tg.obj.stopEasing();tg.queueptX=0;tg.queueptY=0;self=tg}else{}}var objb=(md==='xb')?self.barX:self.barY;var nowp=(md==='xb')?self.msgx.x:self.msg.y;if(self.section.length){this.setNearSection(this.msgx.x,this.msg.y,true)}else{if(is.p==='mac')fg=self.moveBar(objb.y-delta,md);else fg=self.moveText(nowp+16*delta,md)}}if(fg){if(self.wheelfg===1){(is.ie)?ev.cancelBubble=true:ev.stopPropagation();(is.ie)?ev.returnValue=false:ev.preventDefault()}}else{(is.ie)?ev.cancelBubble=true:ev.stopPropagation();(is.ie)?ev.returnValue=false:ev.preventDefault()}if(self.scfunc!==null){self.scfunc(self.msgx.x,self.msg.y,self.msg.w,self.msg.h)}self.sendEvent('wheel',{pos:3})},getCenterArea:function(md){var c,t,p;if(md==='xb'){c='w';t='width';p='left'}else{c='h';t='height';p='top'}var s=0;var e=(this.view[c]<this.msg[c])?this.view[c]-this.msg[c]:0;if(this.fcblock){if(this.section.length>0){var head=0;var tail=this.section.length-1;var mode=(this.fcblock.stop)?this.fcblock.stop[md]:0;if(mode===1){s=0;e=(this.view[c]<this.msg[c])?-this.section[tail][p]:0}else if(mode===2){s=Math.round((this.view[c]-this.section[head][t])/2);e=Math.round((this.view[c]-this.section[tail][t])/2);e+=-this.section[tail][p]}else if(mode===3){if(this.view[c]<this.msg[c]){s=this.view[c]-this.section[0][t];e=this.view[c]-this.section[tail][t]+ -this.section[tail][p]}else{s=this.view[c]-this.msg[c];e=this.view[c]-this.msg[c]}}if(s===0&&e===0){e=(this.view[c]<this.msg[c])?this.view[c]-this.msg[c]:0}}}return{st:s,ed:e}},defscbar:function(md){var fg=0;var c,p,bar,barb,sbar,defsz;if(md==='xb'){c='w';t='x';p=this.msgx.x;bar=this.barX;barb=this.barbX;sbar=this.barareaX;defsz=this.defszX}else{c='h';t='y';p=this.msg.y;bar=this.barY;barb=this.barbY;sbar=this.barareaY;defsz=this.defszY}var a=this.getCenterArea(md);var sz=(this.view[c]<this.msg[c])?this.view[c]-this.msg[c]:0;if(p>0||p<sz){this.moveText((p>0)?a.st:a.ed,md);if(md==='xb'){p=this.msgx.x;var dp=Math.abs(p);if(p>0&&a.st>0){defsz=Math.round(defsz-dp*0.5)}else if(p<sz&&a.ed<sz){defsz=Math.round(defsz-(dp+sz)*0.5);bar.moveTo(sbar.w-defsz,null)}bar.resizeTo(defsz,null);barb.resizeTo(defsz-this.imgh*2,null);fg=1}else{p=this.msg.y;var dp=Math.abs(p);if(p>0&&a.st>0){defsz=Math.round(defsz-dp*0.5)}else if(p<sz&&a.ed<sz){defsz=Math.round(defsz-(dp+sz)*0.5)}bar.resizeTo(null,defsz);barb.resizeTo(null,defsz-this.imgh*2);fg=2}}else{this.offmfg[t]=true;_pos.cstart=_pos.start}return fg},eventBuffer:function(ev,mode){},getParentObj:function(){var c=this.slidep.parent;var o=undefined;if(c){o=this.parentobj;if(o===null)return null;while(--c>0){if((o=o.parentobj)===null)break}}return o},parentTimerStop:function(){var e=this.parentobj;while(e){if(e.section.length===0){e.msg.stopEasing();e.msgx.stopEasing();e.obj.stopEasing();e.defscbar('xb');e.defscbar('yb')}e=e.parentobj}},sendEvent:function(mode,param){if(this.events){if(typeof this.events[mode]==='function'){this.events[mode](param)}}},mouse_down:function(ev,mode,md){if(this.killfg){(is.ie)?ev.cancelBubble=true:ev.stopPropagation();(is.ie)?ev.returnValue=false:ev.preventDefault();return}this.actfg=true;_tmode=mode;var mx,my;var objm=this.msg;var objmx=this.msgx;_scmode=md;if(mode===1){if(this.hidefg)return;var objb=(md==='xb')?this.barX:this.barY;objm.stopEasing();objmx.stopEasing();this.obj.stopEasing();this.defscbar(md);if(is.ie){mx=event.offsetX;my=event.offsetY;event.cancelBubble=true;event.returnValue=false}else{if(ev.offsetX!==undefined){mx=ev.offsetX;my=ev.offsetY}else{mx=ev.layerX;my=ev.layerY}ev.stopPropagation();ev.preventDefault()}var fg=(md==='xb')?(objb.x<=mx&&objb.x+objb.w>mx):(objb.y<=my&&objb.y+objb.h>my);if(fg){_target=this;_offm.x=mx-objb.x;_offm.y=my-objb.y;objb.css.backgroundColor=this.barcoloract}else{_target=null;_tmode=0}this.tmpoff=((md==='xb')?this.barcoverX:this.barcoverY).getOff();this.queueptX=0;this.queueptY=0;this.sendEvent('down',{pos:1})}else if(mode===2){_target=this;ev=(is.ie)?event:ev;var afg=false;if(objm.easingState()||objmx.easingState()||this.obj.easingState()){objm.stopEasing();objmx.stopEasing();this.obj.stopEasing();this.alphafg=false;afg=true;if(this.section.length){this.setNearSection(this.msgx.x,this.msg.y,false)}}else{this.queueptX=0;this.queueptY=0;this.startpointX=this.cursectionX;this.startpointY=this.cursectionY;_pos.mode=0}this.parentTimerStop();var anc,nd;if(ev.srcElement){nd=ev.srcElement;while(nd.nodeType){if(nd.nodeName.toLowerCase().match(_reg1)!==null){break}nd=nd.parentElement}}else{nd=ev.target;while(nd.nodeType){if(nd.nodeName.toLowerCase().match(_reg1)!==null){break}nd=nd.parentNode}}if(nd.nodeName.toLowerCase().match(_reg2)!==null){this.queueptX=0;this.queueptY=0;_target=null;_tmode=0;return}else if(nd.nodeName.toLowerCase()==='a'&&!afg){nd.adata.anchorfg=true;this.anchor_node=nd}else{this.anchor_node=null}(is.ie)?ev.cancelBubble=true:ev.stopPropagation();(is.ie)?ev.returnValue=false:ev.preventDefault();this.tmpoff=this.obj.getOff();var p=this.getpos(ev);_pos.start=p;_pos.prv=p;_pos.content={x:0,y:0};_pos.content.x=this.msgx.x;_pos.content.y=this.msg.y;var fg=0;fg|=this.defscbar('xb');fg|=this.defscbar('yb');if(fg){_pos.mode=0}_offm.x=(objmx.x>0)?p.x-objmx.x:Math.abs(objmx.x)+p.x;_offm.y=(objm.y>0)?p.y-objm.y:Math.abs(objm.y)+p.y;draging(p);if(this.anchor_node!==null){nd.adata.pos=p}this.sendEvent('down',{pos:2})}},touch_cancel:function(ev){console.log('cancel')},touch_down:function(ev,mode,md){if(this.killfg){ev.stopPropagation();ev.preventDefault();return}this.afg=true;if(ev.touches.length>1){ev.stopPropagation();ev.preventDefault();return}_tmode=mode;var touche=ev.changedTouches;var tc=touche[0];var objm=this.msg;var objmx=this.msgx;_scmode=md;if(mode===1){if(this.hidefg)return;objm.stopEasing();objmx.stopEasing();this.obj.stopEasing();this.defscbar(md);var objb=(md==='xb')?this.barX:this.barY;var objc=(md==='xb')?this.barcoverX:this.barcoverY;this.tmpoff=objc.getOff();var off=this.tmpoff;var mx=tc.pageX-off.x;var my=tc.pageY-off.y;var fg=(md==='xb')?(objb.x<=mx&&objb.x+objb.w>mx):(objb.y<=my&&objb.y+objb.h>my);if(fg){_target=this;_offm.x=mx-objb.x;_offm.y=my-objb.y;objb.css.backgroundColor=this.barcoloract}else{_target=null;_tmode=0}ev.stopPropagation();ev.preventDefault();this.queueptX=0;this.queueptY=0;this.sendEvent('down',{pos:1})}else if(mode===2){_target=this;var afg=false;if(objm.easingState()||objmx.easingState()||this.obj.easingState()){objm.stopEasing();objmx.stopEasing();this.obj.stopEasing();this.alphafg=false;afg=true;if(this.section.length){this.setNearSection(this.msgx.x,this.msg.y,false)}}else{this.queueptX=0;this.queueptY=0;this.startpointX=this.cursectionX;this.startpointY=this.cursectionY;_pos.mode=0}this.parentTimerStop();var nd=ev.target;while(nd.nodeType){if(nd.nodeName.toLowerCase().match(_reg1)!==null){break}nd=nd.parentNode}if(nd.nodeName.toLowerCase().match(_reg2)!==null){this.queueptX=0;this.queueptY=0;_target=null;_tmode=0;return}else if(nd.nodeName.toLowerCase()==='a'&&!afg){nd.adata.anchorfg=true;this.anchor_node=nd}else{this.anchor_node=null}if(this.slidep.parent){if(this.getParentObj()){ev.stopPropagation();ev.preventDefault()}}else{ev.stopPropagation();ev.preventDefault()}this.tmpoff=this.obj.getOff();var p=this.getpos(tc);_pos.start=p;_pos.prv=p;_pos.content={x:0,y:0};_pos.content.x=this.msgx.x;_pos.content.y=this.msg.y;var fg=0;fg|=this.defscbar('xb');fg|=this.defscbar('yb');if(fg){_pos.mode=0}_offm.x=(objmx.x>0)?p.x-objmx.x:Math.abs(objmx.x)+p.x;_offm.y=(objm.y>0)?p.y-objm.y:Math.abs(objm.y)+p.y;draging(p);if(this.anchor_node!==null){nd.adata.pos=p}this.sendEvent('down',{pos:2})}},getpos:function(ev){var mx,my,time;if(is.ie){mx=ev.clientX-2;my=ev.clientY-2}else{mx=ev.pageX;my=ev.pageY}var offs=(arguments.length>1)?this.obj.getOff():this.tmpoff;mx-=offs.x;my-=offs.y;time=(new Date()).getTime();return{x:mx,y:my,t:time}},resizeScArea:function(w,h,cw){this.view.resizeTo(w,h);this.msg.resizeTo(cw,null)},resizeScBar:function(w,h){if(w!==null){this.barareaX.resizeTo(w,null);this.barcoverX.resizeTo(w,null)}if(h!==null){this.barcoverY.resizeTo(null,h);this.barcoverY.resizeTo(null,h)}},moveScBar:function(md,x,y){if(md==='xb'){this.barareaX.moveTo(x,y)}else if(md==='yb'){this.barareaY.moveTo(x,y)}},getPosition:function(){var xp=0,yp=0;if(this.section.length){xp=this.cursectionX+1;yp=this.cursectionY+1}return{'x':xp,'y':yp}},sectionSet:function(arg){var j=(arg.m==='xb')?'left':'top';for(var c=0;c<this.section.length;c++){if(this.section[c][j]===-arg.p){if(arg.m==='xb'){this.cursectionX=c;this.queueptX=0}else{this.cursectionY=c;this.queueptY=0}break}}},setPosition:function(){this.sectionSet({m:'xb',p:this.msgx.x});this.sectionSet({m:'yb',p:this.msg.y})},innsertObj:function(){},appendObj:function(){}};function dhasAttribute(elm,attr){return(is.ie7under)?elm.outerHTML.match(/^<[^>]*>/)[0].indexOf(' '+attr+'=')>-1:elm.hasAttribute(attr)}var _contents=[];return{datainit:function(dat,p){for(var i=0;i<dat.length;i++){var obj=new funcgrp(dat[i],p);dat[i].element=obj;_contents[obj.id]=obj;if(dat[i].child!==undefined){this.datainit(dat[i].child,obj)}}},anchorinit:function(dat){for(var i=0;i<dat.length;i++){if(dat[i].child!==undefined){this.anchorinit(dat[i].child)}else{var o=dat[i].element;o.setAnchor();if(o.parentobj!==null&&o.parentobj.child===i+1){o.parentobj.setAnchor()}}}},init:function(dat){if(document.addEventListener){if(is.smf){document.addEventListener('touchmove',touch_move,false);document.addEventListener('touchend',touch_up,false);document.addEventListener('touchcancel',touch_up,false)}else{document.addEventListener('mousemove',mouse_move,false);document.addEventListener('mouseup',mouse_up,false)}}else{document.attachEvent('onmousemove',mouse_move);document.attachEvent('onmouseup',mouse_up)}this.datainit(dat,null);this.anchorinit(dat,null);return _contents},searchElement:function(id){for(var i in _contents){if(_contents[i].id===id){return _contents[i]}}return null},resetScrollBar:function(id){var e=(typeof id==='object')?id:this.searchElement(id);e.resetScroll('xb');e.resetScroll('yb')},resizeArea:function(id,w,h){var e=(typeof id==='object')?id:this.searchElement(id);var cw=arguments[3]||null;e.resizeScArea(w,h,cw)},resizeBar:function(id,w,h){var e=(typeof id==='object')?id:this.searchElement(id);e.resizeScBar(w,h)},resetCts:function(id){var e=(typeof id==='object')?id:this.searchElement(id);e.defscbar('xb');e.defscbar('yb')},moveBarX:function(id,x,y){var e=(typeof id==='object')?id:this.searchElement(id);e.moveScBar('xb',x,y)},moveBarY:function(id,x,y){var e=(typeof id==='object')?id:this.searchElement(id);e.moveScBar('yb',x,y)},moveFlag:function(id){var e=(typeof id==='object')?id:this.searchElement(id);if(e!==null){if(arguments.length>1){if(typeof arguments[1]==='boolean')e.slidep.movefg=arguments[1]}return e.slidep.movefg}},moveContent:function(id,rule){var e=(typeof id==='object')?id:this.searchElement(id);e.moveTextBounce(rule);e.setPosition()},getContentPosition:function(id){var e=(typeof id==='object')?id:this.searchElement(id);return{'x':e.msgx.x,'y':e.msg.y}},getContentSize:function(id){var e=(typeof id==='object')?id:this.searchElement(id);return{'w':e.msg.w,'h':e.msg.h}},clearBlock:function(id){var e=(typeof id==='object')?id:this.searchElement(id);e.clearSection()},setBlock:function(id){var e=(typeof id==='object')?id:this.searchElement(id);e.setSection()},resetBlock:function(id){var e=(typeof id==='object')?id:this.searchElement(id);e.resetSection()},getBlock:function(id){var e=(typeof id==='object')?id:this.searchElement(id);return e.section},setBlockPosition:function(id){var e=(typeof id==='object')?id:this.searchElement(id);e.setPosition()},getBlockPosition:function(id){var e=(typeof id==='object')?id:this.searchElement(id);return e.getPosition()},getBlockSize:function(id){var e=(typeof id==='object')?id:this.searchElement(id);return e.section.length},changeMaskSize:function(id,mid,sz){var e=(typeof id==='object')?id:this.searchElement(id);e.resizeMask(mid,sz)},setMask:function(id,mid,fg){var e=(typeof id==='object')?id:this.searchElement(id);e.coverMask(mid,fg)},toSection:function(id){var e=(typeof id==='object')?id:this.searchElement(id);var cx=(arguments.length>1&&arguments[1].x>0)?arguments[1].x-1:e.cursectionX;var cy=(arguments.length>1&&arguments[1].y>0)?arguments[1].y-1:e.cursectionY;var xp=e.getCurntPosition('xb',cx).x;var yp=e.getCurntPosition('xb',cy).y;e.moveTextBounce({x:xp,y:yp,fg:1});if(arguments.length>1){e.cursectionX=cx;e.cursectionY=cy}},autoSlide:function(id,pos,spd,es,func){var e=(typeof id==='object')?id:this.searchElement(id);var rules={};var stpos=e.setStopPosition(pos);if(stpos.x!==undefined)rules.slideX=stpos.x;if(stpos.y!==undefined)rules.slideY=stpos.y;e.obj.timerTo(rules,es,spd,function(c,p){if(this.easingState()){var rule=(c==='slideX')?{x:p,fg:true}:{y:p,fg:true};e.moveTextBounce(rule)}else{func()}})},setKill:function(id,fg){var e=(typeof id==='object')?id:this.searchElement(id);e.killfg=fg},callAnchor:function(e){var func=(arguments.length>1)?arguments[1]:null;return e.adata.elment.callAnchors(e,func)}}})(gg);
