var Quick = function(){};

Quick.prototype = {
	//IE6以下かの判定フラグ
	isIE6:($.browser.msie && $.browser.version < 7)? true : false,
	
	//ページの初期設定
	init:function(){
		this.pngfix();
		$("#wrapper")
			.before($("<p id='print_h' class='printitem'><img src='./images/print_h.jpg' width='142' height='29' /></p>"))
			.after($("<p id='print_b' class='printitem'>©2007 by Optima Co.,Ltd, HCS Co.,Ltd</p>"));		
	},
	
	//トップページの初期設定
	initTop:function(){
		imgs = $("#navi img,#navi_sub img").not(".selected").not(".keyvisual");
		this.preloadImages(imgs);
		this.setOverAction(imgs);
	},
	
	//２階層目独自の初期設定
	initSec:function(){
		imgs = $("#navi img,#navi_sub img").not(".selected").not(".keyvisual");
		this.preloadImages(imgs);
		this.setOverAction(imgs);
		navis = $("#tubtop a img,#tubbottom a img");
			this.preloadImages(navis);
			this.setOverAction(navis);
			this.setScroll();
	},
    
	//InterneExplorer var6.x以下への透過画像の表示設定
    pngfix:function(){
    	$("img.png").pngfix();
    },

	//画像のプリロード
   	preloadImages:function(imgs){
		$(imgs).each(function(){
			var preload = new Image;
			var img = $("img",this);
			preload.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
		})
	},
	
	//画像のロールオーバー、アウトのイベントを設定する。
	setOverAction:function(imgs){
		$(imgs)
			.bind("mouseover",function(){
				this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
			})
			.bind("mouseout",function(){
				this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");
			})
			.pngfix({mouseover:true,overimagePath:"_over"});
	},
	
	//「▲TOPへ戻る」のリンククリック時のスクロールをセット。
    setScroll:function(){
	    $('#backtop')
	    	.bind("click",function(){$('html,body').animate({ scrollTop: 0 },500);});
	    $('#backtop a').attr("href","javascript:");
    }
};