/**
*
*  URL encode / decode
*
**/

var Url = {
	initialize: function() {
		// Internet Explorer
		this.ie = (document.all != null); 
		this.ie7 = (ie && (navigator.userAgent.indexOf("7.")>=0));
		// Firefox
		this.ff = (navigator.userAgent.indexOf("Firefox")>=0);
		this.ff3 = ff && (navigator.userAgent.indexOf("3.")>=0);
	},
	
	// public method for url encoding
	encode : function (string) {
		if (this.ie7 || this.ff3){
			return encodeURIComponent(string);
		}else{
			return escape(string);
		}
	},
	
	// public method for url decoding
	decode : function (string) {
		if (this.ie7 || this.ff3){
			return decodeURIComponent(string);
		}else{
			return unescape(string);
		}
	}

}