﻿//typeof window.XMLHttpRequest === "function"

//var xhr = new XMLHttpRequest();

////Proxies all XMLHttpRequests
//function AjaxProxy(params){
  //var myOpen = function (method, url, async, user, password){
    //this.origionalOpen(method, url, async, user, password);
  //}

  //XMLHttpRequest.prototype.origionalOpen = XMLHttpRequest.prototype.open;
  //XMLHttpRequest.prototype.open = myOpen;

  //var mySend = function(a) {
    //var xhr = this;

    //var onload = function() {
      //if (params.onload){
        //params.onload(xhr.responseText, xhr.statusText);
      //}
    //};

    //var onerror = function() { 
      //if (params.onerror){
        //params.onerror(xhr.responseText, xhr.statusText);
      //}
    //};

    //xhr.addEventListener("load", onload, false);
    //xhr.addEventListener("error", onerror, false);

    //xhr.originalSend(a);
  //}

  //XMLHttpRequest.prototype.originalSend = XMLHttpRequest.prototype.send;
  //XMLHttpRequest.prototype.send = mySend;
//}

function removeCancellationDeadline () {
  if (location.href.indexOf('RegistrationStatement')){
      $('li:contains("Cancellation")').remove();
  }
}

$(function(){
 /* AjaxProxy({*/
    //onload: function (data, status){ 
              ////$('#nameAttendeeMethodDialog a').each(function(){
                ////var href = $(this).attr('href');
                ////if (href.match(/Registration\/AttendeeWorkflowWizard.aspx/)){
                  ////$(this).remove();
                ////}
              ////});
            //}
  /*});*/
  
  removeCancellationDeadline();
  
  if (location.href.indexOf('Logout.aspx') != -1){
    location.href = "/account";
  }

 /////////////////////////////////////////////////////////////
 //Script to prevent error until 5.13 rollout
 //"Skip" step issue
 ///////////////////////////////////////////////////////////// 
  $('.wizardnav li').each(function(){
    if (!$(this).hasClass('active')){
      $(this).children().click(function(e){
        e.preventDefault();
      });
    }
  });
    
});

