function getItem(value) {

  var thisValue = value
  var thisIndex = 0
  var itemFound = false


  var myItem = new Array("Alarm-Infrared", "Alarm-Smoke and Fire", "Bell", "Ceiling Tiles", "Ceiling Tiles, F.H.", "Ceiling Tiles, Office", "Chairs, Folding", "Coffee Machine", "Copier", "Door Closer, post 1980", "Door Closer, pre 1980", "Elevator", "Emergency Lights", "Exit Signs - post 1980", "Exit Signs - post 2008", "PowerPoint projectors", "Security Light by Swing-Set", "Thermostat-Fellowship Hall", "Water Heater", "Water Heater - FH Closet", "Water Heater - mens room", "Water Well") 

  // alert("The value is " + thisValue + " and the index is " + thisIndex)

  for(i=0; i<myItem.length; i++) {
  	if(thisValue == myItem[i]){
		// alert("the items are equivalent " + myItem[i])
		thisIndex = i
		// alert("the index is now " + thisIndex)
		itemFound = true
		fillDatabase(thisIndex)
		i = myItem.length
	}
  }

  if(itemFound == false) {
	alert("You must select an item from the list!")
  }

}

function itemArray(length) {
 	var i = 0
	this.length2 = length
	for(i=0; i<length; i++) {
		this[i] = 0
        }
	return this
  }  

function addItem(Item, Descript, LocOfItem, PurchaseDate, Cost, VenNum, VenName, AccountNum, Manufacturer, ContactName, ContactAddress, CityStateZip, Phone, Fax, Email, Website, ReplacePartInfo, Notes) {
	this.Item = Item
	this.Descript = Descript
	this.LocOfItem = LocOfItem
	this.PurchaseDate = PurchaseDate
	this.Cost = Cost
	this.VenNum = VenNum
	this.VenName = VenName
	this.AccountNum = AccountNum
	this.Manufacturer = Manufacturer
	this.ContactName = ContactName
	this.ContactAddress = ContactAddress
	this.CityStateZip = CityStateZip
	this.Phone = Phone
	this.Fax = Fax
	this.Email = Email
	this.Website = Website
	this.ReplacePartInfo = ReplacePartInfo
	this.Notes = Notes
	return this
  } 
  
function fillDatabase(indexx) {

  var totalItems = 22
  var databaseItem = itemArray(totalItems)

  var newIndex = indexx

  // alert("the new index in fill database function is " + newIndex)

  if(newIndex == 0) {

  databaseItem[0] = addItem("Alarm-Infrared", "Infrared Photo Relay Alarm", "LOCATIONITEM", "2/1/1993", "COST", "VENNUM", "Radio Shack", "ACCOUNTNUM", "MANUFACTURER", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "Taken out of service in 2006, now in storage; maintenance room electronics box") }

  if(newIndex == 1) {

  databaseItem[1] = addItem("Alarm-Smoke and Fire", "Alarm (Fire and Smoke)", "Custoian Closet", "7/20/1990", "COST", "VENNUM", "Walter Alarm Service", "ACCOUNTNUM", "MANUFACTURER", "Marty Walter", "PO Box 522", "Crystal Lake, IL  60039-0522", "815-459-1136", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "Tested twice a year by vendor. Annual contract. Installed and maintained by vendor. 4 fire zones. Flashing red light means smoke detector OK. Smoke alarms - smooth wires (+), ribbed wires (-)") }

  if(newIndex == 2) {

  databaseItem[2] = addItem("Bell", "Bell, Historic Meneely Bell", "Bell Tower", "1906", "COST", "VENNUM", "Church Specialities, Inc.", "ACCOUNTNUM", "Meneely Bell", "CONTACTNAME", "68 Elaine Drive", "Monroe, CT 06468", "888-570-1042", "203-452-0107", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 3) {


  databaseItem[3] = addItem("Ceiling Tiles", "Office, Halls, Education Wing - R2310 Radar 2x4, Hallway - 156 Cheyenne 2x2 (Glacier 707)", "office, halls, education wing", "March, 2007", "$5.80", "VENNUM", "Home Depot", "ACCOUNTNUM", "USG", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "12ft runners $5.00 each, 2ft cross ties $.98 each 12 tile per box $69.22 each as of March, 2007", "Office wing - originally 290 Fleet Street - out of production, Hallway - originally 707 White Glacier - out of production") }

  if(newIndex == 4) {

  databaseItem[4] = addItem("Ceiling Tiles, F.H.", "12 x 12 inch ceiling tiles used in Fellowship Hall", "Fellowship Hall", "1976", "COST", "VENNUM", "VENNAME", "ACCOUNTNUM", "Armstrong", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "WEBSITE", "REPLACEPARTINFO", "554 Travertone fissured K4C4 sq edge 12x12x3/4 vinyl latex finish") }

  if(newIndex == 5) {

  databaseItem[5] = addItem("Ceiling Tiles, Office", "2 x 4 ceiling tiles used in office and classrooms USG R2310 Radar", "office & classrooms", "PURHASEDATE", "COST", "VENNUM", "Home Depot", "ACCOUNTNUM", "MANUFACTURER", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "originally 290 Fleet Street, out of production") }

  if(newIndex == 6) {

  databaseItem[6] = addItem("Chairs, Folding", "Chairs, Gray Folding with cushion", "Fellowship Hall", "Various", "$40", "VENNUM", "Adirondack", "ACCOUNTNUM", "CHF276", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "800-221-2444", "800-477-1330", "EMAIL", "www.adirondack.com", "CHF276 1 in upholstered naugahyde seat, Gray naugahyde, Medium Gray Frame", "NOTES") }

  if(newIndex == 7) {

  databaseItem[7] = addItem("Coffee Machine", "DESCRIPT", "LOCATIONITEM", "PURHASEDATE", "COST", "VENNUM", "Walgreens", "ACCOUNTNUM", "Mr. Coffee", "North America Systems, Inc", "24700 Miles Rd", "Bedford Heights, OH 44146", "800-321-0370", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 8) {

  databaseItem[8] = addItem("Copier", "Savin Color Copier", "Office workroom", "60-month lease, 8/1/2009", "COST", "VENNUM", "Integra Business Systems", "ACCOUNTNUM", "MANUFACTURER", "Chris Goble", "5027 Harrison Ave, PO Box 5743", "Rockford, IL 61125", "815-397-0660", "815-397-0253", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 9) {

  databaseItem[9] = addItem("Door Closer, post 1980", "Door Closer, old front door, education wing addition 1988", "old front, ed wing, office", "March, 2007", "$180 with cushstop arm", "VENNUM", "All American Door Hardware, Inc.", "ACCOUNTNUM", "LCN 4041", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "877-471-4870", "FAX", "EMAIL", "www.locksearch.com", "LCN 4041-HCUSH DKBRZ closer H cushnstop DKBRZ, hold open, dark bronze 10 year warranty", "4041 works on both right and left hand doors. Cushnstop arm will hold door in open position") }

  if(newIndex == 10) {

  databaseItem[10] = addItem("Door Closer, pre 1980", "Door Closers Fellowship Hall and Connecting Link", "Kitchen, FH, CL", "1976", "COST", "VENNUM", "VENNAME", "ACCOUNTNUM", "Norton BC S2", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 11) {

  databaseItem[11] = addItem("Elevator", "Elevator", "Gathering Place-Sanctuary", "PURHASEDATE", "COST", "VENNUM", "Access Specialists, Inc.", "ACCOUNTNUM", "Inclinator Company of Chicago", "Ken Reeves", "506 S Westgate Drive", "Addison, IL 60101", "630-628-6909", "630-628-7008", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "Dec 2004: Inspected and adjusted") }

  if(newIndex == 12) {

  databaseItem[12] = addItem("Emergency Lights", "Emergency Lighting, low profile emergency light w battery back up", "replacements", "Oct, 2008", "$18", "499-6301", "VENNAME", "ACCOUNTNUM", "Big Beam in Crystal Lake", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "866-697-9560", "FAX", "EMAIL", "www.exitsinage.com", "REPLACEPARTINFO", "phone orders can be picked up at Big Beam in Crystal Lake same day saving shipping cost") }

  if(newIndex == 13) {

  databaseItem[13] = addItem("Exit Signs - post 1980", "Exit Signs - post 1980", "Education Wing, Office", "PURHASEDATE", "$65", "VENNUM", "CED Consolidated Electrical Distributors, Inc", "ACCOUNTNUM", "BBEAM ELEDXIR-CPY LED EXIT W CANOPY", "CONTACTNAME", "171 Erick Street", "Crystal Lake, IL 60014", "815-455-7020", "815-455-3304", "EMAIL", "WEBSITE", "BBEAM ELEDXIR-CPY LED EXIT W CANOPY", "NOTES") }

  if(newIndex == 14) {

  databaseItem[14] = addItem("Exit Signs - post 2008", "Exit Signs, single and double sided red LED battery back up", "replacements", "Oct, 2008", "$15", "499-4715P", "VENNAME", "ACCOUNTNUM", "Big Beam in Crystal Lake", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "866-697-9560", "FAX", "EMAIL", "www.exitsinage.com", "REPLACEPARTINFO", "If order is phoned in, lights can be picked up same day in Crsytal Lake at Big Beam saving shipping cost") }

  if(newIndex == 15) {

  databaseItem[15] = addItem("PowerPoint projectors", "DESCRIPT", "LOCATIONITEM", "PURHASEDATE", "COST", "VENNUM", "VENNAME", "ACCOUNTNUM", "MANUFACTURER", "PowerPoint projectors", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 16) {

  databaseItem[16] = addItem("Security Light by Swing-Set", "JourneyMan Motion Sensor Quartz Light Control Model HD-9260", "light pole by dumpster", "July, 2006", "$70", "VENNUM", "Home Depot", "ACCOUNTNUM", "DESA Specialty Products", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "type T250W (max) tungsten halogen 120 VAC lamps", "NOTES") }

  if(newIndex == 17) {

  databaseItem[17] = addItem("Thermostat-Fellowship Hall", "Honeywell Series 2000 Commercial MicroElectronic Thermostat", "Fellowship Hall and Office", "7/15/2004", "COST", "VENNUM", "Althoff", "ACCOUNTNUM", "Honeywell", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 18) {

  databaseItem[18] = addItem("Water Heater", "GE Model PG40598", "in mechanical room adjacent to file room", "11/9/2000", "COST", "VENNUM", "Home Depot", "ACCOUNTNUM", "GE", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "9 year warranty", "NOTES") }

  if(newIndex == 19) {

  databaseItem[19] = addItem("Water Heater - FH Closet", "Water Heater - Fellowship Hall Closet", "Fellowship Hall closet", "PURHASEDATE", "COST", "VENNUM", "VENNAME", "ACCOUNTNUM", "MANUFACTURER", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 20) {

  databaseItem[20] = addItem("Water Heater - mens room", "Water Heater - mens room", "cealing above mens room", "1976", "COST", "VENNUM", "VENNAME", "ACCOUNTNUM", "MANUFACTURER", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }

  if(newIndex == 21) {

  databaseItem[21] = addItem("Water Well", "DESCRIPT", "LOCATIONITEM", "PURHASEDATE", "COST", "VENNUM", "Martin Jurs and Sons, Inc", "ACCOUNTNUM", "MANUFACTURER", "CONTACTNAME", "28 W039 Industrial Ave", "Barrington, IL 60010", "312-381-7195 (7196)", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") }


  // alert("the new array has been filled and the new index is " + newIndex)

  var i = newIndex

	myownwindow = window.open("", "myWindow","toolbar=no,width=700,height=500,status=no,menubar=yes,scrollbars=yes, resizable=yes")

	with(myownwindow.document) {
		write()
		close()
		write("<HTML>")
		write("<TITLE>Building & Grounds Database</TITLE><BODY BGCOLOR=WHITE>")
		write("<H2>Product Name:&nbsp;&nbsp;" + databaseItem[i].Item + "</h2>")
		write("<p><b>" + databaseItem[i].Descript + "</b><BR><BR>")
		write("Location: <b>" + databaseItem[i].LocOfItem + "</b>&nbsp;&nbsp;&nbsp;&nbsp;Cost: <b>" + databaseItem[i].Cost + "</b><BR><BR>")
		write("Purchase Date: <b>" + databaseItem[i].PurchaseDate + "</b><BR><BR>")
		write("Vendor Number: <b>" + databaseItem[i].VenNum + "</b>&nbsp;&nbsp;&nbsp;&nbsp;Vendor Name: <b>" + databaseItem[i].VenName + "</b><BR><BR>")
		write("Account Number: <b>" + databaseItem[i].AccountNum + "</b>&nbsp;&nbsp;&nbsp;&nbsp;Manufacturer: <b>" + databaseItem[i].Manufacturer + "</b><BR><BR>")
		write("Contact Name: <b>" + databaseItem[i].ContactName + "</b><BR><BR>")
		write("Contact Address: <b>" + databaseItem[i].ContactAddress + "</b><BR><BR>")
		write("Contact City, State, Zip: <b>" + databaseItem[i].CityStateZip + "</b><BR><BR>")
		write("Contact Phone: <b>" + databaseItem[i].Phone + "</b>&nbsp;&nbsp;&nbsp;&nbsp;Fax: <b>" + databaseItem[i].Fax + "</b><BR><BR>")
		write("Contact Email: <b>" + databaseItem[i].Email + "</b>&nbsp;&nbsp;&nbsp;&nbsp;Website: <b>" + databaseItem[i].Website + "</b><BR><BR>")
		write("Replacement Part Info: <b>" + databaseItem[i].ReplacePartInfo + "</b><BR><BR>")
		write("Notes: <b>" + databaseItem[i].Notes + "</b><BR><BR>")
		write("</BODY>")
		write("</HTML>")
		close() 
	}

}
<!--

 databaseItem[22] = addItem("ITEM", "DESCRIPT", "LOCATIONITEM", "PURHASEDATE", "COST", "VENNUM", "VENNAME", "ACCOUNTNUM", "MANUFACTURER", "CONTACTNAME", "CONTACTADDRESS", "CITYSTATEZIP", "PHONE", "FAX", "EMAIL", "WEBSITE", "REPLACEPARTINFO", "NOTES") -->
