var ajaxDebug='';var ajaxData='';var ajax_actions;function GetXmlHttpObject(){var xmlHttp=null;try{xmlHttp=new XMLHttpRequest()}catch(e){try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP")}catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP")}}return xmlHttp}function AjaxSend(state_change,method,url,postdata){var xmlhttp=GetXmlHttpObject();xmlhttp.open(method,url);xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4)state_change(xmlhttp)};xmlhttp.send(postdata)}function GrabForm(form){var e,f_el,f_length,value;if(form==undefined)form=document.forms[0];for(var i=0;i<form.elements.length;i++){e=form.elements[i];if((e.type=='checkbox')||(e.type=='radio')){if(e.checked)ajaxData+=e.name+'='+encodeURIComponent(e.value)+'&'}else if((e.type!='button')&&(e.type!='submit')&&(e.type!='file')&&(e.value!=undefined)){ajaxData+=e.name+'='+encodeURIComponent(e.value)+'&'}}}function AjaxSendForm(script,assign,form,callback){if(form!=null)GrabForm(form);if(assign!=undefined)ajaxData+='ajax='+assign+'&';var xmlhttp=GetXmlHttpObject();xmlhttp.open('post',script);xmlhttp.onreadystatechange=function(){if(xmlhttp.readyState==4){var result=AjaxAutoResponse(xmlhttp);if(callback!=null)callback(result)}};xmlhttp.setRequestHeader('Content-Type','application/x-www-form-urlencoded');xmlhttp.send(ajaxData)}var AjaxAutoResponse_Output='';function AjaxAutoResponse(xmlhttp){AjaxAutoResponse_Output=xmlhttp.responseText;ajaxDebug=xmlhttp.responseText;var f_el=document.getElementsByTagName('tr');f_length=f_el.length;for(j=0;j<f_length;j++){if(f_el[j].className=='formError'){f_el[j].className='';var n=document.getElementById(f_el[j].id+'_e');if(n!=undefined)n.innerHTML='';o=document.getElementById(f_el[j].id+'_o');if(o!=undefined)o.style.display=''}}ajax_actions=xmlhttp.responseText.split('\n');return AjaxActionRun()}function AjaxActionRun(){var e,s,o,n;var result='';while(ajax_actions.length>0){s=ajax_actions[0];ajax_actions.splice(0,1);c=s.substr(0,2);v=s.substr(3);v=v.replace('\\n','\n');v=v.replace('\\\\','\\');if(c=='ev'){v=v.split('|');e=document.getElementById(v[0]);if(e!=undefined)e.className='formError';o=document.getElementById(v[0]+'_o');if(o!=undefined)o.style.display='none';n=document.getElementById(v[0]+'_e');if(n!=undefined)n.innerHTML=v[1]}else if(c=='js')eval(v);else if(c=='eb')alert(v);else if(c=='mb')alert(v);else if(c=='rs')result+=v;else if(c=='rd')if(v=='')window.location.reload();else window.location.href=v;else if((c!='')||(v!='')){window.alert('Unexpected Output of Ajax Script:\n\n'+AjaxAutoResponse_Output);return null}}return result}