<?php 
if ($_SESSION['maintenance_card_no']=='') {
?>
<script language="javascript" type="text/javascript">
          needToConfirm = false;
          window.location="maintenance_no_return.php";
</script>
<?php
}
else {
?>
<!--jscript-->
<script language="javascript" src="../jscript/chainedselects.js"></script>
<?php

$table_name = $_SESSION['db_prefix']."_team_stock";
$store_item_query = "SELECT store_item_id FROM $table_name WHERE team_id = '".$_SESSION['team']."'";
	$store_item_result = execsql($store_item_query);
	$store_item_num = mysql_num_rows($store_item_result);
	$w = 0;
	$arrId2 = array ();
	$arrName2 = array ();
	while ($w < $store_item_num) {
		$arrId2[$w] = mysql_result($store_item_result, $w, "store_item_id");
		
				$table_name = $_SESSION['db_prefix']."_store_items";
				$name_query = "SELECT item_name, unit FROM $table_name WHERE store_item_id = '".$arrId2[$w]."'  ";
				$name_result = mySQL_query($name_query);
				
		$arrName2[$w] = $store_item_name = mysql_result($name_result, 0, "item_name")." - -~".mysql_result($name_result, 0, "unit");;
		$w++;
	}

$table_name = $_SESSION['db_prefix']."_maintenance_job_lines_supply_temp ";
$line_query = "SELECT * FROM $table_name WHERE user_name = '".$_SESSION['username']."' AND store_item_id>0";
$line_result = mySQL_query($line_query);
$line_num = mysql_num_rows($line_result);

$table_name = $_SESSION['db_prefix']."_maintenance_job_lines_supply_temp ";
$line2_query = "SELECT * FROM $table_name WHERE user_name = '".$_SESSION['username']."' AND store_item_id='0'";
$line2_result = mySQL_query($line2_query);
$line2_num = mysql_num_rows($line2_result);

$table_name = $_SESSION['db_prefix']."_maintenance_job_lines";
$job_lines_query = "SELECT store_item_id, item_name, delivered, delivered_price, store_reg_id  FROM $table_name WHERE maintenance_card_no = '".$_SESSION['maintenance_card_no']."'  ";
$job_lines_result = mySQL_query($job_lines_query);
$job_lines_num = mysql_num_rows($job_lines_result);

$table_name = $_SESSION['db_prefix']."_maintenance_additional_supply_lines";
$job2_lines_query = "SELECT store_item_id, item_name, quantity, price, store_reg_id  FROM $table_name WHERE maintenance_card_no = '".$_SESSION['maintenance_card_no']."'  ";
$job2_lines_result = mySQL_query($job2_lines_query);
$job2_lines_num = mysql_num_rows($job2_lines_result);

$table_name = $_SESSION['db_prefix']."_maintenance_return_lines";
$job3_lines_query = "SELECT store_item_id, item_name, quantity, price, store_reg_id  FROM $table_name WHERE maintenance_card_no = '".$_SESSION['maintenance_card_no']."'  ";
$job3_lines_result = mySQL_query($job3_lines_query);
$job3_lines_num = mysql_num_rows($job3_lines_result);

?>

 
<script language="javascript">
function addRow(dataTable) {
 
            var table = document.getElementById(dataTable);
 
            var rowCount = table.rows.length;
            var row = table.insertRow(rowCount);
			var line_no = rowCount-1;
 
            var cell1 = row.insertCell(0);
            var element1 = document.createElement("input");
            element1.type = "checkbox";
            element1.name="line_checkbox"+line_no;
			element1.id="line_checkbox"+line_no;
			/*element1.checked="checked";*/
            cell1.appendChild(element1);
			
            var cell2 = row.insertCell(1);
            var element2 = document.createElement("select");
            element2.name = "store_item_select"+line_no;
			element2.id = "store_item_select"+line_no;
			element2.className = "select200";
			element2.onchange = function(){
				document.getElementById("line_checkbox"+line_no).checked = "checked"; 
				document.getElementById("store_item_id"+line_no).value = 
				document.getElementById("store_item_select"+line_no).value; 
				units=document.getElementById("store_item_select"+line_no).options[document.getElementById("store_item_select"+line_no).selectedIndex].text;
				units2 = units.split("~"); 
				units3 = units2[1]; 
				if (units3=="no") {
					document.getElementById("quantity_text"+line_no).value = ""; 
					document.getElementById("quantity_text"+line_no).onkeypress = function num(event) { return numbersonly(this, event);}
					
					}
					else {
						document.getElementById("quantity_text"+line_no).value = ""; 
						document.getElementById("quantity_text"+line_no).onkeypress = function num(event) { return isNumberKey(event);}
						}
						document.getElementById("store_item_id"+line_no).value=document.getElementById("store_item_select0"+line_no).value; 
						document.getElementById("store_item_text"+line_no).value = document.getElementById("store_item_select0"+line_no).value; 
						};
						                     
			var element9 = document.createElement("input");
            element9.type = "hidden";
            element9.name = "index"+line_no;
			element9.id = "index"+line_no;
			
			var element10 = document.createElement("input");
            element10.type = "hidden";
            element10.name = "store_item_id"+line_no;
			element10.id = "store_item_id"+line_no;
			
				
			cell2.appendChild(element2);
			cell2.appendChild(element9);
			cell2.appendChild(element10);
			
			var option = document.createElement("option");
			option.text = '';
			option.value = '';
			element2.add(option);
			
			<?php
    			for ($i = 0; $i < count($arrId2); $i++) { ?>
				
				var option<?php echo $i?> = document.createElement("option");
   				 	option<?php echo $i?>.text = "<?php echo $arrName2[$i]?>";
    				option<?php echo $i?>.value = <?php echo $arrId2[$i]?>;
				element2.add(option<?php echo $i?>);
			<?php	
			}
			?>
		
					
            var cell4 = row.insertCell(2);
			cell4.align = "left";
            var element3 = document.createElement("input");
            element3.type = "text";
            element3.name = "quantity_text"+line_no;
			element3.id = "quantity_text"+line_no;
			element3.className = "text60";
			element3.value = "";
			element3.style = "text-align:right";
			element3.autocomplete="off";
			element3.onkeypress = function isNumberKey(evt)
       								{
          							var charCode = (evt.which) ? evt.which : event.keyCode
          							if ( charCode > 31 
            						&& (charCode < 48 || charCode > 57))
             						return false;
 
          							return true;
       								}
									;
			element3.onchange = function(){document.getElementById("line_checkbox"+line_no).checked = "checked";}
			cell4.appendChild(element3);
			
					
			var cell5 = row.insertCell(3);
			cell5.align = "right";
				

            var element4 = document.createElement("input");
            element4.type = "hidden";
            element4.name = "line_num";
			element4.value = rowCount;
            						
			
            cell5.appendChild(element4);
			
			var element8 = document.createElement("script");
			element8.setAttribute('type', 'text/javascript');
			element8.innerHTML="var frmvalidator  = new Validator('form1');frmvalidator.EnableMsgsTogether();for (i = 0; i < 10; i++) {frmvalidator.addValidation('quantity_text'+i,'req','- quantity on store line '+(i+1)+'.');}"; 
			document.getElementsByTagName('head').item(0).appendChild(element8);



		
element1.onmouseup = function() {
				 if (document.getElementById('line_checkbox'+line_no).checked) {
                         element2.style.background = '#F0F0F0';
						 element3.style.background = '#F0F0F0';
						 element7.style.background = '#F0F0F0';
						 element2.selectedIndex=0;
						 element3.value = '-----';
						 element7.selectedIndex= -1;
						 element2.disabled = true;
						 element3.disabled = true;
						 element7.disabled = true;
								 
                } else {
                        element2.style.background = '#FFF';
						element3.style.background = '#FFF';
						element7.style.background = '#FFF';
						element2.selected_index=0;
						element3.value = '';
						element7.selectedIndex= -1;
						element2.disabled = false;
						element3.disabled = false;
						element7.disabled = false;
						
						 
                }
				};
				
}
</script> 
</head>

<?php include('../include/wait.php') ?>

<body onLoad=" MM_showHideLayers('wait','','hide'); " onFocus="MM_showHideLayers('wait','','hide');" >


<form id="form1" name="form1" method="POST" action="maintenance_closeJobWizbase.php?p=4&s=3">
<div class="wizard_page_middle_frame">
  <div class="wizard_frame">
    Spares supplied:
    <table width="630" id="table_resume_wizard">
  <tr>
    <td width="446">Item</td>
    <td width="86" align="center">Quantity</td>
    <td width="82" align="center">Price</td>
  </tr>
  <?php
  $i=0;
  while ($i<$job_lines_num) {
	  $store_item_id = mysql_result($job_lines_result, $i, "store_item_id");
	  $item_name = mysql_result($job_lines_result, $i, "item_name");
	  $delivered = mysql_result($job_lines_result, $i, "delivered");
	  $delivered_price = mysql_result($job_lines_result, $i, "delivered_price");
	  $store_reg_id = mysql_result($job_lines_result, $i, "store_reg_id");
	  
	  	$table_name = $_SESSION['db_prefix']."_store_items";
		$register_query = "SELECT register FROM $table_name WHERE store_item_id = '".$store_item_id."' ";
		$register_result = mySQL_query($register_query);
		$register = mysql_result($register_result, 0, "register");
	  
	  if ($register=='yes') {
		  			$table_name = $_SESSION['db_prefix']."_store_register";
					$register_query = "SELECT serial_number  FROM $table_name WHERE store_register_id = '".$store_reg_id."' ";
					$register_result = mySQL_query($register_query);
					$register_num = mysql_num_rows($register_result);
					$serial = mysql_result($register_result, 0, "serial_number");
					}	
	  
  ?>	  
  <tr>
    <td><?php echo $item_name ?>&nbsp;
      <?php if ($register=='yes') { echo 'serial no: '.$serial ; }?></td>
    <td align="center"><?php echo $delivered ?></td>
    <td align="right"><?php echo number_format($delivered_price, 2, '.', ',') ?></td>
  </tr>
  <?php 
  $i++;
  }
  ?>
  <?php
  $i=0;
  while ($i<$job2_lines_num) {
	  $store_item_id = mysql_result($job2_lines_result, $i, "store_item_id");
	  //$item_name = mysql_result($job2_lines_result, $i, "item_name");
	  $delivered = mysql_result($job2_lines_result, $i, "quantity");
	  $delivered_price = mysql_result($job2_lines_result, $i, "price");
	  $store_reg_id = mysql_result($job2_lines_result, $i, "store_reg_id");
	  
	  	$table_name = $_SESSION['db_prefix']."_store_items";
		$register_query = "SELECT item_name, register FROM $table_name WHERE store_item_id = '".$store_item_id."' ";
		$register_result = mySQL_query($register_query);
		$item_name = mysql_result($register_result, 0, "item_name");
		$register = mysql_result($register_result, 0, "register");
	  
	  if ($register=='yes') {
				  	$table_name = $_SESSION['db_prefix']."_store_register";
					$register_query = "SELECT serial_number  FROM $table_name WHERE store_register_id = '".$store_reg_id."' ";
					$register_result = mySQL_query($register_query);
					$register_num = mysql_num_rows($register_result);
					$serial = mysql_result($register_result, 0, "serial_number");
			}	
	  
  ?>	  
  <tr>
    <td><?php echo $item_name ?>&nbsp;
      <?php if ($register=='yes') { echo 'serial no: '.$serial ; }?></td>
    <td align="center"><?php echo $delivered ?></td>
    <td align="right"><?php echo number_format($delivered_price, 2, '.', ',') ?></td>
  </tr>
  <?php 
  $i++;
  }
  ?>
  <?php
  $i=0;
  while ($i<$job3_lines_num) {
	  $store_item_id = mysql_result($job3_lines_result, $i, "store_item_id");
	  //$item_name = mysql_result($job2_lines_result, $i, "item_name");
	  $delivered = mysql_result($job3_lines_result, $i, "quantity");
	  $delivered_price = mysql_result($job3_lines_result, $i, "price");
	  $store_reg_id = mysql_result($job3_lines_result, $i, "store_reg_id");
	  
	  	$table_name = $_SESSION['db_prefix']."_store_items";
		$register_query = "SELECT item_name, register FROM $table_name WHERE store_item_id = '".$store_item_id."' ";
		$register_result = mySQL_query($register_query);
		$item_name = mysql_result($register_result, 0, "item_name");
		$register = mysql_result($register_result, 0, "register");
	  
	  if ($register=='yes') {
				  	$table_name = $_SESSION['db_prefix']."_store_register";
					$register_query = "SELECT serial_number  FROM $table_name WHERE store_register_id = '".$store_reg_id."' ";
					$register_result = mySQL_query($register_query);
					$register_num = mysql_num_rows($register_result);
					$serial = mysql_result($register_result, 0, "serial_number");
			}	
	  
  ?>	  
  <tr>
    <td><?php echo $item_name ?>&nbsp;
      <?php if ($register=='yes') { echo 'serial no: '.$serial ; }?></td>
    <td align="center"><?php echo $delivered ?></td>
    <td align="right"><?php echo number_format($delivered_price, 2, '.', ',') ?></td>
  </tr>
  <?php 
  $i++;
  }
  ?>
</table>
<br>
Additional supplied:
    <table id="dataTable" width="635" border="1" style="border-collapse:collapse;">
      <?php
		
	 if ($line_num==0) {
	       
		   $a1='-';
		   $a1a='-';
		   $a1b='';
		   $a2='-';
		   $a3='-';
		 }
	   else {
		    	   
			$a1 = mysql_result($line_result, 0, "store_item_id");
		   		
		   				$table_name = $_SESSION['db_prefix']."_store_items";
						$name_query = "SELECT item_name, unit FROM $table_name WHERE store_item_id = '".$a1."'  ";
						$name_result = mySQL_query($name_query);
						$a1a = mysql_result($name_result, 0, "item_name");
						$a1b = mysql_result($name_result, 0, "unit");
							
		   $a2 = mysql_result($line_result, 0, "quantity");
		   $a3 = mysql_result($line_result, 0, "price");
		   $error = mysql_result($line_result, 0, "error");
		   }
	   
		?>
      <thead> 
        <tr>
          <td>&nbsp;</td>
          <td width="418">Store item</td>
          <td align="center">Quantity</td>
          <td>&nbsp;</td>
        </tr>
        </thead>
        <script>
			 function check_it() {
				 if (document.getElementById('line_checkbox0').checked) {
                         document.getElementById('store_item_select0').style.background = '#F0F0F0';
						 document.getElementById('store_item_text0').style.background = '#F0F0F0';
						 document.getElementById('quantity_text0').style.background = '#F0F0F0';
						 document.getElementById('store_item_select0').selectedIndex=1;
						 document.getElementById('store_item_text0').value = '.';
						 document.getElementById('quantity_text0').value = '.';
						 document.getElementById('store_item_select0').disabled = true;
						 document.getElementById('store_item_text0').disabled = true;
						 document.getElementById('quantity_text0').disabled = true;
						 document.getElementById('add_icon0').hidden = true;
						 
                } else {
                         document.getElementById('store_item_select0').style.background = '#FFF';
						 document.getElementById('quantity_text0').style.background = '#FFF';
						 document.getElementById('store_item_select0').selectedIndex=0;
						 document.getElementById('store_item_text0').value = '';
						 document.getElementById('quantity_text0').value = '';
						 document.getElementById('store_item_select0').disabled = false;
						 document.getElementById('quantity_text0').disabled = false;
						 document.getElementById('add_icon0').hidden = false;
                }
				}
		     </script>
        <tr>
            <td width="20"><input type="checkbox" name="line_checkbox0" id="line_checkbox0" onMouseUp="check_it()"  /></td>
          <td>
          
          
          <div id=store_item_divA0  style="height:15px;">
              <img src=<?php if ($a1a!='') { echo "../images/line_edit.png width=16 height=12 "; } else { echo "../images/line_edit_text.png width=135 height=12 "; } ?>   id="add_icon0" onClick="document.getElementById('store_item_divA0').hidden=true; document.getElementById('store_item_divB0').hidden=false; document.getElementById('quantity_text0').value=''; document.getElementById('amount_text0').value=''; document.getElementById('store_item_text0').value =''; ">&nbsp;
<input name="store_item_text0" id="store_item_text0" type="text" class="text300" value="<?php echo $a1a ?>" readonly style="border:hidden; background-color:inherit; "> <input name="store_item_id0" id="store_item_id0" type="hidden" value="<?php echo $a1 ?>">
          </div>
            
            <div id=store_item_divB0 hidden="hidden">
              <select name="store_item_select0" id="store_item_select0"  class="select200"  onChange="
              document.getElementById('line_checkbox0').checked=true;
              unit = document.getElementById('store_item_select0').options[document.getElementById('store_item_select0').selectedIndex].text; 
              unit2 = unit.split('~'); 
              unit3 = unit2[1];
              if (unit3=='no') {
              document.getElementById('quantity_text0').value = '';
              document.getElementById('quantity_text0').onkeypress = function num(event) { return numbersonly(this, event);}
              }
              else {
              document.getElementById('quantity_text0').value = '';
              document.getElementById('quantity_text0').onkeypress = function decnum(event) { return isNumberKey(event);}  
              }            
              document.getElementById('store_item_id0').value=document.getElementById('store_item_select0').value; 
              document.getElementById('store_item_text0').value = document.getElementById('store_item_select0').value; 
              "
              >
              <option value=""></option>
             <?php
        	for ($j = 0; $j < count($arrId2); $j++) {
    		echo "<option value=" . "\"" . $arrId2[$j] . "\"" . ">" . $arrName2[$j] . "</option>";
	}
?>
              </select>
            </div> 
            
            </td>
          <td width="84" align="left"><input  name="quantity_text0" type="text" class="text60" id="quantity_text0" style="text-align:right" onKeyPress="<?php if ($a1b!='no'){ ?>return isNumberKey(event)<?php } else { ?>return numbersonly(this, event)<?php } ?>" value="<?php if (($a2!='0') AND ($a2!='-'))  { if ($a1b!='no') {echo number_format($a2, 2, '.', ',');} else { echo number_format($a2, 0, '.', ','); }}  else { if ($a2=='-') { echo'-'; }}?>" size="10" autocomplete="off" onfocus = "this.select();"/>
            <?php if ($error==1) { ?>
            <img src="../images/exclamation_mark_red_small.png" width="10" height="16">
          <?php } ?>
          <input type="hidden" name="line_num" id="line_num" value="1" ></td>
            <td width="85" align="right">&nbsp;</td>    
            <!--<input name="textfield0" type="text" id="textfield0" size="5" value="1"></td>-->
        </tr>
        <?php
		$i=1;
		while ($i<$line_num) {
		  
				$a1 = mysql_result($line_result, $i, "store_item_id");
				
		        		$table_name = $_SESSION['db_prefix']."_store_items";
						$name_query = "SELECT item_name, unit FROM $table_name WHERE store_item_id = '".$a1."'  ";
						$name_result = mySQL_query($name_query);
						$a1a = mysql_result($name_result, 0, "item_name");
						$a1b = mysql_result($name_result, 0, "unit");
				
		   $a2 = mysql_result($line_result, $i, "quantity");
		   $a3 = mysql_result($line_result, $i, "price");
		   $error = mysql_result($line_result, $i, "error");
			
		?>
        <tr>
            <td width="20"><input type="checkbox" name="line_checkbox<?php echo $i ?>" id="line_checkbox<?php echo $i ?>"  <?php if ($a1!='') { ?> checked="checked" <?php } ?> onMouseUp="{
				 if (document.getElementById('line_checkbox<?php echo $i ?>').checked) {
                         document.getElementById('store_item_select<?php echo $i ?>').style.background = '#F0F0F0';
						 document.getElementById('quantity_text<?php echo $i ?>').style.background = '#F0F0F0';
						 document.getElementById('store_item_select<?php echo $i ?>').selectedIndex=1;
                         document.getElementById('store_item_text<?php echo $i ?>').value = '.';
						 document.getElementById('quantity_text<?php echo $i ?>').value = '.';
						 document.getElementById('store_item_select<?php echo $i ?>').disabled = true;
                         document.getElementById('store_item_text<?php echo $i ?>').disabled = true;
						 document.getElementById('quantity_text<?php echo $i ?>').disabled = true;
						 document.getElementById('add_icon<?php echo $i ?>').hidden = true;
					} else {
                         document.getElementById('store_item_select<?php echo $i ?>').style.background = '#FFF';
						 document.getElementById('quantity_text<?php echo $i ?>').style.background = '#FFF';
						 document.getElementById('store_item_select<?php echo $i ?>').selectedIndex=1;
                         document.getElementById('store_item_text<?php echo $i ?>').value = '';
						 document.getElementById('quantity_text<?php echo $i ?>').value = '';
						 document.getElementById('store_item_select<?php echo $i ?>').disabled = false;
						 document.getElementById('quantity_text<?php echo $i ?>').disabled = false;
						 document.getElementById('add_icon<?php echo $i ?>').hidden = false;
                }
				}
                "/></td>
          <td>
          
          
          <div id=store_item_divA<?php echo $i ?>>
              <img src="../images/line_edit.png" width="16" height="12" id="add_icon<?php echo $i ?>" onClick="document.getElementById('store_item_divA<?php echo $i ?>').hidden=true; document.getElementById('store_item_divB<?php echo $i ?>').hidden=false; document.getElementById('quantity_text<?php echo $i ?>').value='';  document.getElementById('store_item_text<?php echo $i ?>').value =''; ">&nbsp;
<input name="store_item_text<?php echo $i ?>" id="store_item_text<?php echo $i ?>" type="text" class="text300" value="<?php echo $a1a ?>" readonly style="border:hidden; background-color:inherit"> <input name="store_item_id<?php echo $i ?>" id="store_item_id<?php echo $i ?>" type="hidden" value="<?php echo $a1 ?>">
          </div>
            
            <div id=store_item_divB<?php echo $i ?> hidden="hidden">
              <select name="store_item_select<?php echo $i ?>" id="store_item_select<?php echo $i ?>" class="select200"  onChange="
              document.getElementById('line_checkbox<?php echo $i ?>').checked=true;
              unit = document.getElementById('store_item_select<?php echo $i ?>').options[document.getElementById('store_item_select<?php echo $i ?>').selectedIndex].text; 
              unit2 = unit.split('~'); 
              unit3 = unit2[1];
              if (unit3=='no') {
              document.getElementById('quantity_text<?php echo $i ?>').value = '';
              document.getElementById('quantity_text<?php echo $i ?>').onkeypress = function num(event) { return numbersonly(this, event);}
              }
              else {
              document.getElementById('quantity_text<?php echo $i ?>').value = '';
              document.getElementById('quantity_text<?php echo $i ?>').onkeypress = function decnum(event) { return isNumberKey(event);}  
              }            
              document.getElementById('store_item_id<?php echo $i ?>').value=document.getElementById('store_item_select<?php echo $i ?>').value; 
              document.getElementById('store_item_text<?php echo $i ?>').value = document.getElementById('store_item_select<?php echo $i ?>').value; 
              "
              >
            <option value=""></option>
                 <option value="<?php echo $_SESSION['invoiced_by']?>" selected="selected"><?php echo $_SESSION['invoiced_by'] ?></option>
      <?php
        	for ($j = 0; $j < count($arrId2); $j++) {
    		echo "<option value=" . "\"" . $arrId2[$j] . "\"" . ">" . $arrName2[$j] . "</option>";
	}
?>
              </select>
            </div> 
            
            </td>
          <td width="84" align="left"><input  name="quantity_text<?php echo $i ?>" type="text" class="text60" id="quantity_text<?php echo $i ?>" style="text-align:right" onKeyPress="<?php if ($a1b!='no'){ ?>return isNumberKey(event)<?php } else { ?>return numbersonly(this, event)<?php } ?>" value="<?php if ($a2!='0') { if ($a1b!='no') {echo number_format($a2, 2, '.', ',');} else { echo number_format($a2, 0, '.', ','); } }?>" size="10" autocomplete="off" onfocus = "this.select();"/>
            <?php if ($error==1) { ?>
            <img src="../images/exclamation_mark_red_small.png" width="10" height="16">
          <?php } ?>
          <input type="hidden" name="line_num" id="line_num" value="<?php echo $line_num?>"></td>
            <td width="85" align="right">&nbsp;</td>
        </tr>
        <?php
		$i++;
		}
		?>
        
</table>
  
    <input type="button" class="imagebutton" onClick="addRow('dataTable')" value="Add line" />
    <div align="right"><label class="label_small">To delete a line: uncheck line box</label></div>
  
					
				
</div>
  
<div class="wizard_frame">
  <table width="590" height="50" align="center" id="table_button_bar">
          <tr>
            <td width="117"><input type="button" name="lastprev_button" class="imagebutton" value="Prev" onClick="needToConfirm = false;MM_showHideLayers('wait','','show');MM_goToURL('parent','maintenance_closeJobWizbase.php?s=&p=2&error=0'); return document.MM_returnValue; ;return document.MM_returnValue"/></td>
            <td width="115">&nbsp;</td>
            <td width="99"><span class="wizard">
              <input name="error" type="hidden" id="error" value="0" />
              <input name="p" type="hidden" id="p" value="3" />
              <input name="s" type="hidden" id="s" value="3" />
            </span></td>
            <td width="125" align="left"><input name="cancelbutton" type="button" class="imagebutton" id="cancelbutton" onClick="needToConfirm = false;  cancel_confirmation(1, '../maintenance/maintenance_main.php');" value="Cancel" /></td>
            <td width="110" align="left"><input type="submit" name="next_button" class="imagebutton" value="Next" onClick="needToConfirm = false; MM_showHideLayers('wait','','show');" /></td>
          </tr>
      </table>
    </div>
  </div>
</form>
</div>

<!--form validation-->
  <script language="JavaScript" type="text/javascript" xml:space="preserve">
  var frmvalidator  = new Validator("form1");
  frmvalidator.EnableMsgsTogether();
     
  for (i = 0; i < 50; i++) {
	//frmvalidator.addValidation("store_item_text"+i,"req","- store item on store line "+(i+1)+".");
//	frmvalidator.addValidation("quantity_text"+i,"req","- quantity  on store line "+(i+1)+".");
  	
  
	/*frmvalidator.addValidation("item_text7"+i,"req","- store item on special order line "+(i+1)+".");
	frmvalidator.addValidation("quantity_text7"+i,"req","- quantity  on special order line"+(i+1)+".");
  	frmvalidator.addValidation("amount_text7"+i,"req","- price on special store order "+(i+1)+".");*/
	
}	
  </script>
</body>

<?php
}
?>