// JavaScript Document
//IE互換用
if(!Array.prototype.forEach)
{
  Array.prototype.forEach = function(fun /*, thisp*/)
  {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();

    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in this)
        fun.call(thisp, this[i], i, this);
    }
  };
}
if(!Array.indexOf){
	Array.prototype.indexOf = function(object){
		for(var i = 0; i < this.length; i++){
			if(this[i] == object){
				return i;
			}
		}
		return -1;
	}
}
// / IE互換用


function globalnaviStyle(){
	var word_gunMachine = 'gun-machine';
	var word_drillReamer = 'drill_reamer';
	var word_lapping = 'lapping-surface-plate';
	
	var url=window.location.href;
	if(url.indexOf(word_gunMachine) != -1){
		$("#gn_" + word_gunMachine).addClass("act");	
	}
	if(url.indexOf(word_drillReamer) != -1){
		$("#gn_" + word_drillReamer).addClass("act");	
	}
	if(url.indexOf(word_lapping) != -1){
		$("#gn_" + word_lapping).addClass("act");	
	}
	
}

function localnaviStyle(){
	// htmlファイル名取得
	var arr_url=window.location.href.split('/');
	var currentPage = arr_url[(arr_url.length)-1];
	
	//if(currentPage != 'index.html'){
		// ローカルナビのhref内容と比べる
		$("ul.branch li a").each(function(){
			var itemHref = $(this).attr("href");
			if(itemHref == currentPage){
				$(this).addClass('act');
			}
		});
	//}
	
}
