div_lock = 0; wd_ins = 0; c_val = ""; quit = "";

//SARCH DATA
function inc_LS_rows(){
		var fm_wd = document.LS_wd_fm.wd.value;
		if(fm_wd.length > 13){var str = fm_wd.substr(0,13)+"‥";}else{str = fm_wd;}
		document.all.n_wd.innerText = str+" の検索";

		if(fm_wd != ""){
			wd_ins = 1;
			if(quit == ""){
			var script = document.createElement('script');
			script.src = 'lib/ex_sys/LS_rows?wd='+fm_wd+'&C='+c_val;
			script.type = 'text/javascript';
			script.charset = 'UTF-8';
			document.documentElement.appendChild(script);
			}

		}else{

			wd_ins = 0;
			document.all.n_sar.innerText = '商品名や内容を記入';
			document.all.n_sar_cl.color = '#606060';
			document.all.n_wd.innerText = '';
		}
}

//DIV OPEN
function open_sar_box(){
	if(quit == ""){document.all.pre_sar.style.visibility = 'visible';}
	if(wd_ins == 0){form_clr();}
}

//DIV CLOSE
function close_sar_box(){
	if(div_lock==0){
		document.all.pre_sar.style.visibility = 'hidden';
		if(wd_ins == 0){form_ins();}
	}
}

//DIV LOCK
function lock_sar_box(loc){div_lock = loc;}

//DIV QUIT
function quit_sar_box(){quit = 1;}

//SET CTG
function set_c_sar_box(){

	var sel   = document.LS_wd_fm._c.selectedIndex;
	c_val = document.LS_wd_fm._c.options[sel].value;

	if(sel!=0){
		var fm_c = document.LS_wd_fm._c.options[sel].text;
		document.all.c_sar.innerHTML = '<div align=\"right\">'+fm_c+' 内で探す</div>';
	}else{
		document.all.c_sar.innerHTML = "";
	}

	inc_LS_rows();
}

//SUBMIT
function sar_sub(){if(wd_ins == 0){form_clr();} document.LS_wd_fm.submit();}

//FORM MSG
function form_clr(){document.LS_wd_fm.wd.value = ""; document.LS_wd_fm.wd.style.color = "#000000";}
function form_ins(){if(wd_ins == 0){document.LS_wd_fm.wd.style.color = "#b0b0b0"; document.LS_wd_fm.wd.value = "商品を検索する";}}



