$(function() {

	//フォーカスを当てると文字が消える検索窓
	$('input.gsc-input').focus(function() {
		if($(this).hasClass('dummy-text')) {
			$(this).removeClass('dummy-text').val('');
		}
	})
	.blur(function() {
		if($(this).val().length == 0) {
			$(this).addClass('dummy-text').val('サイト内検索');
		}
	})
	.blur();


	//fancybox用
	$('a[href$=".jpg"] , a[href$=".gif"] , a[href$=".png"]').fancybox();
	$('.fancybox').fancybox();

	//jquery.flatheights.js用
	//div要素を2つずつの組に分ける
/*
	var sets = [], temp = [];
	$('#temp-e .product-info').each(function(i) {
		temp.push(this);
		if (i % 2 == 1) {
			sets.push(temp);
			temp = [];
		}
	});
	if (temp.length) sets.push(temp);
*/
	//各組ごとに高さ揃え
/*
	$.each(sets, function() {
		$(this).flatHeights();
	});
*/

	$('#temp-e .product-info').flatHeights();
	$('#temp-i .product-info').flatHeights();
	$('#temp-o #home-contents > div').flatHeights();
	$('#temp-d .product-evertz').flatHeights();
	//$('.flatheights div').flatHeights();

	//#company-info 高さ揃え
	//$("#company-info table").attr("height", "111");


	// 現在地のハイライト
	$page = $.url().attr('file');
	if($page) {
		$('#side-nav li').each(function(){
			var $href = $(this).children("a").url().attr('file');
			if ( ($href == $page) ) {
					$(this).addClass('here');
			}
		});
	}

});

