function addEvent(a,b,c,d){if(a.addEventListener){a.addEventListener(b,c,d);return true}else if(a.attachEvent)return a=a.attachEvent("on"+b,c);else{a["on"+b]=c;return false}}function setstatus(a){window.status=a;return true}function resetstatus(){window.status="Done"} function pop_up_window(a,b,c,d,e){if(typeof c=="undefined")c=750;if(typeof d=="undefined")d=550;var f=(screen.width-c)/2,g=(screen.height-d)/2;if(typeof e=="undefined")e="scrollbars=yes, status=yes, resizable=yes, menubar=yes";e="width="+c+", height="+d+", left="+f+", top="+g+", "+e;opened=window.open(a,b,e);opened.focus();if(typeof openedWindows=="undefined")openedWindows=new Array(opened);else openedWindows.push(opened);return false} function toggle_display_by_id(a,b,c,d){if(document.getElementById(b).style.display==""){document.getElementById(a).innerHTML=d;document.getElementById(b).style.display="none"}else{document.getElementById(a).innerHTML=c;document.getElementById(b).style.display=""}return false} function toggle_clickopen(a,b,c){if(!(clickdiv=document.getElementById("clickdiv_"+a))||!(clickimg=document.getElementById("clickimg_"+a))){alert("ID "+a+" not found!");return false}if(typeof b=="undefined")b=document.getElementById("clickdiv_"+a).style.display!="none";if(typeof c=="undefined")c="";if(b){clickdiv.style.display="none";clickimg.src=imgpath_expand}else{clickdiv.style.display=c;clickimg.src=imgpath_collapse}return false} function textarea_replace_selection(a,b,c){textarea_wrap_selection(a,b,"",1,c)} function textarea_wrap_selection(a,b,c,d,e){e=e||document;var f={element:a,before:b,after:c,replace:d,target_document:e};if(!b2evo_Callbacks.trigger_callback("wrap_selection_for_"+a.id,f)){if(window.opener&&window.opener.b2evo_Callbacks&&typeof window.opener.b2evo_Callbacks!="undefined")if(window.opener.b2evo_Callbacks.trigger_callback("wrap_selection_for_"+a.id,f))return;if(e.selection){a.focus();sel=e.selection.createRange();sel.text=d?b+c:b+sel.text+c;a.focus()}else if(a.selectionStart||a.selectionStart== "0"){e=a.selectionStart;f=a.selectionEnd;var g,h;if(a.type=="textarea"&&typeof a.scrollTop!="undefined"){g=a.scrollTop;h=a.scrollLeft}if(d){a.value=a.value.substring(0,e)+b+c+a.value.substring(f,a.value.length);b=e+b.length+c.length}else{a.value=a.value.substring(0,e)+b+a.value.substring(e,f)+c+a.value.substring(f,a.value.length);b=f+b.length+c.length}if(typeof g!="undefined"){a.scrollTop=g;a.scrollLeft=h}a.focus();a.selectionStart=b;a.selectionEnd=b}else{a.value+=b+c;a.focus()}}} function toggle_filter_area(a){if(!(clickdiv=document.getElementById("clickdiv_"+a))||!(clickimg=document.getElementById("clickimg_"+a))){alert("ID "+a+" not found!");return false}if(hide=document.getElementById("clickdiv_"+a).style.display!="none"){clickdiv.style.display="none";clickimg.src=imgpath_expand;asyncRequest(htsrv_url+"async.php?collapse="+a)}else{clickdiv.style.display="block";clickimg.src=imgpath_collapse;asyncRequest(htsrv_url+"async.php?expand="+a)}return false} function asyncRequest(a){if(window.XMLHttpRequest)req=new XMLHttpRequest;else if(window.ActiveXObject)req=new ActiveXObject("Microsoft.XMLHTTP");if(req){swapSection("...");req.onreadystatechange=asyncResponseHandler;req.open("GET",a,true);req.setRequestHeader("content-type","application/x-www-form-urlencoded");req.send("dummy")}else swapSection("Your browser does not seem to support XMLHttpRequest.");return false} function asyncResponseHandler(){if(req.readyState==4)req.status==200?swapSection(req.responseText):swapSection("There was a problem retrieving the XML data:\n"+req.statusText)}function swapSection(a){var b=document.getElementById("asyncResponse");if(b)b.innerHTML=a}function b2evo_Callbacks(){this.eventHandlers=[]} b2evo_Callbacks.prototype={register_callback:function(a,b){if(typeof this.eventHandlers[a]=="undefined")this.eventHandlers[a]=[];this.eventHandlers[a][this.eventHandlers[a].length]=b},trigger_callback:function(a){if(typeof this.eventHandlers[a]=="undefined")return null;for(var b=false,c="",d=1;d<arguments.length;d++)c+="cb_arguments["+d+"], ";if(c.length)c=c.substring(0,c.length-2);for(d=0;d<this.eventHandlers[a].length;d++)b=eval("f("+c+");")||b;return b}};b2evo_Callbacks=new b2evo_Callbacks;