//onLoad event add
if (window.addEventListener) { //for W3C DOM
	window.addEventListener("load", YMonloadFunction, false);
} else if (window.attachEvent) { //for IE
	window.attachEvent("onload", YMonloadFunction);
} else  {
}

//Initialize setting
function YMonloadFunction() {
	if (document.getElementById('MF_form_phrase')) {
		YMsearchText = document.getElementById('MF_form_phrase');
		YMsearchTextValue= YMsearchText.value;
		YMsearchTextCol = YMsearchText.style.color;
		YMsearchText.onfocus = YMsitesearchClear;
		YMsearchText.onblur = YMsitesearchSet; 
	}
	if(document.getElementById("YMLocalNavigationArea") && document.getElementById("ContentsArea")){
		var lnaviH = document.getElementById("YMLocalNavigationArea").offsetHeight;
		var contH = document.getElementById("ContentsArea").offsetHeight;
		if(contH<lnaviH) {
			document.getElementById("ContentsArea").style.height = lnaviH+"px";
		}
	}
}

//Search Display
function YMsitesearchClear() {
	if(YMsearchText.value==YMsearchTextValue) {
		YMsearchText.value ="";
	}
	YMsearchText.style.color = '#000000';
	return;
}
function YMsitesearchSet() {
	if(YMsearchText.value=="") {
		YMsearchText.value =YMsearchTextValue;
		YMsearchText.style.color = YMsearchTextCol;
	}
	return;
}

//common Function : WIindow Open
var detect = navigator.userAgent.toLowerCase();
var OS,browser,version,total,thestring;
function checkIt(string){
	place = detect.indexOf(string) + 1;
	thestring = string;
	return place;
}
if (checkIt('safari')) { 
	function YMopenWindow (theURL,winName,features) {
		window.open(theURL, winName, features);
		return false;
	}
} else {
	function YMopenWindow (theURL,winName,features) {
//		features.replace(/height/i, $1);
		window.open(theURL, winName, features);
		return false;
	}
}