function ArrayPush(a,ele){
  a[a.length] = ele;
}
function mm_changeItemProperty(menuName, itemName, codeRef, newValue, updateDisplay) {
  menuName = menuName.toLowerCase();
  for (i=0; i<_mi.length; i++)
    if (_mi[i][1].replace(/\ \;/ig,' ') == itemName && _m[_mi[i][0]][1] == menuName) break;
  if (i == _mi.length) return;
  _mi[i][codeRef] = newValue;
  if (updateDisplay) BDMenu(_mi[i][0]);
}
function GetCookie(sName)
{
  var aCookie = document.cookie.split("; ");
  for (var i=0; i < aCookie.length; i++)
  {
    var aCrumb = aCookie[i].split("=");
    if (sName == aCrumb[0]) 
    return unescape(aCrumb[1]);
  }
  return null;
}

function getuid()
{
datenow = new Date();
return datenow.getTime();
}

function SetCookie(theName,theValue) {
  Expiry = 100;
  var datenow = new Date();
  //get a date
  
  datenow.setTime(datenow.getTime() + Math.round(86400000*Expiry));
  //mutiply the number to make it represent days
  
  Expiry = datenow.toGMTString();
  
  document.cookie = theName +
  '='
  + theValue
  + '; path=/'
  + '; expires='+Expiry;
}

function getPageCoords (el) {
  var coords = {x: 0, y: 0};
  do {
    coords.x += el.offsetLeft;
    coords.y += el.offsetTop;
  }
  while ((el = el.offsetParent));
    return coords;
}

var Document_Dirty = 0;

function SetDirty(){
  Document_Dirty = 1
}

function ClearDirty(){
  Document_Dirty = 0
}

function PromptForSave(url){
  if(Document_Dirty){
    if(confirm('Save changes?')){
      fm.submit();
    } else {
      document.location = url
    }
  }else
    document.location = url
}