// p
if( document.charset=='euc-jp' && !/\.cgi/.test(location.href) ) {
	document.charset='utf-8';
	location.reload();
}
function search_convert() {
	if(document.charset=='utf-8'){ document.charset='euc-jp'; }
	return true;
}
function __wjs__searchbox__add_event_(obj,event_name,func){
	try{
		obj.addEventListener(event_name,func,false);
	}catch(e){
		obj.attachEvent('on'+event_name,func);
	}
}

(function() {
var form_obj = document.getElementById('searchbox-form');
if(navigator.platform == 'MacPPC' && navigator.appVersion.indexOf('MSIE') != -1){}
else if (form_obj && form_obj['query']) {
	var query_obj = form_obj['query'];
	var null_text = 'Search';
	if (navigator.platform == 'Win32') {
		query_obj.style.cssText = 'border: 1px solid #999999; padding: 2px;';
	}
	var func_blur = function() {
		if (query_obj.value == '' || query_obj.value == null_text) {
			query_obj.style.color = '#999999';
			query_obj.value = null_text;
		}
	};

	var func_focus = function() {
		if (query_obj.value == null_text) {
			query_obj.value = '';
		}
		query_obj.style.color = '#000000';
	};

	__wjs__searchbox__add_event_(query_obj, 'focus', func_focus);
	__wjs__searchbox__add_event_(query_obj, 'blur', func_blur);
	__wjs__searchbox__add_event_(form_obj, 'submit', func_focus);
	__wjs__searchbox__add_event_(form_obj, 'submit', search_convert);
	if (!/[&?]q=[^&]/.test(location.search)) { func_blur(); }
}
})();