function Fader(el, fadeIn)
{
	var me = this;
  this.el = (typeof(el) == "object")?el:(typeof(el) == "string")?document.getElementById(el):null;
  this.fadeIn = fadeIn;
  this.doFade = doFade;
  this.setOpacity = setOpacity;
  this.showElement = showElement;
  this.opacity = 0;
  this.doFade();
  function setOpacity()
  {
    if (typeof(this.el.style.opacity) != null) this.el.style.opacity = this.opacity / 100;
    if (typeof(this.el.style.filter) != null) this.el.style.filter = "alpha(opacity=" + this.opacity + ")";
		this.opacity += (this.fadeIn)?1:-1;
  }
  function showElement(show)
  {
    if (this.el && this.el.style) this.el.style.display = (show)?"block":(this.fadeIn)?"block":"none";
  }
  function doFade()
  {
    this.showElement(true);
    if (this.fadeIn)
    {
      this.opacity = 0;
      this.setOpacity();
      for (var i=0; i<=100; i++)
      {
        var newFunc = function() { me.setOpacity(); };
        setTimeout(newFunc, 12*i);
          }
      }
      else
      {
        this.opacity = 100;
        this.setOpacity();
        for (var i=0; i<=100; i++)
          {
            var newFunc = function() { me.setOpacity(); };
            setTimeout(newFunc, 12*i);
          }
      }
      var newFunc = function () { me.showElement(); };
      setTimeout(newFunc, 810);
    }
}
function fade(obj, fadeIn)
{
  if (obj) new Fader(obj, fadeIn);
}
function fadeIn(objID)
{
  fade(objID, true);
}
function fadeOut(objID)
{
  fade(objID, false);
}
(document.getElementById ? DOMCapable = true : DOMCapable = False);
function show(menuname) {
	if (DOMCapable)
		{var theMenu = document.getElementById(menuname);
			theMenu.style.visibility = 'visible';
		}
}
function hide(menuname) {
	if (DOMCapable)
		{var theMenu = document.getElementById(menuname);
			theMenu.style.visibility = 'hidden';
		}
}
function fadeObj() {
	var me = this; 
	this.fadeFunction = function() { fadeOut("frontImage"); };
	show('menuImage');
	setTimeout(function() {me.fadeFunction(); }, 1500); 
	}	
function hideAll() {
	hide('menuprofile');
	hide('menugallery');
	hide('menustore');
	hide('menucart');
	hide('menuocean');
	hide('menucitizen');
	}
