function _e(v)
{ return document.getElementById ? document.getElementById(v) : (document.all ? document.all[v] : 0);}

function dump(obj)
{
	var s = "";
	var cnt = 0;
  var once = true;
  for (key in obj)
	{
		cnt++;
		s += key + " -> " + obj[key] + "\n";
	  if (cnt > 25)
	  {
	   once = false;
     alert(s);
	   s = "";
	   cnt = 0;
	  }
	}

  if (once) { alert(s); }
}

var DocumentDecorator = new docLoader();

function docLoader() { }

docLoader.prototype.Init = function()
{
  this.DetectOS();
  this.DetectBrowser();
  this.HrefRemoveFocus();
  this.PNGFixLoader();
};

docLoader.prototype.DetectOS = function()
{
};

docLoader.prototype.DetectBrowser = function()
{
  this.userAgent = navigator.userAgent;
  this.isFirefox = this.userAgent.indexOf("Firefox/");
  this.isIE = this.userAgent.indexOf("MSIE");
  this.appVersion = navigator.appVersion;
  if (this.isFirefox != -1) { this.appVersion = this.userAgent.split("Firefox/"); }
  else if (this.isIE != -1) { this.appVersion = this.appVersion.split("MSIE"); }

  this.appVersion = parseFloat(this.appVersion[1]);
};

docLoader.prototype.HrefRemoveFocus = function()
{
  var col = document.getElementsByTagName("A");
  var cnt = col.length;
  for (i = 0; i < cnt; i++)
  {
    if (this.isFirefox != -1) { col[i].setAttribute("onfocus", "this.blur()"); }
    else if (this.isIE != -1) { col[i].onfocus = new Function ("return this.blur()"); }
  }
};

docLoader.prototype.PNGFixLoader = function()
{
  if (this.isIE != -1 && this.appVersion >= 5.5 && this.appVersion < 7 && document.body.filters)
  {
    var imgs = document.getElementsByTagName("IMG");
    for (key in imgs)
    {
      var o = imgs[key];
      if (typeof(o) == "object")
      {
        var imgSrc = imgs[key].src;
        if (imgSrc.substring(imgSrc.length - 3, imgSrc.length).toUpperCase() == "PNG")
        {
          imgs[key].src = "./img/pix.gif";
          imgs[key].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ imgSrc +"')";
        }
      }
    }
  }
};
