/*
	title:			コアjavascript
	author:		T.Nagayama (WITHWIND)
	description:	サイト全体で共通の処理をおこなう。
	history:		
	required:		jquery.js(jQuery core)
*/

/*jQueryのおまじない*/
var wwjq=jQuery.noConflict();

/*コアクラスの設定*/
var wwcore;
if(!wwcore)wwcore={};

/*夢･地球交響博用*/
if(!wwcore.expo)wwcore.expo={};


/*
	javascript ON/OFFクラス設定
	wwcore.json
*/
if(!wwcore.json)wwcore.json={};
wwcore.json.set = function() {
	wwjq("body").removeClass("js_off");
	wwjq("body").addClass("js_on");
	return ;
}

/*
	navigation画像切り替え
	wwcore.navi_img
*/
if(!wwcore.navi_img)wwcore.navi_img={};
wwcore.navi_img.set = function(){
	
	wwjq("img[ref='over']")
			.bind('mouseover', this.enter)
			.bind('mouseout', this.exit)
			.each(this.preload);
}
wwcore.navi_img.enter = function(){
	this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
}
wwcore.navi_img.exit = function(){
	this.src = this.src = this.src.replace(/^(.+)_over(\.[a-z]+)$/, "$1$2");
}
wwcore.navi_img.preload = function(){
	this.preloaded = new Image;
	this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_over$2");
}


/*処理実行*/
wwjq(function (){
	wwcore.json.set();
	wwcore.navi_img.set();
});
