/* ************************************************************************

Site: SAKAMOTO CO., LTD.
File: home.js
---
Last Update: 2011/03/22
Create Date: 2011/03/22
---
(c) SAKAMOTO CO., LTD. | http://www.sakamoto-gr.co.jp/

************************************************************************ */

document.write('<script type="text/javascript" src="/common/js/jquery.rotate.js"></script>');var subObj;var subObjAni1;var ieGenreIni;for(e=1;e<=7;e++){eval("var subObjSize"+e+"= "+e+"");}$(function(){$("h1#logo,p#companyOutline").hide();subObj=new Array(7);subObj=["span#message2 img","span#message3 img","span#message4 img","span#message5 img","span#message7 img","span#message8 img","span#message9 img"];subObjSize=new Array(7);for(g=1;g<=7;g++){eval("subObjSize["+g+"] = {width: $(subObj["+(g-1)+"]).width(),height: $(subObj["+(g-1)+"]).height()};");}for(r=0;r<7;r++){$(subObj[r]).css({marginLeft:$(subObj[r]).width()-$(subObj[r]).width()/2,marginTop:$(subObj[r]).height()-$(subObj[r]).height()/2});}$("span#message2 img,span#message3 img,span#message4 img,span#message5 img,span#message7 img,span#message8 img,span#message9 img").css({height:"0px",width:"0px"});$("p#philosophyIcon a img").css({marginLeft:$("p#philosophyIcon a img").width()+10});$("p#philosophyLink a img").css({marginLeft:-($("p#philosophyLink a img").width()+10)});$("span#message1").rotate(-90);$("span#message1").css({left:"67px",top:"91px"});$("span#message1 img").css({height:"100px",width:"0px"});$("span#message6").rotate(90);$("span#message6").css({left:"451px",top:"91px"});$("span#message6 img").css({height:"100px",width:"0px"});ieGenreIni=$("p.genrePict span");if($.browser.msie&&$.browser.version<10){ieGenreIni=$("p.genrePict span");$(ieGenreIni).css({opacity:"0"});$(ieGenreIni).each(function(){$(this).mouseover(function(){$(this).animate({opacity:"1"},400);});$(this).mouseout(function(){$(this).animate({opacity:"0"},400);});});}});var bouseValue={speed:260,delay:400,delay2:50};var subAniValue={speed:260,delay:400};var aniFlg=1;function homeAnimationStart(){$("span#message1").rotateAnimation(0);$("span#message1").delay(10).animate({left:"6px",top:"91px"},600,"easeOutCirc");$("span#message1 img").delay(10).animate({height:"129px",width:"128px"},600,"easeOutCirc",function(){homeAnimationBounce($("span#message1 img"),bouseValue.speed,bouseValue.delay);});$("span#message6").rotateAnimation(0);$("span#message6").delay(10).animate({left:"451px",top:"91px"},600,"easeOutCirc");$("span#message6 img").delay(10).animate({height:"129px",width:"263px"},600,"easeOutCirc");}var bounceFlg="true";function homeAnimationBounce(obj,speed,dly){if(bounceFlg=="true"){var finScale={width:obj.width(),height:obj.height()};$(obj).delay(dly).animate({width:(obj.width()*0.5),height:(obj.height()*0.5),marginLeft:(obj.width()-obj.width()*0.5)/2,marginTop:(obj.height()-obj.height()*0.5)/2},speed,"easeOutCubic",function(){bouceFase2();});function bouceFase2(){$(obj).animate({width:(obj.width()*2.6),height:(obj.height()*2.6),marginLeft:(finScale.width-obj.width()*2.6)/2,marginTop:(finScale.height-obj.height()*2.6)/2},speed*0.8,"easeInCubic",function(){bouceFase3();homeAnimationSub(600,0);});}function bouceFase3(){$(obj).animate({width:finScale.width,height:finScale.height,marginLeft:"0px",marginTop:"0px"},speed*0.7,"easeOutCubic",function(){bounceFlg="true";if(aniFlg==2){aniFlg=3;}});}}}var aniFlgFin=0;var aniSizeNum=0;function homeAnimationSub(speed,dly){dlyCount=dly;if(aniFlg==1){aniSizeNum=0;subObjAni1Limit=4;subObjAni1=new Array(4);subObjAni1=["span#message2 img","span#message3 img","span#message4 img","span#message5 img"];}else if(aniFlg==2){aniSizeNum=4;subObjAni1Limit=3;subObjAni1=new Array(3);subObjAni1=["span#message7 img","span#message8 img","span#message9 img"];}for(d=0;d<subObjAni1Limit;d++){dlyCount+=60;$(subObjAni1[d]).delay(dlyCount-60).animate({width:eval("subObjSize["+(d+1+aniSizeNum)+"].width"),height:eval("subObjSize["+(d+1+aniSizeNum)+"].height"),marginLeft:"0px",marginTop:"0px"},speed,"easeOutCubic",function(){if(aniFlg==1){aniFlg=2;homeAnimationBounce($("span#message6 img"),bouseValue.speed,bouseValue.delay2);}else if(aniFlg==3){aniFlgFin+=1;if(aniFlgFin==3){homeAnimationLast();}}});}}var lastFin=0;function homeAnimationLast(){$("h1#logo,p#companyOutline,p#philosophyIcon,p#philosophyLink").delay(200).fadeTo(1200,1);$("p#philosophyIcon a img,p#philosophyLink a img").delay(200).animate({marginLeft:"0px"},800,"easeOutCirc",function(){lastFin+=1;if(lastFin==1){if($.browser.msie&&$.browser.version<10){$('<a>',{id:"homeLink",href:"/philosophy/",style:"width: 980px;height: 170px;position: absolute;left: 0px;top: 50px;z-index: 100;cursor: pointer;",html:"<img src='/common/image/space.gif' width='980' height='170' />"}).appendTo('div#visualArea header');}else{$("<a>",{id:"homeLink",href:"/philosophy/",style:"width: 980px;height: 170px;position: absolute;left: 0px;top: 50px;z-index: 100;cursor: pointer;"}).appendTo("div#visualArea header");}homeLinkAction();}});}var homeLinkTriger;function homeLinkAction(){homeLinkTriger=$("a#homeLink");mainImg=$("p#philosophyIcon a img");mainImgB=$("p#philosophyLink a img");$(homeLinkTriger).mouseover(function(){$(mainImg).attr("src",$(mainImg).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_on$2"));$(mainImgB).attr("src",$(mainImgB).attr("src").replace(/^(.+)(\.[a-z]+)$/,"$1_on$2"));homeAnimationBounce($("span#message1 img"),200,10);homeAnimationBounce($("span#message6 img"),200,10);bounceFlg="flase";});$(homeLinkTriger).mouseout(function(){$(mainImg).attr("src",$(mainImg).attr("src").replace(/^(.+)_on(\.[a-z]+)$/,"$1$2"));$(mainImgB).attr("src",$(mainImgB).attr("src").replace(/^(.+)_on(\.[a-z]+)$/,"$1$2"));});}var intTime=0;function fncLazy(fncName,delay){intTime=setInterval("fncLazyMove("+fncName+")",delay);}function fncLazyMove(fncAction){clearInterval(intTime);fncAction;}$(window).bind("load",function(){fncLazy("homeAnimationStart()",500);});
