    function initialize() {
    	dhtmlHistory.initialize();
    	dhtmlHistory.addListener(historyChange);
		if (dhtmlHistory.isFirstLoad()) {
			var loc = window.location.toString();
			if (loc.indexOf('#') > 0) {
				// previouw history link found, go do it
				var hist = loc.substr((loc.indexOf('#') + 1));
				var splithist = hist.split(':');
				try {
					var split0 = '';
					var split1 = '';
					var split2 = '';		
					var split3 = '';
					var split4 = '';
					if (splithist.length > 0) { var split0 = splithist[0]; }
					if (splithist.length > 1) { var split1 = splithist[1]; }
					if (splithist.length > 2) { var split2 = splithist[2]; }
					if (splithist.length > 3) { var split3 = splithist[3]; }			
					if (splithist.length > 4) { var split4 = splithist[4]; }					
					switch (split1) {
						case 'blog': 		showBlog(split0, 0,split2, 0, 0, parseInt(split3),split4);
											break;
						case 'blogpost':	showBlog(split0, 0, 0, split2, 0, parseInt(split3),split4);
											break;
						case 'photoalbum':	showPhoto(split2, parseInt(split3));
											break;
						case 'user': 		showBlog(split0,split2,0,0,0,parseInt(split3),split4);
											break;
						case 'continent':	buildContinent([split2], null);
											break;
						case 'country':		buildCountry([split2], null);
											break;
						case 'destination':	buildDestination([split2], null);
											break;
						case 'poi':			buildPoi([split2], null);
											break;
						default:			break;
					}													
				} catch (e) {
					if (showCatchAlert) alert(e.message);
				}	
			}
		}
    }
             
     /** Our callback to receive history 
         change events. */
     function historyChange(newLocation, historyData) {
		if (historyData == null) return false;
		try {
			var split = newLocation.split(":");
			if (split.length > 0) {
				var d = document.getElementById(split[0] + 'content');
				if (d != null) {
					d.innerHTML = historyData;
				}
				
				/* Special cases */
				
				if (split[0] == "blogposts") {
					if (split[1] == "blog" || split[1] == "blogpost") {
						if (document.getElementById("tabBlog")) document.getElementById("tabBlog").className = 'on';
						if (document.getElementById("tabPhoto")) document.getElementById("tabPhoto").className = '';
						if (document.getElementById("tabUser")) document.getElementById("tabUser").className = '';
					}
					if (split[1] == "photoalbum") {
						if (document.getElementById("tabBlog")) document.getElementById("tabBlog").className = '';
						if (document.getElementById("tabPhoto")) document.getElementById("tabPhoto").className = 'on';
						if (document.getElementById("tabUser")) document.getElementById("tabUser").className = '';
					}
					if (split[1] == "user") {
						if (document.getElementById("tabBlog")) document.getElementById("tabBlog").className = '';
						if (document.getElementById("tabPhoto")) document.getElementById("tabPhoto").className = '';
						if (document.getElementById("tabUser")) document.getElementById("tabUser").className = 'on';
					}
				}
				
			}
		} catch (e) {
			if (showCatchAlert) alert(e.message);
		}	
	
        /*debugMsg(
        	  "<b>A history change has "
              + "occured:</b> "
              + "newLocation="+newLocation
              + ", historyData="+historyData); */
     }
     
     function debugMsg(msg) {
        var debugMsg = 
          document.getElementById("debugMsg");
        debugMsg.innerHTML = msg;
     }
