//////////////////////////////////////////////////
//フォーム入力ガイドの表示

//ガイドの内容
function GetGuideSentence(id){

	var GuideSentence = {};
	GuideSentence['mysearch'] = 'サイト内検索';

	return GuideSentence[id];
}

//初期化（onLoad）
function SetFormGuide(id){
	var GuideSentence = GetGuideSentence(id);
	if(document.getElementById(id)){
		document.getElementById(id).value = GuideSentence;
		document.getElementById(id).style.color = '#808080';
	}else{
		return false;
	}
}

//表示（onFocus）
function ShowFormGuide(obj){
	var GuideSentence = GetGuideSentence(obj.id);
	if( obj.value == '' ){
		obj.value = GuideSentence;
		obj.style.color = '#808080';
	}
}

//非表示（onBlur）
function HideFormGuide(obj){
	var GuideSentence = GetGuideSentence(obj.id);
	if( obj.value == GuideSentence ){
		obj.value='';
		obj.style.color = '#000000';
	}
}

//////////////////////////////////////////////////
//検索フォームの送信
function SearchSubmit(id){
	var GuideSentence = GetGuideSentence(id);
	var value = document.getElementById(id).value;
	if(GuideSentence == value){
		return false;
	}else{
		document.form_search.submit();
	}
}

//////////////////////////////////////////////////////////////
//拡大図
function CUwindow(f,x,y,t){

	var win;
	var styleStr = "";

	if(x == undefined){ x = 400;}
	if(y == undefined){ y = 300;}

	w = 12 +x;
	h = 70 +y;

	styleStr = 'width=' +w+ ',height=' +h;
	styleStr += ',menubar=no,toolbar=no,location=no,directories=no,status=no,scrollbars=no,resizable=yes';

	win = window.open("","SubWindow",styleStr);
	win.document.clear();
	win.window.resizeTo(w,h);

	with (win.document) {
		write('<html lang="ja"><head><title>'+t+'</title></head>');
		write('<body style="margin:0;">');
		//write('<img src="'+f+'" alt="">');
		write('<div style="width:'+w+'px; height:'+h+'px; background:url('+f+') no-repeat;">');
		write('&nbsp;');
		write('</div>');
		write('</body></html>');
	}

	win.document.close();
	win.focus();

}

//////////////////////////////////////////////////
//ページ先頭へ
function ToPageHead(){
	
	location.replace(location.pathname);

}


