	////////////////////////////////////////////////////////////////////////////////////////////////////////////////
		
		function copyPrototype(descendant, parent) { 
			var sConstructor = parent.toString(); 
			var aMatch = sConstructor.match( /\s*function (.*)\(/ ); 
			if ( aMatch != null ) { descendant.prototype[aMatch[1]] = parent; } 
			for (var m in parent.prototype) { 
				descendant.prototype[m] = parent.prototype[m]; 
			} 
		};
		
		//copyPrototype(ErrorLayer, Layer); 
		
	////////////////////////////////////////////////////////////////////////////////////////////////////////////////
	//
	//	LAYER 
	//	OBJECT
	//
		
		function TrackHistory(){
			var _this = this;
			var HASH = null;
			var _pollInterval;
			var _currentHash;
			var _intervalID;
			var _this = this;
			//alert('hit');
		}
		
		TrackHistory.prototype = {
			//
			//	INITIALIZE PARAMETERS
			//
				setParams: function(){
					
				},
				
			//
			//
			//
				_init: function(){
					_this = this;
					// set the interval
					if (setInterval) this._intervalID = setInterval(function(){_this._watchHash()}, this._pollInterval);
				},
				
			//
			//
			//
				_getHash: function() {
					return location.hash.substring(1);
				},
				
			//	method: _watchHash
			//
			//	A private method that is called every n miliseconds (<_pollInterval>) to check if the hash has changed.
			//	This is the primary Hash change detection method for most browsers. It doesn't work to detect the hash
			//	change in IE 5.5+ or various other browsers. Workarounds like the iframe method are used for those 
			//	browsers (IE 5.0 will use an anchor creation hack).
		
				
				_watchHash: function() {
					var $newHash = this._getHash();
					if (this._currentHash != $newHash) {
						this._currentHash = $newHash;
						this._updateSWF(this._currentHash);
						//this.notifyListeners("historyChange", $newHash);
					}
				},
				
			//
			//
			//
				_updateSWF: function(){
					
					this._thisMovie("main").updateHistory(this._currentHash);
					//alert(this._currentHash);
				},
				
			//
			//
			//
				_thisMovie:	function(movieName){
					if (navigator.appName.indexOf("Microsoft") != -1) {
						return window[movieName];
					} else {
						return document[movieName];
					}
				},
				
			//
			//
			//
				 _createAnchor: function($newHash) {
					if (!_checkAnchorExists($newHash)) {
						var $anchor;
						if (/MSIE/.test(navigator.userAgent) && !window.opera)
							$anchor = document.createElement('<a name="'+$newHash+'">'+$newHash+"</a>");
						else
							$anchor = document.createElement("a");
							$anchor.setAttribute("name", $newHash);
						with ($anchor.style) {
							position = "absolute";
							display = "block";
							top = getScrollY()+"px";
							left = getScrollX()+"px";
						}
						//$anchor.style.display = 'none';
						//$anchor.innerHTML = $newHash;
						document.body.insertBefore($anchor,document.body.firstChild);
						//document.body.appendChild($anchor);
					}
				},
				
			//
			//
			//
				addHistory: function($newHash) {
		
					if (_currentHash != $newHash) {
						_createAnchor($newHash);
						_currentHash = $newHash;
						_setHash($newHash);
						_this.notifyListeners("historyChange",$newHash);
						
					}
					return true;
				}
				
				
		}
