/*
 * email encoder
 */
function writeEmailLink()
{
  writeEmailContent("");
}

function writeEmailImage(imagePath)
{
  var str = "<img src='" + imagePath + "' border=0>";
  writeEmailContent(str);
}

function writeEmailContent(str)
{
  var email_str = "";
  var email_link_tag_str  = "";

  email_str = "";
  email_str += "i" + "n" + "f" + "o";
  email_str += "@";
  email_str += "m" + "u" + "m" + "l" + "e" + "k";
  email_str += ".";
  email_str += "c" + "o" + "m";

  email_link_tag_str += "<a href='mailto:";
  email_link_tag_str += email_str;
  email_link_tag_str += "'>";
  email_link_tag_str += (str == "") ? email_str : str;
  email_link_tag_str += "</a>";

  document.write(email_link_tag_str);
}

function System() {
}

System.moz = (typeof document.implementation != 'undefined') && (typeof document.implementation.createDocument != 'undefined');
System.ie = (typeof window.ActiveXObject != 'undefined');

System.init = function () {
  var counterElem = document.getElementById("counter");
  if(counterElem != null)
  {
    counterElem.style.display = "";
  }
}

System.menuItemOver = function(id) {
  document.getElementById(id).style.background = '#1D3477';
}

System.menuItemOut = function(id) {
  document.getElementById(id).style.background = '#CECF9C';
}

System.menuItemClick = function(link) {
  document.location = link;
}


System.showImageWindow = function (windowUrl, windowTitle) {
  var width = 545;
  var height = 550;

  var left = 0;
  var top = 0;

  var expandingWindow = false;
  if(screen.width <= 800) {
    expandingWindow = true;
  }

  if(expandingWindow) {
    height = screen.height - 100;
    left = (screen.width - width)/2;
    top = 0;
  } else {
    left = (screen.width - width)/2;
    top = (screen.height - height-100)/2;
  }

  if (left < 0) left = 0;
  if (top < 0) top = 0;

  var toolbar = "no"
  var location = "no";
  var directories = "no";
  var status = "no";
  var menubar = "no";
  var scrollbars = "yes";
  var resizable = "yes";
  var copyhistory = "no";

  var windowProperties = "";
  windowProperties += "toolbar=" + toolbar + ", ";
  windowProperties += "location=" + location + ", ";
  windowProperties += "directories=" + directories + ", ";
  windowProperties += "status=" + status + ", ";
  windowProperties += "menubar=" + menubar + ", ";
  windowProperties += "scrollbars=" + scrollbars + ", ";
  windowProperties += "resizable=" + resizable + ", ";
  windowProperties += "copyhistory=" + copyhistory + ", ";
  windowProperties += "width=" + width + ", ";
  windowProperties += "height=" + height + ", ";
  windowProperties += "left=" + left + ", ";
  windowProperties += "top=" + top;

  window.open(windowUrl, windowTitle, windowProperties);
}


System.toTop = function()
{
  if(System.ie)
  {
    document.getElementById('topRefButton').click();
  }
  else
  {
    document.getElementById('topRef').focus();
  }
}

System.toBack = function()
{
  history.go(-1);
}