//******************************************************************

function bsGetCookie (name) {
  var arg = escape(name) + "=";
  var alen = arg.length;
  var clen = document.cookie.length;
  var i = 0;
  while (i < clen) {
    var j = i + alen;
    if (document.cookie.substring(i, j) == arg)
	{
	  var k = document.cookie.indexOf (";", j);
	  if (k == -1)
		k = document.cookie.length;
	  return unescape(document.cookie.substring(j, k));
	};
    i = document.cookie.indexOf(" ", i) + 1;
    if (i == 0) break; 
  }
  return null;
}

function bsSetCookie (name,value,expires,path,domain,secure) {
  var expdate = new Date(expires);
  var base = new Date(0);
  expdate.setTime( expdate.getTime() - base.getTime() );
  document.cookie = escape(name) + "=" + escape (value) +
    ((expires) ? "; expires=" + expdate.toGMTString() : "") +
    ((path) ? "; path=" + path : "") +
    ((domain) ? "; domain=" + domain : "") +
    ((secure) ? "; secure" : "");
}

function bsDeleteCookie (name,path,domain) {
  if (bsGetCookie(name)) {
    document.cookie = escape(name) + "=" +
      "; expires=Wed, 23-May-84 00:00:01 GMT" +
      ((path) ? "; path=" + path : "") +
      ((domain) ? "; domain=" + domain : "");
  }
}

//******************************************************************


function reqAircraftClick( that ) {
	if (that.checked) {
		bsSetCookie( that.value, 'x', null, '/' );
		if ( ! (that.form.SubmitButton) ) {
			that.form.submit();
		};
	} else {
		bsDeleteCookie( that.value, '/' );
	};
};

function reqClick( that ) {
	if (that.checked) {
		bsSetCookie( that.name, 'x', null, '/' );
		if ( ! (that.form.SubmitButton) ) {
			that.form.submit();
		};
	} else {
		bsDeleteCookie( that.name, '/' );
	};
};


