
if ( typeof Eduify == "undefined"){
	Eduify = function(){};
}

Eduify.LoadStart = new function(){
    return{
        //////////////////////
        // JS Error Handler //
        //////////////////////
        ClientSideErrorHandler: function(pErr, pUrl, pLine)
        {   
            var lMsg = "Error=" + pErr + ", URL=" + pUrl + ", Line#=" + pLine;
            if(_IsRegisterAjaxPro){
                Eduify.UI.Common.AJAXMethods.LogExceptions(lMsg);
            }else{
                
                 $j.ajax({
                        type: "POST",
                        url: _AjaxPath,
                        data: '{"pMessage":"'+lMsg+'"}',
                        beforeSend: function(xhr) {
                            xhr.setRequestHeader("Ajax-Method", "LogExceptions");
                            xhr.setRequestHeader("Accept-Encoding", "gzip, deflate");
                        },
                        success: function(s) {                                                   
                        }
                    });                             
            }
        },
        WARP_Error : function(oPanel,oEvent,flags)
        {   //debugger;                     
            if(flags == 1)
            {                   
                window.location.href = "DefaultError";                    
//                oEvent.cancelBubble = true;
//                oEvent.event=null;
//                oEvent.needPostBack=false;
//                oEvent.cancel=true;
//                oEvent.cancelPostBack = true;
//                oEvent.cancelResponse = true;
//                oEvent.needAsyncPostBack = false;
//                oEvent.fullPostBack = false;   
//                oPanel.doResponse = null;
//                oPanel._doResponse = function(cb) {return false;};
//                oPanel._timer = function(id, abc) {return false;};
//                oPanel = null;
                if (typeof(ig_all)!= "undefined" && typeof(ig_all._ig_cbManager) != "undefined" && ig_all._ig_cbManager != null)                      
                {   
                    ig_all._ig_cbManager._timer = function (vals, man) {return false;};
                    ig_all._ig_cbManager = null;
                }                
            }
        }
        //$j(window).bind("onerror", function(pEvent){debugger;});
    };
}();

window.onerror = Eduify.LoadStart.ClientSideErrorHandler;
