var sslvpn_cookie = {
		name: "SSLVPN-MARKER",
		read : function () {
			if (this.value != undefined  &&
				this.value != null)
				return this.value;

			var nameEQ = this.name + "=";
			var ca = document.cookie.split(';');
			for(var i=0;i < ca.length;i++) {
				var c = ca[i];
				while (c.charAt(0)==' ') c = c.substring(1,c.length);
				if (c.indexOf(nameEQ) == 0) return this.value = c.substring(nameEQ.length,c.length);
			}
			return this.value = null;
		},
		set : function (value) {
			document.cookie = this.name + "=" + value +"; Path=/;";	
			this.value = value;
		},
		toggle : function () {
			this.set (this.is_set ()?"false":"true");
		},
		is_set : function () {
			return this.read () == "true" ? true : false;
		}

	};

if (! sslvpn_cookie.is_set ()) { // no sslvpn loaded
    sslvpn_cookie.toggle ();
    window.location.replace("http://<ag-url>/sslvpn/login?protocol=http&popUrl="+window.location);
    // the following sequence makes sure that URL is reloaded and no further javascript is executed.
    onerror = function () { return true; }; // ignore the error from being dislayed to user for the following statement.
    xxyy (10); // let's make an error to abort form submission later by AG. no function
}
sslvpn_cookie.toggle ();
