var HTTP = {
  init : false,
  GetVars: new Array(),
  __construct : function() {
    var uri = window.location.href;
    if(uri.indexOf('?') == -1)
      return false;
    var parts = uri.split('?');
    var xv = parts[1].split('&');
    for(var i=0; i < xv.length; i++) {
      var get = xv[i].split('=');
      HTTP.GetVars[get[0]] = get[1];
    }

    this.init = true;
  },
  GET : function(v) {
    if(this.init == false)
      this.__construct();
    if(!this.GetVars[v])
      return false;
    return this.GetVars[v];
  }
}

showFormErrors = function(){
  if(HTTP.GET("form_errors")){
    document.getElementById('error').innerHTML = "Correct the errors below:<br/><ul><li>" + unescape(HTTP.GET("form_errors")).split("__N__").join("</li><li>") + "</li></ul>";
  }
}

