// file no longer in use


	var Domain = '4rx.com';

	var multiDomain = true;
	// Parse query string
	Querystring();
	// if kbid exists, it writes the multi-domain cookie
	if ( Querystring_get('kbid')!=null ) {
		SetCookie('AffiliateId', Querystring_get('kbid'),1)
	}
	// if id exists (For clickinc the varaiable is id)
	if ( Querystring_get('id')!=null ) {
		SetCookie('AffiliateId', Querystring_get('id'),1)
	}
	if ( Querystring_get('sub')!=null ) {
		SetCookie('SubId', Querystring_get('sub'),1)
	}

	// Functions
	function WriteCookie (name, value, expires) {
		var argv = SetCookie.arguments;
		var argc = SetCookie.arguments.length;
		var path = "/";
		rootDomain = Domain;
	
		var secure = (argc > 5) ? argv[5] : false; 
		var cookie = name + "=" + escape(value) +
					((expires == null) ? "" : ("; expires=" + expires.toGMTString())) +
					((path == null) ? "" : ("; path=" + path)) +
					((rootDomain == null) ? "" : ("; domain=" + rootDomain)) +
					((secure == true) ? "; secure" : "");
		document.cookie = cookie;
	}
	
	function SetCookie(name, value, expiredays)     {
		var expdate = new Date(); 
		expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000 * expiredays)); 
		WriteCookie(name, value, expdate);  
	}
	
	function Querystring(qs) { // optionally pass a querystring to parse
		this.params = new Object()
		this.get=Querystring_get 
		if (qs == null)
					qs=location.search.substring(1,location.search.length)
		if (qs.length == 0) return
		// Turn <plus> back to <space>
		// See: http://www.w3.org/TR/REC-html40/interact/forms.html#h-17.13.4.1
		qs = qs.replace(/\+/g, ' ')
		var args = qs.split('&') // parse out name/value pairs separated via &
		// split out each name=value pair
		for (var i=0;i<args.length;i++) {
			var value;
			var pair = args[i].split('=')
			var name = unescape(pair[0])
			if (pair.length == 2)
			value = unescape(pair[1])
			else
			value = name
			this.params[name] = value
		}
	}
	
	function Querystring_get(key, default_) {
		// This silly looking line changes UNDEFINED to NULL
		if (default_ == null) default_ = null;
		var value=this.params[key]
		if (value==null) value=default_;
		return value
	}