﻿







function Select_Cpu() {

	Result_Output();
}



function Select_Mem(mem_form) {
	mem_select_max = new Array();

	if(memex_f == 1) {

		var mem_max = mem_sum_max_num[mem_form.form.memex.selectedIndex];
	}
	else{

		var mem_max = mem_sum_max_num[0];
	}

	for(i=0;i<mem_select_init_num.length;i++){
		mem_select_max[i] =mem_max;
	}


	Adjust_Select_Num(mem_form.form,"memnum",0,mem_select_init_num.length,
			  mem_select_min_num,mem_select_max,mem_select_init_num,
			  mem_sum_min_num,mem_max,0);

	Result_Output();
}



function Select_Unit(unit_form,henkan_form,eikyou_form) {
	unit_select_max = new Array();
	var hdd_selected_num =0;



	unit_select_max = unit_select_max_num_hdd_0;
	var unit_max = unit_sum_max_num[0];


	if(hdd_unitbay_henkan_f == 1){

		if(hdd_henkan_f ==1){

			for(i=0;i<hdd_select_init_num.length;i++){
				hdd_selected_num += Number(henkan_form["hdd1num"+i].value);
			}
			if((document.fhdd.hddinch[1].checked) &&
		   	(hdd_selected_num > hdd1_sum_max_num[0])){

				var unit_max = unit_sum_max_num[1];
				unit_select_max = unit_select_max_num_hdd_1;
			}
		}
		else{

			for(i=0;i<hdd_select_init_num.length;i++){
				hdd_selected_num += Number(henkan_form["hdd0num"+i].value);
			}
			if(hdd_selected_num > hdd0_sum_max_num[0]){

				var unit_max = unit_sum_max_num[1];
				unit_select_max = unit_select_max_num_hdd_1;
			}
		}
	}


	Adjust_Select_Num(unit_form.form,"unitnum",0,unit_select_init_num.length,
			  unit_select_min_num,unit_select_max,unit_select_init_num,
			  unit_sum_min_num,unit_max,0);


	if(hdd_unitbay_henkan_f == 1){

		var unit_selected_num = 0;
		for(i=0;i<unit_form.form.length;i++){
			unit_selected_num += Number(unit_form.form["unitnum"+i].value);
		}

		if(unit_selected_num > unit_sum_max_num[1]){

			var adjust_max = hdd0_sum_max_num[0];
		}
		else{

			if((array_hdd_f == 0) ||
			   (array_hdd_f == 1
			    && Number(eikyou_form["pcinum"+1].value) > 0)){

				var adjust_max = hdd0_sum_max_num[1];
			}
			else {

				var adjust_max = hdd0_sum_max_num[0];
			}
		}

		adjust_select_max = new Array();
		for(i=0;i<hdd_select_init_num.length;i++){
			adjust_select_max[i] =adjust_max;
		}


		Adjust_Select_Num(henkan_form,"hdd0num",0,hdd_select_init_num.length,
				  hdd_select_min_num,adjust_select_max,hdd_select_init_num,
				  hdd_sum_min_num,adjust_max,0);

		if(hdd_henkan_f == 1){

			if(unit_selected_num > unit_sum_max_num[1]){

				var adjust_max = hdd1_sum_max_num[0];
			}
			else{

				if((array_hdd_f == 0) ||
				   (array_hdd_f == 1
				   && Number(eikyou_form["pcinum"+1].value) > 0)){

					var adjust_max = hdd1_sum_max_num[1];
				}
				else{

					var adjust_max = hdd1_sum_max_num[0];
				}
			}

			adjust_select_max = new Array();
			for(i=0;i<hdd_select_init_num.length;i++){
				adjust_select_max[i] =adjust_max;
			}


			Adjust_Select_Num(henkan_form,"hdd1num",0,hdd_select_init_num.length,
					  hdd_select_min_num,adjust_select_max,
					  hdd_select_init_num,hdd_sum_min_num,adjust_max,0);
		}
	}

	Result_Output();
}




function Select_Hdd(hdd_form,henkan_form,eikyou_form) {

	if(hdd_form.name != "hddinch"){
		var henkan_selected_num = 0;
		hdd_select_max = new Array();


		for(i=0;i<unit_select_init_num.length;i++){
			henkan_selected_num
			 += Number(henkan_form["unitnum"+i].value);
		}
		var hdd_select_name = hdd_form.name.substr(0,7);
		var hdd_name = hdd_form.name.substr(0,4);

		if(hdd_unitbay_henkan_f == 0 ||
		   henkan_selected_num > unit_sum_max_num[1]){

			var adjust_max = eval(hdd_name + "_sum_max_num[0]");
		}
		else{

			if((array_hdd_f == 0) ||
			   (array_hdd_f == 1
			    && Number(eikyou_form["pcinum"+1].value) > 0)){

				var adjust_max = eval(hdd_name + "_sum_max_num[1]");
			}
			else{

				var adjust_max = eval(hdd_name + "_sum_max_num[0]");
			}
		}

		adjust_select_max = new Array();
		for(i=0;i<hdd_select_init_num.length;i++){
			adjust_select_max[i] =adjust_max;
		}


		Adjust_Select_Num(hdd_form.form,hdd_select_name,0,
				  hdd_select_init_num.length,
			  	  hdd_select_min_num,adjust_select_max,
				  hdd_select_init_num,hdd_sum_min_num,adjust_max,0);


		if(hdd_unitbay_henkan_f == 1){


			var hdd_selected_num = 0;
			if(hdd_henkan_f == 1){


				var hdd_sum_max_num = hdd1_sum_max_num[0];
				for(i=0;i<hdd_select_init_num.length;i++){
					hdd_selected_num
					 += Number(hdd_form.form["hdd1num"+i].value);
				}
			}
			else{


				var hdd_sum_max_num = hdd0_sum_max_num[0];
				for(i=0;i<hdd_select_init_num.length;i++){
					hdd_selected_num
					 += Number(hdd_form.form["hdd0num"+i].value);
				}
			}

			if(hdd_selected_num > hdd_sum_max_num){

				var adjust_max = unit_sum_max_num[1];
				adjust_select_max = unit_select_max_num_hdd_1;
			}
			else{

				var adjust_max = unit_sum_max_num[0];
				adjust_select_max = unit_select_max_num_hdd_0;
			}


			Adjust_Select_Num(henkan_form,"unitnum",0,
					  unit_select_init_num.length,
					  unit_select_min_num,adjust_select_max,
					  unit_select_init_num,
					  unit_sum_min_num,adjust_max,0);
		}
	}
	else{



		if(hdd_unitbay_henkan_f == 1 && array_hdd_f ==1){

			eikyou_select_max_num = new Array();
			for(i=0;i<pci_select_init_num.length;i++){
				eikyou_select_max_num[i] 
				 = eval("pci_select_max_num_hdd_"+hdd_form.value+"["+i+"]");
			}



			Adjust_Select_Num(eikyou_form,"pcinum",0,pci_select_init_num.length,
			  pci_select_min_num,eikyou_select_max_num,pci_select_init_num,
			  pci_sum_min_num,pci_sum_max_num,0);


			var henkan_selected_num = 0;
			for(i=0;i<unit_select_init_num.length;i++){
				henkan_selected_num
				 += Number(henkan_form["unitnum"+i].value);
			}	

			if(henkan_selected_num > unit_sum_max_num[1]){

				var adjust_max = hdd0_sum_max_num[0];
			}
			else{

				if((array_hdd_f == 0) ||
				   (array_hdd_f == 1
				    && Number(eikyou_form["pcinum"+1].value) > 0)){

					var adjust_max = hdd0_sum_max_num[1];
				}
				else{

					var adjust_max = hdd0_sum_max_num[0];
				}
			}

			adjust_select_max = new Array();
			for(i=0;i<hdd_select_init_num.length;i++){
				adjust_select_max[i] =adjust_max;
			}


			Adjust_Select_Num(hdd_form.form,"hdd0num",0,
					  hdd_select_init_num.length,
			  		  hdd_select_min_num,adjust_select_max,
					  hdd_select_init_num,
					  hdd_sum_min_num,adjust_max,0);

			if(hdd_henkan_f == 1){

				if(henkan_selected_num > unit_sum_max_num[1]){


					var adjust_max = hdd1_sum_max_num[0];
				}
				else{

					if((array_hdd_f == 0) ||
					   (array_hdd_f == 1
					    && Number(eikyou_form["pcinum"+1].value) > 0)){

						var adjust_max = hdd1_sum_max_num[1];
					}
					else{

						var adjust_max = hdd1_sum_max_num[0];
					}
				}

				adjust_select_max = new Array();
				for(i=0;i<hdd_select_init_num.length;i++){
					adjust_select_max[i] =adjust_max;
				}


				Adjust_Select_Num(hdd_form.form,"hdd1num",0,
						  hdd_select_init_num.length,
						  hdd_select_min_num,adjust_select_max,
						  hdd_select_init_num,
						  hdd_sum_min_num,adjust_max,0);
			}




			var hdd_selected_num = 0;
			if(hdd_henkan_f == 1){

				var hdd_sum_max_num = hdd1_sum_max_num[0];
				for(i=0;i<hdd_select_init_num.length;i++){
					hdd_selected_num
					 += Number(hdd_form.form["hdd1num"+i].value);
				}
			}
			else{

				var hdd_sum_max_num = hdd0_sum_max_num[0];
				for(i=0;i<hdd_select_init_num.length;i++){
					hdd_selected_num
					 += Number(hdd_form.form["hdd0num"+i].value);
				}
			}

			if(hdd_selected_num > hdd_sum_max_num){

				var adjust_max = unit_sum_max_num[1];
				adjust_select_max = unit_select_max_num_hdd_1;
			}
			else{

				var adjust_max = unit_sum_max_num[0];
				adjust_select_max = unit_select_max_num_hdd_0;
			}


			Adjust_Select_Num(henkan_form,"unitnum",0,
					  unit_select_init_num.length,
					  unit_select_min_num,adjust_select_max,
					  unit_select_init_num,
					  unit_sum_min_num,adjust_max,0);


			if(redundant_psu_hdd_f == 1){

				if(hdd_form.value == 1){

                                        if(document.getElementById) {
                                          document.getElementById("psu0").style.display = "none";
                                          document.getElementById("psu1").style.display = "inline";
                                        } else {
                                          return false;
                                        }
				}
			}

				if(hdd_form.value == 0){

					if(document.getElementById) {
                                          document.getElementById("psu1").style.display = "none";
                                          document.getElementById("psu0").style.display = "inline";
                                        } else {
                                          return false;
                                        }
				}
		}
	}

	Result_Output();
}



function Select_Pci(pci_form,henkan_form,eikyou_form) {
	adjust_select_max_num = new Array();


	if(hdd_unitbay_henkan_f == 1 && array_hdd_f ==1){

		if(hdd_henkan_f == 0 || henkan_form.hddinch[0].checked){
			hddinchval = 0;
		}
		else {
			hddinchval = 1;
		}
		for(i=0;i<pci_select_init_num.length;i++){
			adjust_select_max_num[i] 
		 	= eval("pci_select_max_num_hdd_"+hddinchval+"["+i+"]");
		}
	}
	else{

		for(i=0;i<pci_select_init_num.length;i++){
			adjust_select_max_num[i] = pci_select_max_num[i];
		}
	}

	if(array_haita_f == 1){
		if((pci_form.form["pcikind0"].value == 1)
		 && (pci_form.form["pcinum0"].value == 1)){

				adjust_select_max_num[1] = 0;
				pci_form.form["pcinum1"].value = 0;

		}
	}


	Adjust_Select_Num(pci_form.form,"pcinum",0,pci_select_init_num.length,
			  pci_select_min_num,adjust_select_max_num,
			  pci_select_init_num,pci_sum_min_num,pci_sum_max_num,0);


	var eikyou_selected_num = 0;
	for(i=0;i<unit_select_init_num.length;i++){
		eikyou_selected_num += Number(eikyou_form["unitnum"+i].value);
	}


	if(hdd_unitbay_henkan_f == 0 ||
	   eikyou_selected_num > unit_sum_max_num[1]){

		var adjust_max = hdd0_sum_max_num[0];
	}
	else{

		if((array_hdd_f == 0) ||
		   (array_hdd_f == 1
		    && Number(pci_form.form["pcinum"+1].value) > 0)){

			var adjust_max = hdd0_sum_max_num[1];
		}
		else{

			var adjust_max = hdd0_sum_max_num[0];
		}
	}

	adjust_select_max = new Array();
	for(i=0;i<hdd_select_init_num.length;i++){
		adjust_select_max[i] =adjust_max;
	}


	Adjust_Select_Num(henkan_form,"hdd0num",0,hdd_select_init_num.length,
			  hdd_select_min_num,adjust_select_max,hdd_select_init_num,
			  hdd_sum_min_num,adjust_max,0);

	if(hdd_henkan_f == 1){

		if(hdd_unitbay_henkan_f == 0 ||
		   eikyou_selected_num > unit_sum_max_num[1]){


			var adjust_max = hdd1_sum_max_num[0];
		}
		else{

			if((array_hdd_f == 0) ||
			   (array_hdd_f == 1
			    && Number(pci_form.form["pcinum"+1].value) > 0)){

				var adjust_max = hdd1_sum_max_num[1];
			}
			else{

				var adjust_max = hdd1_sum_max_num[0];
			}
		}

		adjust_select_max = new Array();
		for(i=0;i<hdd_select_init_num.length;i++){
			adjust_select_max[i] =adjust_max;
		}


		Adjust_Select_Num(henkan_form,"hdd1num",0,hdd_select_init_num.length,
				  hdd_select_min_num,adjust_select_max,hdd_select_init_num,
				  hdd_sum_min_num,adjust_max,0);
	}



	if(hdd_unitbay_henkan_f == 1){
		var hdd_selected_num = 0;

		if(hdd_henkan_f == 1){

			var hdd_sum_max_num = hdd1_sum_max_num[0];
			for(i=0;i<hdd_select_init_num.length;i++){
				hdd_selected_num
				 += Number(henkan_form["hdd1num"+i].value);
			}
		}
		else{

			var hdd_sum_max_num = hdd0_sum_max_num[0];
			for(i=0;i<hdd_select_init_num.length;i++){
				hdd_selected_num
				 += Number(henkan_form["hdd0num"+i].value);
			}
		}

		if(hdd_selected_num > hdd_sum_max_num){

			var adjust_max = unit_sum_max_num[1];
			adjust_select_max = unit_select_max_num_hdd_1;
		}
		else{

			var adjust_max = unit_sum_max_num[0];
			adjust_select_max = unit_select_max_num_hdd_0;
		}


		Adjust_Select_Num(eikyou_form,"unitnum",0,unit_select_init_num.length,
				  unit_select_min_num,adjust_select_max,
				  unit_select_init_num,
				  unit_sum_min_num,adjust_max,0);
	}

	Result_Output();
}



function Select_Psu() {

	Result_Output();
}



function Select_Type() {

	Result_Output();
}



function Select_Load() {

	Result_Output();
}



function Select_Rack() {

	Result_Output();
}



function Result_Output() {

	denryoku_goukei = 0;
	sitsuryou_goukei = 0;

	denryoku_goukei += ((cpu_denryoku0[document.fcpu.cpuname.selectedIndex]
			     - cpu_denryoku1[document.fcpu.cpuname.selectedIndex])
			    * document.fload.load.value
			    + cpu_denryoku1[document.fcpu.cpuname.selectedIndex])
			   * document.fcpu.cpunum.value;
	sitsuryou_goukei += cpu_sitsuryou[document.fcpu.cpuname.selectedIndex]
                        * document.fcpu.cpunum.value;

	for (i in mem_denryoku0){
		denryoku_goukei += ((mem_denryoku0[i] - mem_denryoku1[i])
				    * document.fload.load.value
				    + mem_denryoku1[i])
				* document.fmem["memnum"+i].selectedIndex;
	}
	for (i in mem_sitsuryou){
		sitsuryou_goukei += mem_sitsuryou[i]
				* document.fmem["memnum"+i].selectedIndex;
	}
	if(memex_f == 1){
		if(document.fmem.memex.selectedIndex == 1){
			denryoku_goukei += mem_denryoku_ex;
			sitsuryou_goukei += mem_sitsuryou_ex;
		}
	}

	for (i in unit_denryoku0){
		denryoku_goukei += ((unit_denryoku0[i] - unit_denryoku1[i])
				    * document.fload.load.value
				    + unit_denryoku1[i])
				* document.funit[i].selectedIndex;
	}
	for (i in unit_sitsuryou){
		sitsuryou_goukei += unit_sitsuryou[i]
				* document.funit[i].selectedIndex;
	}

	if(hdd_henkan_f == 0 || document.fhdd.hddinch[0].checked){
		hddinchval = 0;
	}
	else {
		hddinchval = 1;
	}
	hdd_f = "hdd" + hddinchval + "num";
	hdd_v0 = "hdd" + hddinchval + "_denryoku0";
	hdd_v1 = "hdd" + hddinchval + "_denryoku1";
	for (i in eval(hdd_v0)){
		denryoku_goukei += ((eval(hdd_v0+"["+i+"]") - eval(hdd_v1+"["+i+"]"))
				    * document.fload.load.value
				    + eval(hdd_v1+"["+i+"]"))
				* document.fhdd[hdd_f+i].selectedIndex;
	}
	hdd_v = "hdd" + hddinchval + "_sitsuryou";
	for (i in eval(hdd_v)){
		sitsuryou_goukei += eval(eval(hdd_v+"["+i+"]"))
				* document.fhdd[hdd_f+i].selectedIndex;
	}

	j = 0;
	for (i in pci_select_item_num){
		if(pci_select_item_num[i] > 1){
			denryoku_goukei += 
			  ((pci_denryoku0[j + document.fpci["pcikind"+i].selectedIndex]
			  - pci_denryoku1[j + document.fpci["pcikind"+i].selectedIndex])
			  * document.fload.load.value
			  + pci_denryoku1[j + document.fpci["pcikind"+i].selectedIndex])
			  * document.fpci["pcinum"+i].value;
			sitsuryou_goukei += 
			  pci_sitsuryou[j + document.fpci["pcikind"+i].selectedIndex]
			  * document.fpci["pcinum"+i].value;
		}
		else{
			denryoku_goukei += ((pci_denryoku0[j] - pci_denryoku1[j])
			  * document.fload.load.value
			  + pci_denryoku1[j])
			  * document.fpci["pcinum"+i].value;
			sitsuryou_goukei += pci_sitsuryou[j]
			  * document.fpci["pcinum"+i].value;
		}
		j = j + pci_select_item_num[i];
	}

	if(redundant_psu_f == 0){
		i = 0;
	}
	else{
                if(redundant_psu_hdd_f == 1){
                  i = document.fpsu["psu" + hddinchval].selectedIndex;
                }
                else{
                  i = document.fpsu.psu.selectedIndex;
                }
	}
	denryoku_goukei += ((psu_denryoku0[i]
			    -psu_denryoku1[i])
			   * document.fload.load.value
			   + psu_denryoku1[i]);
	sitsuryou_goukei += psu_sitsuryou[i];

	denryoku_goukei += ((base_denryoku0 - base_denryoku1)
			   * document.fload.load.value
			   + base_denryoku1);
	if(base_type_f == 0){
		sitsuryou_goukei += base_sitsuryou[0];
	}
	else{
		sitsuryou_goukei += base_sitsuryou[document.ftype.type.selectedIndex];
	}

	if(rack_rail_f == 1){
		sitsuryou_goukei += rack_sitsuryou[document.frack.rack.selectedIndex];
	}

	document.fgoukei.denryoku.value = 
		Math.ceil(Math.min(denryoku_goukei,
				cpu_denryoku_max[document.fcpu.cpuname.selectedIndex]));
	if(base_type_f == 0){
		document.fgoukei.sitsuryou.value = 
			Math.min(sitsuryou_goukei+0.05,sitsuryou_max[0]).toFixed(1);


	}
	else{
		document.fgoukei.sitsuryou.value = 
			Math.min(sitsuryou_goukei+0.05,sitsuryou_max[document.ftype.type.selectedIndex]).toFixed(1);


	}
}



function Adjust_Select_Num
	(form_name,obj_name,form_start_idx,form_num,select_min,select_max,select_init,
	allnum_min,allnum_max,init_f) {

	adjusted_num = new Array();
	for(i=0;i<select_max.length;i++){
		adjusted_num[i] = select_max[i];
	}
	var selected_num = 0;

	if(init_f == 0){

		for(i=form_start_idx;i<form_start_idx+form_num;i++){
			selected_num += Number(form_name[obj_name+i].value);
 
 
 
		}

		if((selected_num < allnum_min) || (selected_num > allnum_max)){

			selected_num = 0;
			for(i=form_start_idx;i<form_start_idx+form_num;i++){
				selected_num += select_init[i];
				form_name[obj_name+i].length =select_max[i]-select_min[i]+1;
				for(j=0;j<form_name[obj_name+i].length;j++){
					form_name[obj_name+i].options[j].value
					 = select_min[i]+j;
					form_name[obj_name+i].options[j].text
					 = select_min[i]+j;
				}
			}
			for(i=form_start_idx;i<form_start_idx+form_num;i++){
				form_name[obj_name+i].options[select_init[i]-select_min[i]].selected = true;
			}
		}
		else {}
	}
	else{

		selected_num = 0;
		for(i=form_start_idx;i<form_start_idx+form_num;i++){
			selected_num += select_init[i];
		}
		for(i=form_start_idx;i<form_start_idx+form_num;i++){
			form_name[obj_name+i].options[select_init[i]-select_min[i]].selected = true;
		}
	}

	var add_num = allnum_max - selected_num;

	for(i=form_start_idx;i<form_start_idx+form_num;i++){
		form_name[obj_name+i].length =
			Math.min(select_max[i]-select_min[i]+1,
			Number(form_name[obj_name+i].value)+add_num+1);
		adjusted_num[i] = form_name[obj_name+i].length-1;
	}

	for(i=form_start_idx;i<form_start_idx+form_num;i++){
		for(j=0;j<form_name[obj_name+i].length;j++){
			form_name[obj_name+i].options[j].value = select_min[i]+j;
			form_name[obj_name+i].options[j].text = select_min[i]+j;
		}
	}
	return(adjusted_num);
}



function Init_Select_Num(mem_form,unit_form,hdd_form,pci_form) {


	mem_select_max = new Array();

	for(i=0;i<mem_select_init_num.length;i++){
		mem_select_max[i] =mem_sum_max_num[0];
	}


	Adjust_Select_Num(mem_form,"memnum",0,mem_select_init_num.length,
			  mem_select_min_num,mem_select_max,mem_select_init_num,
			  mem_sum_min_num,mem_sum_max_num[0],1);




	Adjust_Select_Num(unit_form,"unitnum",0,unit_select_init_num.length,
			  unit_select_min_num,unit_select_max_num_hdd_0,unit_select_init_num,
			  unit_sum_min_num,unit_sum_max_num[0],1);



	hdd_select_max = new Array();

	if(hdd_unitbay_henkan_f == 1){
		if(hdd_henkan_f == 1){
			if(array_hdd_f == 1){


				hdd0_init_max = hdd0_sum_max_num[1];
				hdd1_init_max = hdd1_sum_max_num[0];
			}
			else{


				hdd0_init_max = hdd0_sum_max_num[1];
				hdd1_init_max = hdd1_sum_max_num[1];
			}
		}
		else if(array_hdd_f == 1){


			hdd0_init_max = hdd0_sum_max_num[0];
		     }
		     else{


			hdd0_init_max = hdd0_sum_max_num[1];
		     }
	}
	else if(hdd_henkan_f ==1){


			hdd0_init_max = hdd0_sum_max_num[0];
			hdd1_init_max = hdd1_sum_max_num[0];
	    }
	    else{


			hdd0_init_max = hdd0_sum_max_num[0];
	    }

	for(i=0;i<hdd_select_init_num.length;i++){
		hdd_select_max[i] =hdd0_init_max;
	}


	Adjust_Select_Num(hdd_form,"hdd0num",0,hdd_select_init_num.length,
			  hdd_select_min_num,hdd_select_max,hdd_select_init_num,
			  hdd_sum_min_num,hdd0_init_max,1);

	if(hdd_henkan_f == 1){

		for(i=0;i<hdd_select_init_num.length;i++){
			hdd_select_max[i] =hdd1_init_max;
		}


		Adjust_Select_Num(hdd_form,"hdd1num",0,hdd_select_init_num.length,
				  hdd_select_min_num,hdd_select_max,hdd_select_init_num,
				  hdd_sum_min_num,hdd1_init_max,1);
	}

	adjust_select_max_num = new Array();

	if(hdd_unitbay_henkan_f == 1 && array_hdd_f ==1){

		for(i=0;i<pci_select_max_num_hdd_0.length;i++){
			adjust_select_max_num[i]  = pci_select_max_num_hdd_0[i];
		}
	}
	else{

		for(i=0;i<pci_select_init_num.length;i++){
			adjust_select_max_num[i] = pci_select_max_num[i];
		}
	}


	Adjust_Select_Num(pci_form,"pcinum",0,pci_select_init_num.length,
			  pci_select_min_num,adjust_select_max_num,pci_select_init_num,
			  pci_sum_min_num,pci_sum_max_num,1);

	Result_Output();
}
