//=============================================
// Copy Concepts Inc.
// Machine JS
// Created: Feb. 24th 2007
// Author: Kevin Nelson
// kevin@copyconceptsinc.com
//=============================================

var type = Object( );

type['Copier']	= 'Accessory Issue|Error Code|Jamming|Machine Relocation|Noise|Other|Poor Copy Quality|Unable to Find Jam|Unable to Scan|Preventative Maintenance Due';
type['Printer'] = 'Unable to Print|Jamming|Unable to Find Jam|Noise|Preventative Maintenance Due';
type['Fax'] 	= 'Unable to Send|Unable to Recieve|Unable to Send or Recieve|Noise|Jam|Unable to Find Jam|Says Add Toner|Preventative Maintenance Due';
type['KIP'] 	= 'Accessory Issue|Error Code|Jamming|Machine Relocation|Noise|Other|Poor Copy Quality|Unable to Scan|Unable to Find Jam|Preventative Maintenance Due';


//---------------------------------------------
// Function Set Machine
// Populates the type drop down menu with the type array
// IE: Copier, Printer etc...
//---------------------------------------------
function setMachine( ) {
	
	for ( machine in type )
	
		document.write ( '<option value="' + machine + '">' + machine + '</option>' );
}


//---------------------------------------------
// Function Set Problem
// Populates the problem drop down menu with the type array
// IE: Jamming, Poor CQ etc...
//---------------------------------------------
function setProblem ( oMachineType, oProblem ) {
	
	var ProblemArr;
	
	oProblem.length = 0;
	
	var oType = oMachineType.options[oMachineType.selectedIndex].text;
	
	if (type[oType]) {
		
		oProblem.disabled = false;
		
		oProblem.options[0] = new Option('Select Problem','');
		
		ProblemArr = type[oType].split('|');
		
		for (var i = 0; i < ProblemArr.length; i++)
		
			oProblem.options[i + 1] = new Option(ProblemArr[i], ProblemArr[i]);
			
	}
	
	else oProblem.disabled = true;
}