﻿/* Grswell class 
 * 
 * 
 */

/* objects  */
function Grswell()
{
    // TODO warning about missing data?
	this.name = "";
	this.sidetrack = "";
	this.id = "";
	this.po = "";
	this.potype = 0;
	this.bags_type = "";
	this.bags = new Sets("Bags", [""], [""]);
	this.company = new Sets("Company Vials", [""], [""]);
	this.government = new Sets("Government Vials", ["", "", ""], ["AB", "BC", "SK"]);
	this.gunny = 0;
	this.mud = 0;
}

Grswell.prototype.toString = function()
{
	var val = "";
	val += "<table width='800px' cellpadding='2' bgcolor='#f7f7f7'font-family:'arial' align='left'>";
    val += "<tr><td width='50px'></td><td width='400px'></td><td width='50px'></td><td width='300px'></td></tr>";
	val += "<tr><td colspan='2'><b>Name:</b> <b>" + this.name + "</b></td><td colspan='2'><b>Sidetrack:</b>" + this.sidetrack + "</td></tr>";
	 
	//val += "<tr><td><b>Name:</b> </td><td><b>" + this.name + "</b></td><td><b>Sidetrack:</b></td><td>" + this.sidetrack + "</td></tr>";
	val += "<tr><td colspan='3'><b>Unique Id:</b> " + this.id + "</td></tr>";
		 
	if ( true ) { // always print this even if po is empty. this.po != "") {
	    var s;
	    if (this.potype == 0)
	        s = "<tr><td><b>AFE#:</b> </td><td>";
	    else
	        s = "<tr><td><b>PO#:</b> </td><td>";
	    val += s + this.po + "</td></tr>";
	} else 
	    val += "<tr><td colspan='2'></td></tr>";
	
	//if (this.bags_type != "none")
	val += this.bags.toString(this.bags_type);
	
	val += this.company.toString();
	val += this.government.toString();
	val += "<tr><td colspan='4'><hr></td></tr>";
	val += "<tr><td><b>Gunny:</b></td><td>" + this.gunny + "</td></tr>";
	val += "<tr><td><b>Mud:</b></td><td>" + this.mud + "</td></tr></table>";
	return val;
}




