var __debug=false;var __page=null;function CustomLoad(){if(__debug)ShowStatus("Running... CustomLoad");try{InnerCustomLoad()}catch(ex){}if(__debug)ShowStatus("... CustomLoad")}function InnerCustomLoad(){if(__debug)ShowStatus("Running... InnerCustomLoad");if(__debug)ShowHidden();try{SysApplicationAddLoad()}catch(ex){RaiseError(ex)}if(__debug)ShowStatus("... InnerCustomLoad")}
function SysApplicationAddLoad(){if(__debug)ShowStatus("Running... SysApplicationAddLoad");var href=document.location.href;var slash=href.lastIndexOf("/");var dot=href.lastIndexOf(".");__page=href.substring(slash+1,dot).toLowerCase();try{DefineHandlers()}catch(ex){RaiseError(ex)}try{ShowScript()}catch(ex){RaiseError(ex)}}
function DefineHandlers(){var request=Sys.WebForms.PageRequestManager.getInstance();if(request!=null){request.add_beginRequest(BeginRequestHandler);request.add_endRequest(EndRequestHandler)}}function BeginRequestHandler(sender,args){}
function EndRequestHandler(sender,args){if(__debug)ShowStatus("Running... EndRequestHandler");try{InnerEndRequestHandler(sender,args)}catch(ex){RaiseError(ex)}try{ShowError()}catch(ex){if(__debug)alert(ex);else alert("Has been an error there. Change a mode debug the scripts.js!")}if(__debug)ShowStatus("... EndRequestHandler")}
function InnerEndRequestHandler(sender,args){if(__debug)ShowStatus("Running... InnerEndRequestHandler");var message=document.getElementById("ctl00__message");if(message.value.length>0){alert(message.value);message.value=""}var src=sender._postBackSettings.sourceElement;switch(__page){default:if(__debug)throw"Non operations to ["+__page+"] page";break}if(__debug)ShowStatus("... InnerEndRequestHandler")}
function Foo(sender){var s=document.getElementById("ctl00__status");s.value+="Attributes: -----------------------\n";var list=sender._postBackSettings.sourceElement.attributes;for(var i=0;i<list.length;i++)s.value+=list[i].value+"\n"}function ShowProperties(obj){try{InnerShowProperties(obj)}catch(ex){RaiseError(ex)}}function InnerShowProperties(obj){var s=document.getElementById("ctl00__stacktrace");s.value="";for(var item in obj)s.value+=item+" : ["+typeof eval("obj."+item)+"]\n"}
function ShowEvalProperties(obj){try{InnerShowEvalProperties(obj)}catch(ex){RaiseError(ex)}}function InnerShowEvalProperties(obj){var s=document.getElementById("ctl00__stacktrace");for(var item in obj){var p=eval("obj."+item);if(typeof p!="function")try{s.value+=item+" : ["+p+"]\n"}catch(ex){RaiseError(ex)}}}
function RaiseError(ex){if(__debug){ShowStatus("Running... RaiseError");var error=document.getElementById("ctl00__error");if(error==null)throw"Non exists [_error] in MasterPage";error.value="Error in textbox: "+ex}}
function ShowError(){if(__debug){var error=document.getElementById("ctl00__error");if(error==null)throw"Non exist [_error] div element in...";if(error.value!=null){if(error.value.length>0){alert(error.value);error.value=""}}else if(error.innerText){if(error.innerText.length>0){alert(error.innerText);error.innerText=""}}else if(error.textContent){if(error.textContent.length>0){alert(error.textContent);error.textContent=""}}else{ShowEvalProperties(error);throw"Troubles with [error] object in property";
}}}function ClosePopup(obj){try{InnerClosePopup(obj)}catch(ex){RaiseError(ex)}}function InnerClosePopup(obj){obj.parentElement.style.display="none"}function ShowHidden(){if(__debug)ShowStatus("Running... ShowHidden");try{InnerShowHidden()}catch(ex){RaiseError(ex)}if(__debug)ShowStatus("... ShowHidden")}
function InnerShowHidden(){if(__debug)ShowStatus("Running... InnerShowHidden");var h=document.getElementById("_hidden");if(h==null)throw"Where is [_hidden] div in MasterPage? Reload it!";h.style.display="block";if(__debug)ShowStatus("... InnerShowHidden")}function ShowScript(){var s=document.getElementById("ctl00__script");if(s==null)throw"Where is [_script] input in MasterPage? Reload it!";if(s.value.length>0)eval(s.value)}
function ShowStatus(msg){var s=document.getElementById("ctl00__status");s.value+=msg+"\n"};

