/* use ViewNotDom class for NN4 and IE4 - anything that doesn't use DOM */
function ViewNotDom(numberOfDays,rowCount,model,controller,error,numberOfColumnsOfResults,numberOfRowsOfResults){
this._error = error;
this._numberOfColumnsOfResults = numberOfColumnsOfResults;
this._numberOfRowsOfResults = numberOfRowsOfResults;
this._rowCount = rowCount;
this._numberOfDays = numberOfDays;
this._abstractview = new AbstractView(this,model,controller);
this._snapShotObj = new SnapShotObj(this._rowCount,this._numberOfColumnsOfResults,this._numberOfRowsOfResults);
this._validator = new Validator(this._abstractview,this._rowCount,this._error);
}
ViewNotDom.prototype.aqquire = function(){
// get data from input form
var c = 1;
for(var d=0;d<this._numberOfDays;d++){
	var e = 0;
	while(document.inputForm["i_itemNameLeft"+d+"_"+e] != null){
		this._snapShotObj.i_itemLeft[c] = document.inputForm["i_itemLeft"+d+"_"+e+""].value;
		this._snapShotObj.i_itemNameLeft[c] = document.inputForm["i_itemNameLeft"+d+"_"+e+""].value;
		this._snapShotObj.i_itemRight[c] = document.inputForm["i_itemRight"+d+"_"+e+""].value;
		this._snapShotObj.i_itemNameRight[c] = document.inputForm["i_itemNameRight"+d+"_"+e+""].value;
		this._snapShotObj.i_itemLeftMirror[c] = document.inputForm["i_itemLeft"+d+"_"+e+"mirror"].value;
		this._snapShotObj.i_itemRightMirror[c] = document.inputForm["i_itemRight"+d+"_"+e+"mirror"].value;
		e++;
		c++;
		}
	}
// get data from output form
for(var i=1;i<=this._snapShotObj._numberOfRowsOfResults;i++){
		for(var j=1;j<=this._numberOfColumnsOfResults;j++){
		this._snapShotObj.o_tablerow[i][j] = document.outputForm["o_a"+i+j].value
		this._snapShotObj.o_tablerowMirror[i][j] = document.outputForm["o_a"+i+j+"mirror"].value
		}
	}	
this.send();
}
ViewNotDom.prototype.reset = function(){
this._abstractview.reset(this._snapShotObj);
}
ViewNotDom.prototype.update = function(updateObj){
this.decodeUpdateObj(updateObj);
}
ViewNotDom.prototype.send = function(){
this._validator.process(this._snapShotObj)
}
ViewNotDom.prototype.decodeUpdateObj = function(updateObj){
for(var i=1;i<=this._numberOfRowsOfResults;i++){
	for(var j=1;j<=this._numberOfColumnsOfResults;j++){
		document.outputForm["o_a"+i+""+j].value = updateObj.o_tablerow[i][j];
		document.outputForm["o_a"+i+""+j+"mirror"].value = updateObj.o_tablerow[i][j];
		}
	}	
for(var d=0;d<this._numberOfDays;d++){
// update mirrors so that they represent previous score entries
	var e = 0;
	while(document.inputForm["i_itemLeft"+d+"_"+e+"mirror"] != null){
		document.inputForm["i_itemLeft"+d+"_"+e+"mirror"].value = updateObj.i_itemLeft[e+1];
		document.inputForm["i_itemRight"+d+"_"+e+"mirror"].value = updateObj.i_itemRight[e+1];
		e++
		}
	}	
// allow Update to be clicked again...
main._enable = true;	
}
ViewNotDom.prototype.mailTo = function(obj){
this._sortQueryData = obj;
this._sortQueryData.saveString();
}
