/**
 * assets.js
 * @author Tenderfeel
 * @Need:mootools 1.2
 * @last-update:2010/03/22
 */

/** QuickBox Plugin */
new Asset.javascript(DOMAIN+'/js/QuickBox.js');
new Asset.css(DOMAIN+"/css/quickbox.css",{ "media":"screen"});

//main
new Asset.javascript(DOMAIN+'/js/common.js');


//diagnosizm
if(location.href.test('diagnosizm')){
new Asset.javascript(DOMAIN+'/js/diagnosizm-min.js');
window.addEvent('domready', function(){
	new Diagnosizm({'area':'check-sheet','url':DOMAIN+'/js/question.json','before':'<span class="q">Q.','after':'</span> ','buttonText':'診断開始','restartText':'もう一度診断'});
});
}

////////////////////////////////////////////////////////////////////////
/**********************************************************************/
/**
 * SpriteNavigation
 * @ver 1.1
 */
(function($,$$){this.SpriteNavigation=new Class({Implements:[Options],options:{id:"",el:"a",current:true,duration:300},initialize:function(c){this.setOptions(c);this.target=this.options.id?$(this.options.id):$(document.body);this.navi=this.target.getElements(this.options.el);$each(this.navi,function(a){var d=a.get("class"),b=new Element("div",{"class":d,opacity:0,styles:{position:"absolute",top:0,left:0,"z-index":0,width:a.getStyle("width"),height:a.getStyle("height")}});if(a.get("tag")==="a"&&this.is_current(a.href)&& this.options.current===true){b.fade("show");a.getParent().addClass("current");b.inject(a.getParent(),"top");a.setStyle("visibility","hidden")}else{a.setStyle("background","none");b.inject(a.getParent());b.set("tween",{duration:this.options.duration});a.addEvents({mouseenter:function(){b.tween("opacity",1)},mouseleave:function(){b.tween("opacity",0)},mousedown:function(){b.addClass(d+"Click")},mouseup:function(){b.removeClass(d+"Click")}})}}.bind(this))},is_current:function(c){return document.location.href.test(c)}});})(document.id,$$);



/**
 * IE6NoMoore
 * @ver 1.1.1
 * 
 * IE6への警告を表示する
 */
(function($,$$){this.IE6NoMoore=new Class({Implements:[Options],options:{css:true,image:"images/IE6NoMore/",topMargin:75},initialize:function(a){this.setOptions(a);this.imgurl=this.options.image;this.first=$(document.body).getFirst();$this=this;this.container=new Element("div",{id:"IE6NoMore"});this.wrap=new Element("div",{"class":"wrap"});this.closebtn=new Element("img",{"class":"close",src:this.imgurl+"ie6nomore-cornerx.jpg",alt:"\u9589\u3058\u308b",events:{click:function(){this.getParent().dispose();$(document.body).setStyle("padding-top", 0);Cookie.write("IE6NoMoore","true")}}});this.warning=new Element("img",{"class":"warning",src:this.imgurl+"ie6nomore-warning.jpg",alt:"Warning!"});this.message=new Element("div",{"class":"nomore-message",html:"\u3053\u306e\u30a6\u30a7\u30d6\u30b5\u30a4\u30c8\u3092\u5feb\u9069\u306b\u95b2\u89a7\u3059\u308b\u306b\u306f\u30d6\u30e9\u30a6\u30b6\u3092\u30a2\u30c3\u30d7\u30b0\u30ec\u30fc\u30c9\u3057\u3066\u304f\u3060\u3055\u3044\u3002"});this.strongmes=new Element("strong",{html:"\u3042\u306a\u305f\u306f\u65e7\u5f0f\u30d6\u30e9\u30a6\u30b6\u3092\u3054\u5229\u7528\u4e2d\u3067\u3059"}); this.firefox=new Element("img",{src:this.imgurl+"ie6nomore-firefox.jpg",alt:"Get Firefox 3.5"});this.ie8=new Element("img",{src:this.imgurl+"ie6nomore-ie8.jpg",alt:"Get Internet Explorer 8"});this.safari=new Element("img",{src:this.imgurl+"ie6nomore-safari.jpg",alt:"Get Safari 4"});this.chrome=new Element("img",{src:this.imgurl+"ie6nomore-chrome.jpg",alt:"Get Google Chrome"});if(Browser.Engine.trident&&Browser.Engine.version<5&&!Cookie.read("IE6NoMoore")){this.first.grab(this.container,"before"); $(document.body).setStyle("padding-top",this.options.topMargin);$type(this.options.css)=="string"&&this.asset();this.start()}},start:function(){this.container.grab(this.wrap).grab(this.closebtn);this.warning.inject(this.wrap);this.message.grab(this.strongmes,"top").inject(this.wrap);(new Element("a",{href:"http://www.mozilla.jp",target:"_blank"})).grab(this.firefox).inject(this.wrap);(new Element("a",{href:"http://www.microsoft.com/downloads/details.aspx?FamilyID=341c2ad5-8c3d-4347-8c03-08cdecd8852b&DisplayLang=ja", target:"_blank"})).grab(this.ie8).inject(this.wrap);(new Element("a",{href:"http://www.apple.com/jp/safari/download/",target:"_blank"})).grab(this.safari).inject(this.wrap);(new Element("a",{href:"http://www.google.com/chrome?hl=ja",target:"_blank"})).grab(this.chrome).inject(this.wrap)},asset:function(){new Asset.css(this.options.css)}});})(document.id,$$);
/**
 * GotoTop
 * @ver 1.0
 * ページのトップに戻るボタン
 */
(function($,$$){this.GotoTop=new Class({Implements:[Options],options:{id:"gototop","class":"gotoTop",width:100},initialize:function(a){this.setOptions(a);this.width=this.options.width;if(this.gototop=$(this.options.id))this.start();else return false;new SmoothScroll({duration:500})},start:function(){var a=this;a.gototop.set("opacity","0").setStyle("display","block");window.addEvent("scroll",function(){Browser.Engine.trident4&&a.gototop.setStyles({position:"absolute",bottom:window.getPosition().y+10,width:this.width}); a.gototop.fade(window.getScroll().y>300?"in":"out")})}});})(document.id,$$);


/**
 * wtnRollover
 * @ver 1.0
 * リンク下にある画像をロールオーバーor透過処理させる
 */
(function($,$$){this.wtnRollover=new Class({Implements:[Options],options:{area:"body",over:"_on",off:"_off",duration:300},initialize:function(b){this.setOptions(b);this.overTxt=this.options.over;this.offTxt=this.options.off;(this.imgs=$$(this.options.area+" a img"))&&this.Roll();return true},Roll:function(){var b=this;b.imgs.each(function(a){if($type(a)=="element"&&!a.hasClass("rollskip")){a.set("tween",{duration:b.options.duration});a.addEvents({mouseover:function(){if(a.src.indexOf(b.offTxt)===-1)a.tween("opacity", 0.5);else a.src=a.src.replace(b.offTxt,b.overTxt)},mouseleave:function(){if(a.src.indexOf(b.overTxt)===-1)a.tween("opacity",1);else a.src=a.src.replace(b.overTxt,b.offTxt)}})}})}});})(document.id,$$);