// JavaScript Document
function ca1(thisform,X) {
	var columns = document.categoryForm.category0.length;
	for(i=0; i<columns; i++){
		if(document.categoryForm.category0.options[i].selected){
			targetText = document.categoryForm.category0.options[i].text
			targetValue = document.categoryForm.category0.options[i].value
			itemStr = document.categoryForm.elements[X].value;
			len = document.categoryForm.elements[X].options.length;
			document.categoryForm.elements[X].options[len] = new Option(itemStr,itemStr);
			document.categoryForm.elements[X].options[len].text=targetText;
			document.categoryForm.elements[X].options[len].value=targetValue;
			document.categoryForm.category0.options[i] = null;
			i --;
		}
	}
}
function ca2(thisform,X) {
	var columns = document.categoryForm.elements[X].length;
	for(i=0; i<columns; i++){
		if(document.categoryForm.elements[X].options[i].selected){
			targetText =  document.categoryForm.elements[X].options[i].text
			targetValue =  document.categoryForm.elements[X].options[i].text
			itemStr = document.categoryForm.category0.value;
			len = document.categoryForm.category0.options.length;
			document.categoryForm.category0.options[len] = new Option(itemStr,itemStr);
			document.categoryForm.category0.options[len].text=targetText;
			document.categoryForm.category0.options[len].value=targetValue;
			document.categoryForm.elements[X].options[i] = null;
			i --;
		}
	}
}
function deletedata(thisform){
    if (confirm("削除していいですか？")){
      thisform.deleteid.value=1;
      thisform.submit();
    }
}
function changedata(thisform){
    if (confirm("変更内容を反映します")){
      thisform.changeid.value=1;
      thisform.submit();
    }
}
function checkAll(thisform,countNum) {
 	flag = thisform.countcheck.checked;
	if (flag){
		for (i=1; i<=countNum; i++){
		thisform.elements["check"+i].checked = true;
		}
	}else{
		for (i=1; i<=countNum; i++){
		thisform.elements["check"+i].checked = false;
		}
	}
}
function ws_edits(thisform){
	  thisform.action = "wish_update.php";
      thisform.changeid.value=1;
      thisform.submit();
}
function ws_deleties(thisform){
	  thisform.action = "wish_delete.php";
      thisform.deletiesid.value=1;
      thisform.submit();
}
function ws_achie(thisform){
    if (confirm("チェックした願いを達成にします")){
      thisform.action = "/";
      thisform.caonid.value=1;
      thisform.submit();
	}else{
		      return false;
	}
}
function ws_nonachie(thisform){
    if (confirm("チェックした願いを進行中にします")){
      thisform.action = "/";
      thisform.caoffid.value=1;
      thisform.submit();
	}else{
		      return false;
	}
}
function ws_update(thisform){
    if (confirm("現在の内容で保存します")){
      thisform.action = "wish_update.php";
      thisform.updateid.value=1;
      thisform.submit();
	}else{
		      return false;
	}
}
function ws_edit(thisform,NUM){
	  thisform.action = "wish_update.php";
      thisform.editid.value=NUM;
      thisform.updateid.value=0;
      thisform.submit();
}
function ws_delete(thisform,NUM){
	  thisform.action = "wish_delete.php";
      thisform.deleteid.value=NUM;
      thisform.submit();
}
function ws_delete_dec(thisform){
	  thisform.action = "/";
      thisform.deletiesid.value=1;
      thisform.submit();
}