context: 	addToHistory: function(args){		//If addToHistory is called, then that means we prune the		//forward stack -- the user went back, then wanted to		//start a new forward path.		this.forwardStack = []; 		var hash = null;		var url = null;		if(!this.historyIframe){			this.historyIframe = window.frames["djhistory"];		}		if(!this.bookmarkAnchor){			this.bookmarkAnchor = document.createElement("a");			dojo.body().appendChild(this.bookmarkAnchor);			this.bookmarkAnchor.style.display = "none";		}		if(args["changeUrl"]){			hash = "#"+ ((args["changeUrl"]!==true) ? args["changeUrl"] : (new Date()).getTime());						//If the current hash matches the new one, just replace the history object with			//this new one. It doesn't make sense to track different state objects for the same			//logical URL. This matches the browser behavior of only putting in one history			//item no matter how many times you click on the same #hash link, at least in Firefox			//and Safari, and there is no reliable way in those browsers to know if a #hash link			//has been clicked on multiple times. So making this the standard behavior in all browsers			//so that dojo.undo.browser's behavior is the same in all browsers.			if(this.historyStack.length == 0 && this.initialState.urlHash == hash){				this.initialState = this._createState(url, args, hash);				return;			}else if(this.historyStack.length > 0 && this.historyStack[this.historyStack.length - 1].urlHash == hash){				this.historyStack[this.historyStack.length - 1] = this._createState(url, args, hash);				return;			}			this.changingUrl = true;			setTimeout("window.location.href = '"+hash+"'; dojo.undo.browser.changingUrl = false;", 1);			this.bookmarkAnchor.href = hash;						if(dojo.render.html.ie){				url = this._loadIframeHistory();				var oldCB = args["back"]||args["backButton"]||args["handle"];				//The function takes handleName as a parameter, in case the				//callback we are overriding was "handle". In that case,				//we will need to pass the handle name to handle.				var tcb = function(handleName){					if(window.location.hash != ""){						setTimeout("window.location.href = '"+hash+"';", 1);					}					//Use apply to set "this" to args, and to try to avoid memory leaks.					oldCB.apply(this, [handleName]);				}						//Set interceptor function in the right place.				if(args["back"]){					args.back = tcb;				}else if(args["backButton"]){					args.backButton = tcb;				}else if(args["handle"]){					args.handle = tcb;				}						var oldFW = args["forward"]||args["forwardButton"]||args["handle"];						//The function takes handleName as a parameter, in case the				//callback we are overriding was "handle". In that case,				//we will need to pass the handle name to handle.				var tfw = function(handleName){					if(window.location.hash != ""){						window.location.href = hash;					}					if(oldFW){ // we might not actually have one						//Use apply to set "this" to args, and to try to avoid memory leaks.						oldFW.apply(this, [handleName]);					}				}				//Set interceptor function in the right place.				if(args["forward"]){					args.forward = tfw;				}else if(args["forwardButton"]){					args.forwardButton = tfw;				}else if(args["handle"]){					args.handle = tfw;				}			}else if(dojo.render.html.moz){				// start the timer				if(!this.locationTimer){					this.locationTimer = setInterval("dojo.undo.browser.checkLocation();", 200);				}			}		}else{			url = this._loadIframeHistory();		}		this.historyStack.push(this._createState(url, args, hash));	},
meta: 4707	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/4707/50c3492c4c3c825dbd3401e134a19ed46799c456/browser.js/clean/www/resources/dojo-ajax/src/undo/browser.js