var mh_Page = function() {};

mh_Page.prototype.path = $("base")[0].href;
mh_Page.prototype.init = new Array();

mh_Page.prototype._init = function() {
  var start = 0;
  var end = mh_home.init.length;
  while(start < end) {
    try {
      mh_home.init[start]();
    } catch(e) {
      
    }
    
    ++start;
  }
  
  $("a.external").click(function() {
    window.open($(this)[0].href);
    
    return false;
  });
  
  mh_home.highlight("input[type=text],input[type=password],select,textarea", "focus");
};

mh_Page.prototype.highlight = function(elem, action) {
/*  switch(action) {
    case 'focus':
      $(this).focus(function() {
        $(this).addClass("highlight");
      });

      $(this).blur(function() {
        $(this).removeClass("highlight");
      });
      break;
    
    case 'hover':
      $(elem).hover(function() {
        $(this).addClass("highlight");
      }, function() {
        $(this).removeClass("highlight");
      });
      break;
  }*/
};

mh_Page.prototype.addEventOnWindowLoad = function(funtion) {
  mh_home.init[mh_home.init.length] = funtion;
}


var mh_home = new mh_Page();

window.onload = mh_home._init;