Event.observe(window,'load',function(){var pageDimensions=getPageSize();var pageWidth=pageDimensions[0];var pageHeight=pageDimensions[1];var left=pageWidth-120;var working=document.createElement("div");working.setAttribute('id','working');document.body.appendChild(working);$('working').update(' ');$('working').setStyle({backgroundColor:'#fff',height:'16px',top:'3px',position:'absolute',display:'none',left:left+'px',fontSize:'12px',fontFamily:'sans-serif'});var _null=document.createElement("div");_null.setAttribute('id','_null');document.body.appendChild(_null);$('_null').setStyle({display:'none',color:'#fff'});});function activity_indicator(txt){var default_root_path='../../';root_path=(root_path=='')?default_root_path:root_path;var ajax_indicator_img="";var ajax_indicator_txt=txt;var ajax_indicator="
"+ajax_indicator_img+""+ajax_indicator_txt+"
";return ajax_indicator;} var ajaxToken,post,get,ajaxError,dataUrl;ajaxToken=function(url){var dt=new Date(),dtString=''+dt.getFullYear()+dt.getMonth()+dt.getDate()+dt.getHours()+dt.getMinutes()+dt.getMilliseconds();dataUrl=url+'&token='+dtString;return dataUrl;} post=function(url,parameters,target){var makeRequest=new Ajax.Updater({success:target,failure:'ajax_error'},url,{parameters:ajaxToken(parameters)});} get=function(url,parameters,target){var makeRequest=new Ajax.Updater(target,url,{method:'get',parameters:ajaxToken(parameters),onFailure:ajaxError});} ajaxError=function(request){if(request>0)(ReturnResponseHeaders(request.status));} function autocomplete(text_field,serverHandlerFunction,clientHandlerFunction){var count=Ajax.activeRequestCount;if(count<=1){var search_result_to=text_field+'_search_results';var search=new Ajax.Autocompleter(text_field,search_result_to,parser,{paramName:'autocomplete',parameters:'function='+serverHandlerFunction,minChars:3,frequency:1.0,afterUpdateElement:clientHandlerFunction})}} function callInProgress(xmlhttp){switch(xmlhttp.readyState){case 1:case 2:case 3:return true;break;default:return false;break;}} function showFailureMessage(){} Ajax.Responders.register({onCreate:function(request){new Effect.Appear('working');$('working').update(activity_indicator('requesting...'));request['timeoutId']=window.setTimeout(function(){if(callInProgress(request.transport)){showFailureMessage();if(request.options['onFailure']){request.options['onFailure'](request.transport,request.json);}}},15000);},onLoading:function(){if($('working')){$('working').update(activity_indicator('loading...'));}},onLoaded:function(){if($('working')){$('working').update(activity_indicator('loaded'));}},onComplete:function(request){if($('working')&&Ajax.activeRequestCount==0){$('working').update(activity_indicator('complete'));new Effect.Highlight('working',{duration:2,endcolor:'#FFFFFF'});setTimeout("$(\'working\').update('')",'100');$('working').setStyle({backgroundColor:'#FFFFFF'});} window.clearTimeout(request['timeoutId']);}});function ReturnResponseHeaders(requestStatus){switch(requestStatus){case 200:result=http_request.responseText;$(target).innerHTML=result;break;case 301:alert('Resource "'+url+'" moved permanently:\n'+http_request.responseText);break;case 305:alert('Resource "'+url+'" should be accessed through a proxy \n'+http_request.responseText);case 400:alert('Bad request for: "'+url+'"');break;case 401:alert('Unauthorized access to: "'+url+'"');break;case 403:alert('Access denied to requested resource "'+url+'"');break;case 404:alert('The server has not found anything matching the Request-URI "'+url+'"');break;case 405:alert('Method not allowed:\n The method specified in the Request-Line is \n not allowed for the resource identified by the Request-URI "'+url+'"');break;case 406:alert('Not acceptable');break;case 407:alert('Proxy Authentication required');break;case 408:alert('The client did not produce a request within the time \n that the server was prepared to wait.\n Please make another request');break;case 410:alert('Gone.The requested resource is no longer available at the server \n and no forwarding address is known');break;case 411:alert('The server refuses to accept the request without a defined Content- Length');break;case 413:alert('The server is refusing to process a request because \n the request entity is larger \n than the server is willing or able to process');break;case 414:alert('The server is refusing to service the request because \n the Request-URI is longer than \n the server is willing to interpret');break;case 415:alert('The server is refusing to service the request because \n the entity of the request is in a format not \n supported by the requested resource:\n '+url+' for the requested method.');break;case 500:alert('Internal server error:\n The server encountered an unexpected condition \n which prevented it from fulfilling the request');break;case 501:alert('Not Implemented:\n The server does not support the functionality required to fulfill \n the request "'+url+'"');break;case 502:alert('Bad gateway:\n The server, while acting as a gateway or proxy, \n received an invalid response from the upstream \n server it accessed in attempting to fulfill the request.');break;case 503:alert('Service Unavailble:\n The server is currently unable to handle the request due to \n a temporary overloading or maintenance of the server');break;case 504:alert('Gateway timeout:\n The server, while acting as a gateway or proxy, \n did not receive a timely response from the upstream server \n specified by the URI: "'+url+'"');break;case 505:alert('HTTP Version not supported:\n The server does not support, or refuses to support,\n the HTTP protocol version that was used \n in the request message');break;}} function modal(srcElem){if($(srcElem)){msg_box=new Control.Modal(false,{contents:function(){return $(srcElem).innerHTML;},overlayDisplay:true,overlayCloseOnClick:false,fade:true,fadeDuration:0.3});msg_box.open();}else{alert("Element "+srcElem+" not found");}} var modal_window,modajax;open_modal_window=function(title,width,height,url,params){var prepare_modal="
"+title+"
 
";modajax=new Control.Modal(false,{contents:function(){new Ajax.Request(url,{method:'post',parameters:params,onComplete:function(request){Element.update('modal_container',prepare_modal+'
'+request.responseText+'
');new Draggable('modal_container',{handle:'modal_handle'});}.bind(this),onFailure:function(){ajaxError();}});return prepare_modal+'
loading...
';},overlayDisplay:true,overlayCloseOnClick:false,width:width,height:height,zIndex:8000,fade:true,fadeDuration:0.3});modajax.open();} var url='parser.php';var preload=function(fn,target){var fn=fn||'manage';var target=target||'application';Event.observe(window,'load',function(){application.exec(url,fn,target)});}