// for naviFunction toolbar

var j$ = jQuery;
//current page navigator
j$(function(){
	filePath = location.pathname;
	dirName = new Array();
	dirName = filePath.split("/");
	currentSubDir = dirName[2];
	currentDir = dirName[1];
	entryID = location.hash;
	if((filePath != "/index.html") && (filePath != "/")){
		setCurrentL = "#localNavi a[href*=" + currentSubDir + "]";
		setCurrent = "#globalNavi a[href*=" + currentDir + "]";
		j$(setCurrent).addClass("current");
		j$(setCurrentL).addClass("current");
		if(entryID == ""){
			setCurrentC = ".sideBar a[href*=" + filePath + "]";
			j$(setCurrentC).addClass("current");
		}
	}
});

//beforework photo gallary
j$(function(){//photoSelector
	img_over = "/img/maru_move.gif";//マウスオーバー		
	img_selector = "/img/maru_red.gif";//選択（クリック）
	img_normal = "/img/maru_gray.gif";//通常時
	j$("#photoSelector01 img").addClass("current");//初期化
	j$("#photoSelector .current").attr("src",img_selector);
	j$("#photoSelector img").mouseover(function(){//マウスオーバー
		j$(this).attr("src",img_over);
	});
	j$("#photoSelector img").click(function(){//クリック
		j$("#photoSelector .current").attr("src",img_normal).removeAttr("class");
		j$(this).addClass("current");
	});
	j$("#photoSelector img").mouseout(function(){//マウスアウト
		currentSelect = j$(this).attr("class");
		if(currentSelect == "current"){
		j$(this).attr("src",img_selector);
		} else {
		j$(this).attr("src",img_normal);
		}
	});
});

j$(function(){//photoFrame
	j$("#photo01").addClass("current");
	j$("#photoFrame .current").fadeIn("3000");
	j$("#photoSelector a").click(function(){//クリック
		selectPhoto = j$(this).attr("href");
		//selectPhoto = selectPhoto.substr(1,7);
		//photoRootPath = "img/sample/";
		//photoURL = photoRootPath + selectPhoto + ".jpg";
		j$("#photoFrame .current").fadeOut("3000").css("display","none").removeAttr("class");
		j$(selectPhoto).addClass("current");
		j$("#photoFrame .current").fadeIn("3000");
	});
});
