/**
 * Query String Functions.
 * It is part of the BJS (Buggedcom Javascript) Library. 
 * It must be loaded after the base.js BJS Library. 
 * @license PROPRIETARY
 * @created 10.04.2006
 * @author Oliver Lillie
 * @email publicmail@buggedcom.co.uk
 */
if(typeof buggedcom == "undefined") var buggedcom = new Object();
if(typeof buggedcom.utility == "undefined") buggedcom.utility = new Object();

buggedcom.utility.querystring = function(){};
buggedcom.utility.querystring.prototype = {

	get: function(param) 
	{
		var q = document.location.search;
		var detectIndex = q.indexOf(param);
		var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;
		if(q.length > 1 && detectIndex != -1) 
		{
			return q.substring(q.indexOf("=", detectIndex)+1, endIndex);
		} 
		else 
		{
			return null;
		}
	},
	
	isset: function(param)
	{
		var q = document.location.search;
		var detectIndex = q.indexOf(param);
		var endIndex = (q.indexOf("&", detectIndex) != -1) ? q.indexOf("&", detectIndex) : q.length;
		return (q.length > 1 && detectIndex != -1);
	}
	
};
QueryString = new buggedcom.utility.querystring();
