/*  BaseJQ JavaScript framework, version 3
 *  要jquery.js version 1.3.2
 *--------------------------------------------------------------------------*/ 

overImageClass= "overimage"; //ロールオーパー対象class
overImageClassFoot= "_on"; //ロールオーパーイメージ付加文字列
toggleImageFoot = "_on"; //トグル機能で現在のページを示す画像イメージ付加文字列

/*ロールオーバー・トグル*/

$(function(){
	var conf = {
		className : "." + overImageClass,
		overNode : overImageClassFoot,
		toggleNode : toggleImageFoot
	};
	//トグルエンジン実行

	if(typeof(PAGEID) != "undefined" ){	
		for(var i = 0; i < PAGEID.length; i++){
		var TGTID = PAGEID[i]
		var NODEID = "#" + TGTID
		$(NODEID).each(function(){
		this.oriSrc = this.src;
		this.cngSrc = this.oriSrc.replace(/(\.gif|\.jpg|\.png)/, conf.toggleNode+"$1");
		this.src = this.cngSrc;
		$(NODEID).removeClass(overImageClass);
		});
		};		
	};

	//ロールオーバーエンジン実行
	$(conf.className).each(function(){
		this.originalSrc = this.src;
		this.rolloverSrc = this.originalSrc.replace(/(\.gif|\.jpg|\.png)/, conf.overNode+"$1");
		
		preloadImage(this.rolloverSrc);

		}).hover(function(){
			this.src = this.rolloverSrc;
		},function(){
			this.src = this.originalSrc;
		}).click(function(){
			this.src = this.originalSrc;
		});
	
});

/*汎用スクリプトここから*/

/*イメージプリロードエンジン*/

preloadedImages = [];
function preloadImage(url){
	var p = preloadedImages;
	var l = p.length;
	p[l] = new Image();
	p[l].src = url;
};

/*ポップアップウインドウエンジン*/
function openwin(theURL,winName,features) {
	window.open(theURL,winName,features);
};

/*メインイメージ スライドエンジン*/
$(document).ready(function(){
	$('#main_view').innerfade({
		speed: 2500,
		timeout: 5000
	});
});

/*Twitter スクロールバーカスタマイズ*/
$(document).ready(function() {
		$('.scroll-pane').jScrollPane();
});


/*lightbox*/
jQuery(document).ready(function() {
$("a[rel=lightbox_shop]").fancybox({
		'padding'           : '0px',
		'margin'            : '0px',
		'cyclic'            : true,
		'width'				: 700,
		'height'			: 480,
		'type'				: 'iframe',
		'overlayOpacity'	: 0.8,
		'overlayColor'		: '#FFF'
	});
$("a[rel=lightbox_staff]").fancybox({
		'padding'           : '0px',
		'margin'            : '0px',
		'cyclic'            : true,
		'width'				: 700,
		'height'			: 480,
		'type'				: 'iframe',
		'overlayOpacity'	: 0.8,
		'overlayColor'		: '#FFF'
	});
$("a[rel=lightbox_item]").fancybox({
		'padding'           : '0px',
		'margin'            : '0px',
		'cyclic'            : true,
		'width'				: 700,
		'height'			: 480,
		'type'				: 'iframe',
		'overlayOpacity'	: 0.8,
		'overlayColor'		: '#FFF'
	});
});

/*フォーム チェックボックスカスタマイズ*/
$(document).ready( function() {
	$("input[type='checkbox']").custCheckBox();
});


