

	Stenstrom.NET.Web.QueryString		= function(sQueryString){
	
	// inherit the System.Object class properties and methods 
		Stenstrom.NET.System.Object.call(this);
		
	// create the prototype so that this class may be inherited 
		Stenstrom.NET.Web.QueryString.prototype				= new Stenstrom.NET.System.Object();
		Stenstrom.NET.Web.QueryString.prototype.constructor	= Stenstrom.NET.Web.QueryString;
		
	// static properties - defined as public but not intended for public consumption
		this.Type		= "Stenstrom.NET.Web.QueryString";
		
		QueryString_Initialize(this, sQueryString);
	
	}
	function QueryString_Initialize(obj, sQueryString){
	
		obj._queryString				= "";
		obj._queryStringParameterArray	= new Array();
		obj._queryStringKeyArray		= new Array();
		obj._queryStringValueArray		= new Array();
		
	// initialize the QueryString
		if(sQueryString.substring(0,1) == "?"){
			sQueryString 	= sQueryString.substring(1, sQueryString.length);
			obj._queryString	= sQueryString;
		}
		
	// create an array of each key/value pair ... ie. [name=gary] [age=37]
		var arrTemp 		= sQueryString.split("&");
	 
	// now break each pair into it's own Name/Value array 
		for(var i=0; i<arrTemp.length; i++)
		{
			var keyValuePair	= arrTemp[i].split("=");
			var key				= keyValuePair[0];
			var value			= keyValuePair[1];
			obj._queryStringParameterArray.push( keyValuePair );
			obj._queryStringKeyArray.push( key );
			obj._queryStringValueArray.push( value );
		}
		
		
		obj.GetValue		= function(sKey){
	
			for(var i=0; i<this._queryStringParameterArray.length; i++)
			{
				if(this._queryStringParameterArray[i][0].toLowerCase() == sKey.toLowerCase())
					return this._queryStringParameterArray[i][1];
			}
			return null;
		}
		obj.GetKeys			= function(){
	
			return(this._queryStringKeyArray);
		}
		obj.GetValues		= function(){
	
			return(this._queryStringValueArray);
		}
		obj.toString		= function(){
		
			return(this._queryString);
		}
	}
	
	Stenstrom.NET.Web.Navigator			= function(){
	
	// inherit the System.Object class properties and methods 
		Stenstrom.NET.System.Object.call(this);
		
	// create the prototype so that this class may be inherited 
		Stenstrom.NET.Web.Navigator.prototype			= new Stenstrom.NET.System.Object();
		Stenstrom.NET.Web.Navigator.prototype.constructor	= Stenstrom.NET.Web.Navigator;
		
	// static properties - defined as public but not intended for public consumption
		this.Type		= "Stenstrom.NET.Web.Navigator";
		
		Navigator_Initialize(this);	
	}
	function Navigator_Initialize(obj){
	
	// properties
		obj.IsMSIE			= ( navigator.userAgent.indexOf("MSIE") != -1 );
		obj.ActiveXSupport	= ( window.ActiveXObject != undefined );
		obj.QueryString		= new Stenstrom.NET.Web.QueryString( location.search );
	
	// functions
		obj.ActiveXEnabled		= function(){
		
			if(!this.ActiveXSupport)
				return false;
			
			try
			{
				var objTest	= new ActiveXObject("MSXML2.DOMDocument"); 
				if(objTest != null)
					return true;
			}
			catch(err){ return false; }
		}
		obj.SetCookie			= function(key, value, expiry){
					
			if(expiry == null)
				document.cookie = key + "=" + escape(value) + "; path=/"
			else
			{
				var expDate = new Date();
				expDate.setTime (expDate.getTime() + expiry);
				document.cookie = key + "=" + escape (value) + "; path=/" + "; expires=" + expDate.toGMTString();
			}
		}
		obj.GetCookie			= function(key){
			var CookieString 	= document.cookie;
			var CookieSet 	= CookieString.split (';');
			var SetSize 		= CookieSet.length;
			var ReturnValue 	= "";
			var CookiePieces;

			for (var x = 0; ((x < SetSize) && (ReturnValue == "")); x++) 
			{
				CookiePieces = CookieSet[x].split ('=');
				
				if (CookiePieces[0].substring (0,1) == ' ') 
					CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
					
				if (CookiePieces[0] == key)
					ReturnValue = CookiePieces[1];
			}
			
			if(ReturnValue == "")
				return(null);
			else
				return unescape(ReturnValue);
		}
		obj.GetKeys				= function(){
			
		// get an array of key/value pairs of all the cookies
			var arrCookies	= (unescape(document.cookie)).split(";");
		// initialize the array that will be returned
			var arrKeys		= new Array();
		// split each key/value pair to extract the key 
			for(var i=0; i<arrCookies.length; i++){
			
				var cookiePair 	= arrCookies[i].split("=");
				arrKeys.push( cookiePair[0] );
			}
			
		// return the array of keys
			return( arrKeys );
		}
		obj.ClearCookie			= function(key){
		// to clear a cookie, set the key values to empty and set the expiration date to a date in the past
				var expDate = new Date();
				expDate.setTime (expDate.getTime() - 1);
				document.cookie = key + "=; path=/; expires=" + expDate.toGMTString();
		}
		obj.ClearAllCookies		= function(){
		// to clear a cookie, set all the key values to empty and set the expiration date to a date in the past
			var CookieString 	= document.cookie;
			var CookieSet 	= CookieString.split (';');
			var SetSize 		= CookieSet.length;
			var ReturnValue 	= "";
			var CookiePieces;

		// set all the key values to empty strings
			for (var x = 0; ((x < SetSize) && (ReturnValue == "")); x++) 
			{
				CookiePieces = CookieSet[x].split ('=');
				
				if (CookiePieces[0].substring (0,1) == ' ') 
					CookiePieces[0] = CookiePieces[0].substring (1, CookiePieces[0].length);
					
			// set the expiration date to some time in the past
				var expDate = new Date();
					expDate.setTime(expDate.getTime() - 1 );
				
				document.cookie = CookiePieces[0] + "=; path=/; expires=" + expDate.toGMTString();
			}
		}			
	
	}


	
	
	
	