var $img, img_title;
$(function(){
	// 画像拡大
	$('a[rel]', '#conte')
		.each(function(){
			$img = $(this).children('img');
			img_title = $img.attr('title');
			if(!img_title)
				img_title = $img.attr('alt');
			if(img_title && $(this).attr('title') == '')
				$(this).attr('title', img_title);
		})
		.fancybox({
			//'padding': 0,
			'cyclic': true,
			'titlePosition': 'inside', 
			'overlayColor'	: '#000'		
		});
	
	// モーダルウィンドウ	
	$('a.fancybox_inline', '#conte').fancybox({
		'margin': 0,
		'padding': 0,
		'overlayColor': '#000',
		'titleShow': false
	});
	
	// 入力フォームの幅調整
	$('input[size], textarea[cols]', '#conte div.order_waku').each(function(){
		var sz = $(this).attr('size') || $(this).attr('cols');
		if(sz) {
			sz = (sz|0)/2;
			$(this).css('width', sz + "em");
		}
  	});	
});

//タブ切替
function seltab(bpref, hpref, id_max, selected) {
  if (! document.getElementById) return;
  for (i = 0; i <= id_max; i++) {
    if (! document.getElementById(bpref + i)) continue;
    if (i == selected) {
      document.getElementById(bpref + i).style.display = "block";
      document.getElementById(bpref + i).style.position = "";
      document.getElementById(hpref + i).className = "open";
    } else {
      document.getElementById(bpref + i).style.display = "none";
      document.getElementById(bpref + i).style.position = "absolute";
      document.getElementById(hpref + i).className = "close";
    }
  }
}

