function showImage(filename, title, width, height) {
  window.open('image.php?id='+filename+'&title='+title+'&height='+height, 'imageWindow', 'width='+(width+60)+', height='+(height+90));
}

function showBadge(id) {
  showAward(id, 400, 292);
}

function showRibbon(id) {
  showAward(id, 400, 265);
}

function showPin(id) {
  showAward(id, 360, 305);
}

function showMedal(id) {
  showAward(id, 360, 344);
}

function showAward(id, width, height) {
  window.open('bf2142/award.php?id='+id, 'awardWindow', 'width='+width+', height='+height);
}

function saveComment() {
  var alertList = '';
  if(document.commentForm.commentName.value == '') {
    alertList = alertList + 'You must enter a name.\n';
  }
  if(document.commentForm.commentBody.value == '') {
    alertList = alertList + 'You must enter a comment.\n';
  }
  if(alertList == '') {
    document.commentForm.submit();
  } else {
    alert(alertList);
  }
}

function displayMail(user, domain, text) {
  document.write('<a class="sidebar" href='+'"mail'+'to:'+user+'@'+domain+'" target="main">'+text+'</a>');
}

function sendMail() {
  var alertList = '';
  if(document.emailForm.name.value == '') {
    alertList = alertList + ' Your Name\n';
  }
  if(document.emailForm.email.value == '') {
    alertList = alertList + ' Your E-mail Address\n';
  }
  if(document.emailForm.subject.value == '') {
    alertList = alertList + ' Subject\n';
  }
  if(document.emailForm.message.value == '') {
    alertList = alertList + ' Message\n';
  }
  if(alertList == '') {
    document.emailForm.submit();
  } else {
    alert('Please fill in the following fields:\n\n' + alertList);
  }
}

