/*スパム対策*/
<!--
function vspam(im,domain) {
  maddress = "mailto:" + im + "@" + domain;
  window.location.href = maddress;
}
// -->

$(document).ready(function(){
						   
	/*ページスクロール用*/
	$('a[href*=#]').click(function() {
		if (location.pathname.replace(/^\//,'') == this.pathname.replace(/^\//,'') && location.hostname == this.hostname) {
   			var $target = $(this.hash);
			$target = $target.length && $target || $('[name=' + this.hash.slice(1) +']');
   			if ($target.length) {
  				var targetOffset = $target.offset().top;
  				$('html,body')
  				.animate({scrollTop: targetOffset}, 1000);
    			return false;
			}
		}
 	});
	
	
	/*ロールオーバーアクティブにしたい時用　クソース*/
	/*
	var bodyIdName = $("body").attr('id');
	if(bodyIdName == "company"){
		$("#g01 img").attr("src","common/imgs/shared/gnav_01_on.jpg");
	}else if(bodyIdName == "business"){
		$("#g02 img").attr("src","common/imgs/shared/gnav_02_on.jpg");
	}else if(bodyIdName == "case"){
		$("#g03 img").attr("src","common/imgs/shared/gnav_03_on.jpg");
	}else if(bodyIdName == "contact"){
		$("#g04 img").attr("src","common/imgs/shared/gnav_04_on.jpg");
	}
	*/
	
	
	/*ロールオーバー用*/
	var postfix = '_on';
	$('#gNav img, #hNav img, .over').not('[src*="'+ postfix +'."]').each(function() {
		var img = $(this);
		var src = img.attr('src');
		var src_on = src.substr(0, src.lastIndexOf('.'))
		           + postfix
		           + src.substring(src.lastIndexOf('.'));
		$('<img>').attr('src', src_on);
		img.hover(
			function() {
				img.attr('src', src_on);
			},
			function() {
				img.attr('src', src);
			}
		);
	});
	
});
