//Read URL and identify current location
var app = Class.create();
app.prototype = {	
	initialize : function() {		
		//in the constructor below, the 1st argument must match the literal string of the vaiable; 
		//2nd argument should be left blank   
		browserHistory = new historyStack("browserHistory", "");				
		browserHistory.onBrowserAddressChanged = function(){			
			//alert(this.current); //replace with your own logic	
			var value = this.current;
			value = decrypt(value);
            //alert(value);					
			loadpage(value);
		};
	}
}

function decrypt(to_dec){
	var xor_key = 7;
	var xor_res = "";
	for(i=0;i<to_dec.length;i++)
	{
		xor_res+=String.fromCharCode(xor_key^to_dec.charCodeAt(i));
	}
	
	return xor_res;
}
