function cmxRedirector()
{
	var cmxuri = new cmxUri(document.location.href);
	
	this.redirectOnHost = function(host, redirectUrl)
		{
			var r = new cmxUri(redirectUrl);
			var h = new String(cmxuri.host);

			if ((h.indexOf(host) > -1) && (host != r.host))
				this.redirect(redirectUrl);
		};

	this.redirectOnQueryKey = function(key, redirectUrl)
		{
			if (cmxuri.queryString.containsKey(key))
				this.redirect(redirectUrl);
		};

	this.redirectOnQueryValue = function(key, value, redirectUrl)
		{
			if (cmxuri.queryString.item(key) == value)
				this.redirect(redirectUrl);
		};

	this.redirectOnAbsoluteUrl = function(absoluteUrl, redirectUrl)
		{
			var u = new cmxUri(absoluteUrl);
								
			if (u.isValidUri)
			{
				if ((cmxuri.absoluteUri == u.absoluteUri) && (absoluteUrl != redirectUrl))
					this.redirect(redirectUrl);
			}
			else
				window.status = absoluteUrl + " is not a valid URL";
		};
	
	this.redirectOnUrl = function(url, redirectUrl)
		{
			var u = new cmxUri(url);
								
			if (u.isValidUri)
			{
				var r = new cmxUri(redirectUrl);
				var rp = new String(r.protocol);
				var rh = new String(r.host);
				var rt = new String(r.tldn);
				var up = new String(u.protocol);
				var uh = new String(u.host);
				var ut = new String(u.tldn);
				var cp = new String(cmxuri.protocol);
				var ch = new String(cmxuri.host);
				var ct = new String(cmxuri.tldn);
				
				if 
				(((up.toLowerCase() == cp.toLowerCase()) && 
					(uh.toLowerCase() == ch.toLowerCase()) && 
					(ut.toLowerCase() == ct.toLowerCase())) && 
					((up.toLowerCase() != rp.toLowerCase()) || 
					(uh.toLowerCase() != rh.toLowerCase()) || 
					(ut.toLowerCase() != rt.toLowerCase())))
					
					this.redirect(redirectUrl);
			}
			else
				window.status = url + " is not a valid URL";
		};
	
	this.redirect = function(redirectUrl)
		{
			var r = new cmxUri(redirectUrl);
					
			if (r.isValidUri)
				document.location.href = redirectUrl;
			else
				window.status = redirectUrl + " is not a valid URL";
		};
}
