$(function(){

//=== rolloverimage making ===
	$('a.bt').each(function(){
		$(this).removeClass('bt');
		$(this).wrap('<span class="bt">');
	}
	);
	$('.bt a:has(img)').hover(function(){
		var imgsrc = $(this).find('img').attr('src').replace(/\.(gif|png|jpg|jpeg)$/i,'_ro.$1');
		$(this).find('img').attr('src',imgsrc);
		},function(){
		var imgsrc = $(this).find('img').attr('src').replace(/_ro\.(gif|png|jpg|jpeg)$/i,'.$1');
		$(this).find('img').attr('src',imgsrc);
	});




//=== imgcaption & img lightbox ===
// ===captionblock===
	$('img.fcr').each(function(){
		var captxt = $(this).attr('alt').replace('[/url]','</a>').replace(']','">').replace('[url=','<a class="noicon" href="');
		var capwidth = $(this).attr('width');
		capwidth=capwidth+10;
		$(this).wrap('<div style="width:'+capwidth+'px;font-size:90%;float:right;margin:0 0 10px 10px;text-align:center;dispay:block;">');
		$(this).attr('alt','').after('<br />'+captxt);
	});

	$('img.fcl').each(function(){
		var captxt = $(this).attr('alt').replace('[/url]','</a>').replace(']','">').replace('[url=','<a class="noicon" href="');
		var capwidth = $(this).attr('width');
		capwidth=capwidth+10;
		$(this).wrap('<div style="width:'+capwidth+'px;font-size:90%;float:left;margin:0 10px 10px 0;text-align:center;dispay:block;">');
		$(this).attr('alt','').after('<br />'+captxt);
	});


	$('img.fcc').each(function(){
		var captxt = $(this).attr('alt').replace('[/url]','</a>').replace(']','">').replace('[url=','<a class="noicon" href="');
		$(this).wrap('<span style="text-align:center;font-size:90%;margin:0 10px 10px 0;clear:both;dispay:block;">');
		$(this).attr('alt','').after('<br />'+captxt);
	});

	// ===lightbox===
	$('a.lb').each(function(){
		var altx = $(this).find('img').attr('alt');
		var altx = '画像拡大表示' + altx;
		$(this).find('img').attr('alt',altx);
		$(this).lightBox();
	});


	$("table#order_form_table tr:odd").addClass("odd");
	$("table#order_form_table tr:even").addClass("even");



});
