function Get_Cookie(name) {
    var start = document.cookie.indexOf(name+"=");
    var len = start+name.length+1;
    if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
    if (start == -1) return null;
    var end = document.cookie.indexOf(";",len);
    if (end == -1) end = document.cookie.length;
    return unescape(document.cookie.substring(len,end));
}

function Set_Cookie(name,value,expires,path,domain,secure) {
alert('no longer needed');
    document.cookie = name + "=" +escape(value) +
        ( (expires) ? ";expires=" + expires.toGMTString() : "") +
        ( (path) ? ";path=" + path : "") +
        ( (domain) ? ";domain=" + domain : "") +
        ( (secure) ? ";secure" : "");
}

function getRequestObject() {

  REQUEST_PARAMS = new Object();
  separator = ',';
  query = '' + this.location;
  query = query.substring((query.indexOf('?')) + 1);
   if (query.length < 1) { return false; }

  keypairs = new Object();
  numKP = 1;
  while (query.indexOf('&') > -1) {
    keypairs[numKP] = query.substring(0,query.indexOf('&'));
    query = query.substring((query.indexOf('&')) + 1);
    numKP++;
  }

  keypairs[numKP] = query;

  for (i in keypairs) {
    keyName = keypairs[i].substring(0,keypairs[i].indexOf('='));
    keyValue = keypairs[i].substring((keypairs[i].indexOf('=')) + 1);
    while (keyValue.indexOf('+') > -1) {
      keyValue = keyValue.substring(0,keyValue.indexOf('+')) + ' ' + keyValue.substring(keyValue.indexOf('+') + 1);
    }
    keyValue = unescape(keyValue);
    if (REQUEST_PARAMS[keyName]) {
      REQUEST_PARAMS[keyName] = REQUEST_PARAMS[keyName] + separator + keyValue;
    } else {
      REQUEST_PARAMS[keyName] = keyValue;
    }
  }

  return REQUEST_PARAMS;
}


function printAssociateDept(){
  var associateID = Get_Cookie("associateID");

  if (associateID!='' && associateID!=null){
	document.getElementById('associateText').innerHTML="Dept: " + associateID + "<br>";
  }
}

//REQUEST_PARAMS = getRequestObject();
//if (REQUEST_PARAMS['hop']!=undefined){
// Set_Cookie("associateID",REQUEST_PARAMS['hop']);
//}

