
function magelo_win(doc)
{
  window.open(doc,"doc","height=600,width=800,toolbar=no,statusbar=no,scrollbars=yes,resize=yes").focus();
}

function thott_win(doc)
{
  window.open(doc,"doc","height=500,width=500,toolbar=no,statusbar=no,scrollbars=yes,resize=yes").focus();
}

function allakhazam_win(doc)
{
  window.open(doc,"doc","height=650,width=720,toolbar=no,statusbar=no,scrollbars=yes,resize=yes").focus();
}

function ctprofiles_win(doc)
{
  window.open(doc,"doc","height=670,width=700,toolbar=no,statusbar=no,scrollbars=yes,resize=yes").focus();
}

function checkSelected() 
{
  len = document.messages.elements.length;
  var i;
  for (i = 0; i < len; i++) 
  {
    if (document.messages.elements[i].checked)
    return true;
  }
  return false;
}

function Submit(action, start_index)
{
  if (checkSelected())
  {
    document.messages.action.value = action;
    document.messages.start_index.value = start_index;
    document.messages.submit();
  } 
  else
  {
    window.alert('You must select at least one message first.');
  }
}

function navigateInbox()
{
  document.navigation.submit();
}


// For mouseovers on items from the item database
function showstats (e, i, xoffset) 
{
  var o = document.getElementById(i);
  var y = 0;
  var x = 0;
  x = mouseX(e) + 4;  // The +4 seems to pretty much eliminate the possibility of "jiggling"
  y = mouseY(e) + 4;
  o.style.position="absolute";
  o.style.top = y + "px";
  o.style.left = x + "px";
  o.style.display = "block";
  o.style.width = "240px";
}

// For mouseouts on items from the item database
function clearstats (i)
{
  var o = document.getElementById(i);
  o.style.display = 'none';
}

// Gets the X mouse position
// Works in Firefox, Opera and Internet Explorer
function mouseX(evt) 
{
  if (evt.pageX) 
    return evt.pageX;
  else if (evt.clientX)
    return evt.clientX + (document.documentElement.scrollLeft ? document.documentElement.scrollLeft : document.body.scrollLeft);
  else
    return null;
}

// Gets the Y mouse position
// Works in Firefox, Opera and Internet Explorer
function mouseY(evt) 
{
  if (evt.pageY) 
    return evt.pageY;
  else if (evt.clientY)
    return evt.clientY + (document.documentElement.scrollTop ? document.documentElement.scrollTop : document.body.scrollTop);
  else
    return null;
}

