//I hope this library is usefull to you...
//If you use this library or have any comments or improvements please
//let me know at thomas@tpm-webapplicaties.nl. Let's share our knowledge

//This library is free software; you can redistribute it and/or
//modify it under the terms of the GNU Lesser General Public
//License as published by the Free Software Foundation; either
//version 2.1 of the License, or (at your option) any later version.

//This library is distributed in the hope that it will be useful,
//but WITHOUT ANY WARRANTY; without even the implied warranty of
//MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
//Lesser General Public License for more details.

//You should have received a copy of the GNU Lesser General Public
//License along with this library; if not, write to the Free Software
//Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA

// INCLUDE THE FOLLOWING LINES IN THE HTML BODY OF YOUR SPI:
// <iframe style="display:none" id="frameHistoryEmulatorForSPI" onload="if(objCentrale){objCentrale.ExecActionFromHistory()};"/>
// <script>var objCentrale = new objHistoryEmulatorForSPI();</script>	

function objHistoryEmulatorForSPI(){
	this.objHistoryFrame = parent.frames["frameHistoryEmulatorForSPI"]
	this.arrHistory = new Array();
	this.intCurrAction = 0; 

	this.ExecAndArchiveAction = function(strAction){
		eval(strAction)
		try{
			this.intCurrAction = this.arrHistory.length;
			this.arrHistory[this.intCurrAction]=strAction;
			this.objHistoryFrame.document.open("text/html");
			this.objHistoryFrame.document.write("<HTML><TITLE>"+(this.intCurrAction)+"</TITLE><BODY></BODY></HTML>");
			this.objHistoryFrame.document.close();
			}
		catch(e){}
	}
	
	this.ExecActionFromHistory = function(){
		try{	
			intAction = this.objHistoryFrame.document.title;
			if(!isNaN(intAction) && intAction!=this.intCurrAction){
				eval(this.arrHistory[intAction]);
				this.intCurrAction = intAction;
			}
		}
		catch(e){}
	}
}
