// JavaScript Document
//confirm whether delete entrust
function delConfirm(url){
	if(confirm('削除しますか？')){
		window.location.href=url;
	}
}

//make format number to money 
function makeMoney(obj)
{
	var stmp = "";
  	if(obj.value==stmp) return;
  	var ms = obj.value.replace(/[^\d\.]/g,"").replace(/(\.\d{2}).+$/,"$1").replace(/^0+([1-9])/,"$1").replace(/^0+$/,"0");
  	var txt = ms.split(".");
  	while(/\d{4}(,|$)/.test(txt[0]))
     	txt[0] = txt[0].replace(/(\d)(\d{3}(,|$))/,"$1,$2");
  	obj.value = stmp = txt[0]+(txt.length>1?"."+txt[1]:"");
}
//watering prevent function
function wateringPrevent(){
	var hiddenObj = document.getElementById("wateringprevent");
	hiddenObj.value = "buhuman";
	if (hiddenObj.value == "buhuman"){
		hiddenObj.value = "buhumantrue";
	}
}

