// <![CDATA[
var BAMPER_BLOGPARTS_ID = 'aeria101';
var BAMPER_regx = new RegExp(/^.*[\?|\&]s=(.+?)(\&|$)/);
var BAMPER_script_ary = document.getElementsByTagName("SCRIPT");
var BAMPER_param = BAMPER_BLOGPARTS_ID;

if(BAMPER_script_ary.length > 0){
  var BAMPER_url = BAMPER_script_ary[BAMPER_script_ary.length - 1].src;
  if(BAMPER_url.match(BAMPER_regx)){
    BAMPER_param +=  '/' + RegExp.$1;
  }
}

BAMPER_param += '?url=' + encodeURIComponent(location);

/**
 * SWFObject v1.5: Flash Player detection and embed - http://blog.deconcept.com/swfobject/
 *
 * SWFObject is (c) 2007 Geoff Stearns and is released under the MIT License:
 * http://www.opensource.org/licenses/mit-license.php
**/
if(typeof deconcept=="undefined"){var deconcept=new Object();}if(typeof deconcept.util=="undefined"){deconcept.util=new Object();}if(typeof deconcept.SWFObjectUtil=="undefined"){deconcept.SWFObjectUtil=new Object();}deconcept.SWFObject=function(_1,id,w,h,_5,c,_7,_8,_9,_a){if(!document.getElementById){return;}this.DETECT_KEY=_a?_a:"detectflash";this.skipDetect=deconcept.util.getRequestParameter(this.DETECT_KEY);this.params=new Object();this.variables=new Object();this.attributes=new Array();if(_1){this.setAttribute("swf",_1);}if(id){this.setAttribute("id",id);}if(w){this.setAttribute("width",w);}if(h){this.setAttribute("height",h);}if(_5){this.setAttribute("version",new deconcept.PlayerVersion(_5.toString().split(".")));}this.installedVer=deconcept.SWFObjectUtil.getPlayerVersion();if(!window.opera&&document.all&&this.installedVer.major>7){deconcept.SWFObject.doPrepUnload=true;}if(c){this.addParam("bgcolor",c);}var q=_7?_7:"high";this.addParam("quality",q);this.setAttribute("useExpressInstall",false);this.setAttribute("doExpressInstall",false);var _c=(_8)?_8:window.location;this.setAttribute("xiRedirectUrl",_c);this.setAttribute("redirectUrl","");if(_9){this.setAttribute("redirectUrl",_9);}};deconcept.SWFObject.prototype={useExpressInstall:function(_d){this.xiSWFPath=!_d?"expressinstall.swf":_d;this.setAttribute("useExpressInstall",true);},setAttribute:function(_e,_f){this.attributes[_e]=_f;},getAttribute:function(_10){return this.attributes[_10];},addParam:function(_11,_12){this.params[_11]=_12;},getParams:function(){return this.params;},addVariable:function(_13,_14){this.variables[_13]=_14;},getVariable:function(_15){return this.variables[_15];},getVariables:function(){return this.variables;},getVariablePairs:function(){var _16=new Array();var key;var _18=this.getVariables();for(key in _18){_16[_16.length]=key+"="+_18[key];}return _16;},getSWFHTML:function(){var _19="";if(navigator.plugins&&navigator.mimeTypes&&navigator.mimeTypes.length){if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","PlugIn");this.setAttribute("swf",this.xiSWFPath);}_19="<embed type=\"application/x-shockwave-flash\" src=\""+this.getAttribute("swf")+"\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\"";_19+=" id=\""+this.getAttribute("id")+"\" name=\""+this.getAttribute("id")+"\" ";var _1a=this.getParams();for(var key in _1a){_19+=[key]+"=\""+_1a[key]+"\" ";}var _1c=this.getVariablePairs().join("&");if(_1c.length>0){_19+="flashvars=\""+_1c+"\"";}_19+="/>";}else{if(this.getAttribute("doExpressInstall")){this.addVariable("MMplayerType","ActiveX");this.setAttribute("swf",this.xiSWFPath);}_19="<object id=\""+this.getAttribute("id")+"\" classid=\"clsid:D27CDB6E-AE6D-11cf-96B8-444553540000\" width=\""+this.getAttribute("width")+"\" height=\""+this.getAttribute("height")+"\" style=\""+this.getAttribute("style")+"\">";_19+="<param name=\"movie\" value=\""+this.getAttribute("swf")+"\" />";var _1d=this.getParams();for(var key in _1d){_19+="<param name=\""+key+"\" value=\""+_1d[key]+"\" />";}var _1f=this.getVariablePairs().join("&");if(_1f.length>0){_19+="<param name=\"flashvars\" value=\""+_1f+"\" />";}_19+="</object>";}return _19;},write:function(_20){if(this.getAttribute("useExpressInstall")){var _21=new deconcept.PlayerVersion([6,0,65]);if(this.installedVer.versionIsValid(_21)&&!this.installedVer.versionIsValid(this.getAttribute("version"))){this.setAttribute("doExpressInstall",true);this.addVariable("MMredirectURL",escape(this.getAttribute("xiRedirectUrl")));document.title=document.title.slice(0,47)+" - Flash Player Installation";this.addVariable("MMdoctitle",document.title);}}if(this.skipDetect||this.getAttribute("doExpressInstall")||this.installedVer.versionIsValid(this.getAttribute("version"))){var n=(typeof _20=="string")?document.getElementById(_20):_20;n.innerHTML=this.getSWFHTML();return true;}else{if(this.getAttribute("redirectUrl")!=""){document.location.replace(this.getAttribute("redirectUrl"));}}return false;}};deconcept.SWFObjectUtil.getPlayerVersion=function(){var _23=new deconcept.PlayerVersion([0,0,0]);if(navigator.plugins&&navigator.mimeTypes.length){var x=navigator.plugins["Shockwave Flash"];if(x&&x.description){_23=new deconcept.PlayerVersion(x.description.replace(/([a-zA-Z]|\s)+/,"").replace(/(\s+r|\s+b[0-9]+)/,".").split("."));}}else{if(navigator.userAgent&&navigator.userAgent.indexOf("Windows CE")>=0){var axo=1;var _26=3;while(axo){try{_26++;axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+_26);_23=new deconcept.PlayerVersion([_26,0,0]);}catch(e){axo=null;}}}else{try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");}catch(e){try{var axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");_23=new deconcept.PlayerVersion([6,0,21]);axo.AllowScriptAccess="always";}catch(e){if(_23.major==6){return _23;}}try{axo=new ActiveXObject("ShockwaveFlash.ShockwaveFlash");}catch(e){}}if(axo!=null){_23=new deconcept.PlayerVersion(axo.GetVariable("$version").split(" ")[1].split(","));}}}return _23;};deconcept.PlayerVersion=function(_29){this.major=_29[0]!=null?parseInt(_29[0]):0;this.minor=_29[1]!=null?parseInt(_29[1]):0;this.rev=_29[2]!=null?parseInt(_29[2]):0;};deconcept.PlayerVersion.prototype.versionIsValid=function(fv){if(this.major<fv.major){return false;}if(this.major>fv.major){return true;}if(this.minor<fv.minor){return false;}if(this.minor>fv.minor){return true;}if(this.rev<fv.rev){return false;}return true;};deconcept.util={getRequestParameter:function(_2b){var q=document.location.search||document.location.hash;if(_2b==null){return q;}if(q){var _2d=q.substring(1).split("&");for(var i=0;i<_2d.length;i++){if(_2d[i].substring(0,_2d[i].indexOf("="))==_2b){return _2d[i].substring((_2d[i].indexOf("=")+1));}}}return "";}};deconcept.SWFObjectUtil.cleanupSWFs=function(){var _2f=document.getElementsByTagName("OBJECT");for(var i=_2f.length-1;i>=0;i--){_2f[i].style.display="none";for(var x in _2f[i]){if(typeof _2f[i][x]=="function"){_2f[i][x]=function(){};}}}};if(deconcept.SWFObject.doPrepUnload){if(!deconcept.unloadSet){deconcept.SWFObjectUtil.prepUnload=function(){__flash_unloadHandler=function(){};__flash_savedUnloadHandler=function(){};window.attachEvent("onunload",deconcept.SWFObjectUtil.cleanupSWFs);};window.attachEvent("onbeforeunload",deconcept.SWFObjectUtil.prepUnload);deconcept.unloadSet=true;}}if(!document.getElementById&&document.all){document.getElementById=function(id){return document.all[id];};}var getQueryParamValue=deconcept.util.getRequestParameter;var FlashObject=deconcept.SWFObject;var SWFObject=deconcept.SWFObject;

/**************************************************
 *
 * helpful sites are below:
 * http://d.hatena.ne.jp/KAZUMiX/20081229/meltdown2
 * http://d.hatena.ne.jp/nitoyon/20080929/warioland_shake
 *
**************************************************/
function fallRoutine(){routineTimer=setTimeout(function(){fallRoutine()},INTERVAL);for(var i=0,l=norElms.length;i<l;i++){if(norElms[i]._fall){fallHandle(norElms[i])}}};function fallHandle(elm){elm.aX+=elm.vX;elm.vY+=G;elm.aY+=elm.vY;elm.style[elm.propX]=elm.aX+"px";elm.style[elm.propY]=elm.aY+"px"};function fallTag(id){var elm=norElms[id];var position=computedStyle(elm,'position');if(!position.match(/(relative|absolute)/i)){elm.style.position='relative';elm.aX=0;elm.aY=0;elm.propX='left';elm.propY='top'}else{var left=computedStyle(elm,'left');var right=computedStyle(elm,'right');if(left!='auto'||(left=='auto'&&right=='auto')){elm.aX=parseInt(left,10)||0;elm.propX='left'}else{elm.aX=parseInt(right,10)||0;elm.propX='right'};var top=computedStyle(elm,'top');var bottom=computedStyle(elm,'bottom');if(top!='auto'||(top=='auto'&&bottom=='auto')){elm.aY=parseInt(top,10)||0;elm.propY='top'}else{elm.aY=parseInt(bottom,10)||0;elm.propY='bottom'}};elm.style[elm.propX]=elm.style[elm.propY]=0;elm._aX=elm.aX;elm._aY=elm.aY;elm.vX=Math.floor(Math.random()*30)-15;elm.vY=-Math.floor(Math.random()*30)-20;elm._fall=1};function hideImage(id){imgElms[id].style.visibility='hidden'};function addOnloadEvent(func){var oldonload=window.onload;if(typeof window.onload!='function'){window.onload=func}else{window.onload=function(){oldonload();func()}}};function linkToNextBlog(url,noReplace){if(noReplace){this.location.href=url}else{this.location.replace(url)}};function addWrapper(w,h){if(runTimes==0){replaceBlogparts()}if(Safari){if(runTimes!=2){document.body.style.overflow='hidden'}}else{if(!existsFloq()){document.body.innerHTML='<div style="position:absolute;top:0px;left:0px;margin:0;padding:0;width:'+w+'px;height:'+h+'px;overflow:hidden;">'+document.body.innerHTML+'</div>'}}};function existsFloq(){var elms=document.body.getElementsByTagName('script');var elm;var i,l;for(i=0,l=elms.length;i<l;i++){try{elm=elms[i];if(elm!=undefined){if(elm.src.match(/floq/i)){return true}}}catch(e){}};return false};function replaceBlogparts(){bpDiv.style.width=BP_WIDTH+"px";bpDiv.style.height=BP_HEIGHT+"px";if(Safari){}else{bpDiv.innerHTML='<img src="'+currentPath+'img/dummy_blogparts.jpg" width="'+BP_WIDTH+'" height="'+BP_HEIGHT+'" ALT="GRAND FANTASIA ブログパーツ" />'}};function removeUnit(val){val.match(/^(\d+)/);return parseInt(RegExp.$1)};function getAbsolutePosition(elm){var xx=0,yy=0;while(elm){xx+=elm.offsetLeft||0;yy+=elm.offsetTop||0;elm=elm.offsetParent};return{x:xx,y:yy}};function getImgElements(){var rtn=[];var pos,elm,img;var elms=document.getElementsByTagName('img');var mx1,my1,mx2,my2,ex1,ey1,ex2,ey2;mx1=viewPortArea.x;my1=viewPortArea.y;mx2=viewPortArea.x+viewPortArea.width;my2=viewPortArea.y+viewPortArea.height;for(var i=0,l=elms.length;i<l;i++){elm=elms[i];pos=getAbsolutePosition(elm);ex1=pos.x;ey1=pos.y;ex2=pos.x+elm.width;ey2=pos.y+elm.height;if(mx1<=ex2&&ex1<=mx2&&my1<=ey2&&ey1<=my2){img={x:pos.x,y:pos.y,width:elm.width,height:elm.height,url:elm.src};sendImgDat.push(img);rtn.push(elm)}};return rtn};function getExpImgElements(){var rtn=[];var elm,pos,nor;var elms=document.body.getElementsByTagName('*');var mx1,my1,mx2,my2,ex1,ey1,ex2,ey2;mx1=viewPortArea.x;my1=viewPortArea.y;mx2=viewPortArea.x+viewPortArea.width;my2=viewPortArea.y+viewPortArea.height;for(var i=0,l=elms.length;i<l;i++){elm=elms[i];if(elm.tagName=='IMG'){continue};if(elm.tagName.match(/^(tbody|tr|script|noscript|label)$/i)||computedStyle(elm,'display').match(/^(none|inline)$/i)||computedStyle(elm,'visibility').match(/^hidden$/i)){continue};if(computedStyle(elm,'position').match(/absolute/i)){var top=computedStyle(elm,'top');var right=computedStyle(elm,'right');var bottom=computedStyle(elm,'bottom');var left=computedStyle(elm,'left');if(top=='auto'&&right=='auto'&&bottom=='auto'&&left=='auto'){continue};if(top.match(/%$/)||right.match(/%$/)||bottom.match(/%$/)||left.match(/%$/)){continue}};pos=getAbsolutePosition(elm);elm._x=pos.x;elm._y=pos.y;elm._fall=0;ex1=pos.x;ey1=pos.y;ex2=pos.x+elm.offsetWidth;ey2=pos.y+elm.offsetHeight;if(elm.offsetWidth*elm.offsetHeight<160000){if(mx1<=ex2&&ex1<=mx2&&my1<=ey2&&ey1<=my2){nor={x:pos.x,width:elm.offsetWidth};sendNorDat.push(nor);rtn.push(elm);if(rtn.length>MAX_TAG){return rtn}}}};return rtn};function getViewportArea(){return{x:document.body.scrollLeft||document.documentElement.scrollLeft,y:document.body.scrollTop||document.documentElement.scrollTop,width:window.innerWidth?window.innerWidth:document.documentElement.clientWidth?document.documentElement.clientWidth:document.body.clientWidth,height:window.innerHeight?window.innerHeight:document.documentElement.clientHeight?document.documentElement.clientHeight:document.body.clientHeight,allWidth:Math.max(document.body.scrollWidth,Math.max(document.body.clientWidth,document.documentElement.clientWidth)),allHeight:Math.max(Math.max(document.body.scrollHeight,(window.scrollMaxY||0)+(window.innerHeight||0)),(document.documentElement.clientHeight||document.body.clientHeight))}};function createOverlaySwf(){mainDiv=document.createElement("div");mainDiv.style.position="absolute";mainDiv.style.zIndex=2;mainDiv.style.width=viewPortArea.allWidth+"px";if(viewPortArea.allHeight<1200){mainDiv.style.height=viewPortArea.allHeight+"px"}else{mainDiv.style.height="1200px"}mainDiv.style.left=mainDiv.style.top="0px";mainDiv.style.overflow='hidden';document.body.appendChild(mainDiv);var so=new SWFObject(SWF_URL_INTRO+"?"+new Date().getTime(),SWF_ID_INTRO,"100%","100%","9.0.45");so.addParam("wmode","transparent");so.addParam("allowScriptAccess","always");so.write(mainDiv);mainSwf=document.getElementById(SWF_ID_INTRO);checkLoadedSwf()};function checkLoadedSwf(){var doExe=false;try{if(mainSwf.isReady()==true){doExe=true;onLoadedSwf()}}catch(e){};if(!doExe){setTimeout(function(){checkLoadedSwf()},1000)}};function onLoadedSwf(){mainDiv.style.left=viewPortArea.x+"px";mainDiv.style.top=viewPortArea.y+"px";mainSwf.init(currentPath,runTimes,requestUrl,sendNorDat,sendImgDat,viewPortArea);fallRoutine()};function startBlogparts(){if(runTimes==0){startBlogpartsLag()}else{setTimeout(startBlogpartsLag,1500)}};function startBlogpartsLag(){viewPortArea=getViewportArea();addWrapper(viewPortArea.allWidth,viewPortArea.allHeight);norElms=getExpImgElements();imgElms=getImgElements();createOverlaySwf()};function drawBlogparts(){document.open();document.write('<div id="'+SWF_DIV_BP+'"><a href="http://get.adobe.com/jp/flashplayer/" target="_blank"><img src="'+currentPath+'img/noflash.jpg" width="'+BP_WIDTH+'" height="'+BP_HEIGHT+'" alt="最新のAdobe Flash Player&reg;(無料)をインストールして下さい" style="border:0"></a></div>');document.write("<script type=\"text/javascript\" src=\"http://www.bamper.jp/blogparts/parts/"+BAMPER_param+"\" charset=\"utf-8\"></script>");document.close();var so=new SWFObject(currentPath+SWF_URL_BP+"?"+new Date().getTime(),SWF_ID_BP,BP_WIDTH,BP_HEIGHT,"9.0.45","#ffffff");so.addParam("wmode","transparent");so.addParam("allowScriptAccess","always");so.write(SWF_DIV_BP);bpDiv=document.getElementById(SWF_DIV_BP)}function drawBlogpartsDummy(){document.open();document.write('<div id="'+SWF_DIV_BP+'"><img src="'+currentPath+'img/dummy_blogparts.jpg" width="'+BP_WIDTH+'" height="'+BP_HEIGHT+'" ALT="GRAND FANTASIA ブログパーツ" /></div>');document.write("<script type=\"text/javascript\" src=\"http://www.bamper.jp/blogparts/parts/"+BAMPER_param+"\" charset=\"utf-8\"></script>");document.close();bpDiv=document.getElementById(SWF_DIV_BP)}var RUN_MAX=2;var computedStyle;var INTERVAL=1000/30;var MAX_TAG=20;var G=3;var IE=false;var Safari=false;var SWF_DIV_BP="gf_bp";var SWF_ID_BP="gfbpexternal";var SWF_URL_BP="gf_bp.swf";var SWF_ID_INTRO="gfexternal";var SWF_URL_INTRO="gf_main.swf";var mainDiv,bpDiv;var mainSwf;var viewPortArea;var sendNorDat=[];var sendImgDat=[];var norElms=[];var imgElms=[];var BP_WIDTH=160;var BP_HEIGHT=250;var loadedAllImgs=false;var swfTimer;var routineTimer;var runTimes=0;var requestUrl;var currentPath;if(window.attachEvent&&!window.opera){IE=true}else if(navigator.userAgent.indexOf("Safari")>-1){Safari=true};if(window.getComputedStyle){computedStyle=function(elm,prop){return window.getComputedStyle(elm,null)[prop]}}else if(document.body.currentStyle){computedStyle=function(elm,prop){return elm.currentStyle[prop]}};var currentScript=(function(e){var scripts=document.getElementsByTagName("SCRIPT");return scripts[scripts.length-1]})(document);var path=currentScript.src;currentPath=path.substring(0,path.lastIndexOf("/"));currentPath=currentPath.substring(0,currentPath.lastIndexOf("/"))+"/";SWF_URL_INTRO=currentPath+SWF_URL_INTRO;requestUrl=this.location.href;requestUrl=requestUrl.replace(/\?(.*)$/ig,"");var tmpUrl=this.location.href;if(tmpUrl.match(/gfbp=(\d+)/i)){runTimes=RegExp.$1};if(runTimes==0){drawBlogparts()}else{drawBlogpartsDummy();addOnloadEvent(startBlogparts)};
// ]]>

