// the model farms out work to a non-generic object (such as "prem2005Obj" 
// where tasks specific to the competition are processed.   
function Model(txt){
this._txt=txt;
EventBroadcaster.initialize(this);
this._updateObj = new UpdateObj();
}
Model.prototype.aqquire = function(snapShotObj){
this._snapShotObj = snapShotObj;
this.process();
}
Model.prototype.process = function(){
this.showSnapShotObj();
// go through the LHS names and work out 
this.ngObj = new NonGenericObject(this._snapShotObj,this,this._txt);
}
Model.prototype.transmit = function(updateObj){
this.showUpdateObj(updateObj);
this.broadcastMessage('update',updateObj);
}
// just outputs all the properties of the snapShotObj for debugging purposes
Model.prototype.showSnapShotObj = function(){
var id = this._snapShotObj.id;
var readout = "this._snapShotObj contains: \n\n";
for(var i=1;i<=this._snapShotObj[id].fm.rowCount;i++){
	readout = readout + this._snapShotObj[id].i_itemNameLeft[i]+":";
	readout = readout +" "+ this._snapShotObj[id].i_itemLeft[i]+"\n";
	readout = readout + this._snapShotObj[id].i_itemNameRight[i]+":";
	readout = readout +" "+ this._snapShotObj[id].i_itemRight[i]+"\n";
	}
readout = readout +"\n";
for(var i=1;i<=this._snapShotObj[id].fm.numRowResults;i++){
	readout = readout +" "+ this._snapShotObj[id].o_tablerow[i][1]+": ";
	readout = readout +" "+ this._snapShotObj[id].o_tablerow[i][2]+"\n";
	}
//alert(readout);
//for(var prop in this._snapShotObj){alert(prop)}
}
// just outputs all the properties of the updateObj for debugging purposes
Model.prototype.showUpdateObj = function(updateObj){
var id = this._snapShotObj.id;
var readout = "updateObj contains: \n\n";
for(var i=1;i<=this._snapShotObj[id].fm.rowCount;i++){
	readout = readout + updateObj[id].i_itemNameLeft[i]+":";
	readout = readout +" "+ updateObj[id].i_itemLeft[i]+"\n";
	readout = readout + updateObj[id].i_itemNameRight[i]+":";
	readout = readout +" "+ updateObj[id].i_itemRight[i]+"\n";
	readout = readout + updateObj[id].i_itemNameRight[i]+"(m):";
	readout = readout +" "+ updateObj[id].i_itemRightMirror[i]+"\n";
	readout = readout + updateObj[id].i_itemNameLeft[i]+"(m):";
	readout = readout +" "+ updateObj[id].i_itemLeftMirror[i]+"\n";
	}
readout = readout +"\n";
for(var i=1;i<=this._snapShotObj[id].fm.numRowResults;i++){
	readout = readout +" "+ updateObj[id].o_tablerow[i][1]+": \n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][2]+"\n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][3]+"\n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][4]+"\n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][5]+"\n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][6]+"\n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][7]+"\n";
	readout = readout +" "+ updateObj[id].o_tablerow[i][8]+"\n";
	}
//alert(readout);
}