// the model farms out work to a non-generic object (such as "prem2005Obj" 
// where tasks specific to the competition are processed.   
function Model(){
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);
}
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 readout = "this._snapShotObj contains: \n\n";
for(var i=1;i<=this._snapShotObj._rowCount;i++){
	readout = readout + this._snapShotObj.i_itemNameLeft[i]+":";
	readout = readout +" "+ this._snapShotObj.i_itemLeft[i]+"\n";
	readout = readout + this._snapShotObj.i_itemNameRight[i]+":";
	readout = readout +" "+ this._snapShotObj.i_itemRight[i]+"\n";
	}
readout = readout +"\n";
for(var i=1;i<=this._snapShotObj._numberOfRowsOfResults;i++){
	readout = readout +" "+ this._snapShotObj.o_tablerow[i][1]+": ";
	readout = readout +" "+ this._snapShotObj.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 readout = "updateObj contains: \n\n";
for(var i=1;i<=updateObj._rowCount;i++){
	readout = readout + updateObj.i_itemNameLeft[i]+":";
	readout = readout +" "+ updateObj.i_itemLeft[i]+"\n";
	readout = readout + updateObj.i_itemNameRight[i]+":";
	readout = readout +" "+ updateObj.i_itemRight[i]+"\n";
	readout = readout + updateObj.i_itemNameRight[i]+"(m):";
	readout = readout +" "+ updateObj.i_itemRightMirror[i]+"\n";
	readout = readout + updateObj.i_itemNameLeft[i]+"(m):";
	readout = readout +" "+ updateObj.i_itemLeftMirror[i]+"\n";
	}
readout = readout +"\n";
for(var i=1;i<=updateObj._numberOfRowsOfResults;i++){
	readout = readout +" "+ updateObj.o_tablerow[i][1]+": ";
	readout = readout +" "+ updateObj.o_tablerow[i][2]+"\n";
	readout = readout +" "+ updateObj.o_tablerow[i][4]+"\n";
	}
//alert(readout);
}