function sendData( room_id , mode ) {
	
	httpObj = createXMLHttp();
	if (httpObj) {
		httpObj.open( "get", "/js/stockdata.php?rid="+room_id+"&m="+mode, true );
		/*
		httpObj.onreadystatechange = function () {
			if (httpObj.readyState == 4 && httpObj.status == 200) {
				// 送信成功時
				document.getElementById("result").innerHTML = httpObj.responseText;
			}
		}
		*/
		httpObj.send(null);
	}

}

function send_search_condition ( obj , name ) {
	
	httpObj = createXMLHttp();
	
	obj[name].checked == true ? c_value = 1 : c_value = 0 ;
	
	if (httpObj) {
		httpObj.open( "get", "/js/change_search_condition.php?" + name + "=" + c_value, true );
		httpObj.send(null);
	}
	
	//location.href = location.href;
}

function send_orderby ( obj , name ) {
	
	httpObj = createXMLHttp();

	if (httpObj) {
		httpObj.open( "get", "/js/change_search_condition.php?" + name + "=" + obj[name].value, true );
		httpObj.send(null);
	}
}

function conditionClear ( obj , check_kazu ) {
	for ( i=0 ; i<=check_kazu ; i++ ) {
		obj[i].checked = false;
		send_search_condition(obj,obj[i].name) ;
	}
	
	obj.mc.value = "";
	obj.mr.value = "";
	
	obj.submit();
}

function createXMLHttp() {
	try {
		return new XMLHttpRequest();	
	}catch (e){
			try {
				return new ActiveXObject("Microsoft.XMLHTTP");
			}catch (e){
				return null;
			}
	}
	return null;
}

function checkstatus (obj,name) {
	//alert(obj[name].value);
	if(obj[name].checked == true) {
		sendData (name,"add") ;
	}else{
		sendData (name,"del") ;
	}
}