function copyright(year)
{
   var a;

   a = new Date();

   yyyy = a.getYear();
   yyyy = ((yyyy < 1000) ? ((yyyy < 70) ? 2000 : 1900) : 0) + yyyy;

   if((year == undefined) || (yyyy == year))
   {
      document.write("Copyright &copy; " + yyyy + ' ');
   }
   else
   {
      document.write("Copyright &copy; " + year + '-' + yyyy + ' ');
   }
}

/** vertical center *********************************************************/

function centerVertical(id, height)
{
   var top = document.viewport.getHeight();

   var element = document.getElementById(id);

   top = top - height;
   top = top / 2;

   if(top < 0) { top = 0; }

   element.style.marginTop = top + 'px';
}

/** email routines **********************************************************/

function emailUrl(name, domain, extension)
{
   url = "mail" + "to:";
   url += name + "&#64;" + domain + "&#46;" + extension;

   document.Write(url);
}

function email(name, domain, extension, caption)
{
   url = "mail" + "to:";
   url += name + "&#64;" + domain + "&#46;" + extension;

   if((caption == undefined) || (caption.lenght == 0))
   {
      caption = name + "&#64;" + domain + "&#46;" + extension;
   }

   document.write("<a href=\"" + url + "\">" + caption + "</a>");
}

function emailSubject(name, domain, extension, caption, subject)
{
   url = "mail" + "to:";
   url += name + "&#64;" + domain + "&#46;" + extension;
   url += "?subject=" + escape(subject);

   document.write("<a href=\"" + url + "\">" + caption + "</a>");
}

function emailBody(name, domain, extensions, caption, subject, body)
{
   url = "mail" + "to:";
   url += name + "&#64;" + domain + "&#46;" + extension;
   url += "?subject=" + escape(subject);
   url += "&body=" + escape(body);

   document.write("<a href=\"" + url + "\">" + caption + "</a>");
}

/** cookie routines *********************************************************/

function setCookie(name, value, expires, path, domain, secure)
{
   var today = new Date();

   today.setTime(today.getTime());

   if(expires)
   {
      expires = expires * 1000 * 60 * 60 * 24;
   }

   var expiresDate = new Date(today.getTime() + expires);

   document.cookie = name + '=' + escape(value) +
      ((expires) ? ";expires=" + expiresDate.toGMTString() : "") +
      ((path) ? ";path=" + path : "") +
      ((domain) ? ";domain=" + domain : "") +
      ((secure) ? ";secure" : "");
}

function getCookie(name, defaultValue)
{
   var cookies = document.cookie.split(';');
   var cookie = "";

   var cookieName = "";
   var cookieValue = "";

   var found = false;

   var i = 0;

   while((i < cookies.length) && (!found))
   {
      cookie = cookies[i].split('=');

      cookieName = cookie[0].replace(/^\s+|\s+$/g, '');

      if(cookieName == name)
      {
         found = true;

         if(cookie.length > 1)
         {
            cookieValue = unescape(cookie[1].replace(/^\s+|\s+$/g, ''));
         }
      }

      i += 1;
   }

   if(!found)
   {
      cookieValue = defaultValue;
   }

   return cookieValue;
}

