function isDefined(x) {
  return x!=null && typeof(x)!="undefined";
}
function getFromSelection(sel,delim) {
	var len=sel.length;
	var names="";
	for(i=0;i<len;i++) {
		var option=sel.options[i];
		var uname=option.value;
		names=names+uname+delim;
	}
	return names;
}

function removeSelected(sel) {
	for(index=0;index<sel.length;index++) {
		if(sel.options[index].selected==true) {
			sel.options[index]=null;
			index--;	// to compensate array shifting
		}
	}
}
function removeAllItems(sel) {
	for(index=0;index<sel.length;index++) {
        sel.options[index]=null;
        index--;	// to compensate array shifting
	}
}
function addToSelection(sel,s) {
  addToSelection2(sel,s,s);
}
function addToSelection2(sel,n,v) {
    if(typeof(v)=="undefined") return;
    if(typeof(v)=="string") {
      v=trim(v);
	  if(v.length==0) return;
    }
    if(typeof(n)=="undefined") return;
    if(typeof(n)=="string") {
      n=trim(n);
	  if(n.length==0) return;
    }
    var len=sel.length;
    sel.options[len]=new Option(n,v);
}
function trimZeroes(strText) {
    // this will get rid of leading zeroes
    while (strText.substring(0,1) == '0')
        strText = strText.substring(1, strText.length);
    return strText;
}

function trim(strText) {
    // this will get rid of leading spaces
    while (strText.length>0 && strText.charAt(0) == ' ')
        strText = strText.substring(1, strText.length);

    // this will get rid of trailing spaces
    while (strText.charAt(strText.length-1) == ' ')
        strText = strText.substring(0, strText.length-1);

   return strText;
}


function selectionToFieldNoEmpty(selection,emptyMarker) {
    if(selection.length==0) {
      return emptyMarker;
    }
    return selectionToField(selection);
}

function selectionToField(selection) {
	var len=selection.length;
	var names="";
	for(i=0;i<len;i++) {
		var option=selection.options[i];
		var uname=option.value;
		var names=names+uname+"~";
	}
	return names;
}
function getMailFieldFromSelection(sel) {
  var s="";
  for(var i=0;i<sel.length;i++) {
    if(i>0) {
      s=s+", ";
    }
    s=s+sel.options[i].value;
  }
  return s;
}
function isValidInteger(s) {
  var i=parseInt(s);
  return !isNaN(i);
}
//select the option with the given value
function selectOption(selection,value) {
	var len=selection.length;
	for(i=0;i<len;i++) {
		var option=selection.options[i];
		if(option.value==value) {
		  selection.selectedIndex=i;
          return;
		}
	}
}

function getSelectedValue(selection) {
  return selection.options[selection.selectedIndex].value;
}

function hasOptions(sel) {
	if (sel != null && sel.options != null) {
		return true;
	}
	return false;
}

function _sortOptions(sel){
	var o = new Array();
	if (!hasOptions(sel)) {
		return;
	}
	for (var i = 0; i < sel.options.length; i++) {
		o[o.length] = new Option(sel.options[i].text, sel.options[i].value, sel.options[i].defaultSelected, sel.options[i].selected);
	}
	if (o.length == 0) {
		return;
	}
	o = o.sort(
			function(a, b) {
				if ((a.text + "") < (b.text + "")) {
					return -1;
				}
				if ((a.text + "") > (b.text + "")) {
					return 1;
				}
				return 0;
			});
	for (var i = 0; i < o.length; i++) {
		sel.options[i] = new Option(o[i].text, o[i].value, o[i].defaultSelected, o[i].selected);
	}
	return true;
}

function _transferOptions(field1, field2, sort, type, selectItems, reset){
	var doAll = (type == "all") ? true : false;

	// clear the select box
	if( reset ) field2.length = 0;

	for( var i=0; i < field1.length; i++ ){
		// if the current option is selected, move it
		if( doAll || field1.options[i].selected ){
            var text=field1.options[i].text;
            var value=field1.options[i].value;
            var option=new Option(text, value, false, selectItems)

            if(sort) {
                var inserted=false;
                for(var j=0;j<field2.length && !inserted;j++) {
                    if(text<field2.options[j].text) {
                        // shifts all remaining options down by one
                        field2.options[field2.length]=new Option();
                        for(var k=field2.length-1;k>j;k--) {
                            field2.options[k].text=field2.options[k-1].text;
                            field2.options[k].value=field2.options[k-1].value;
                        }
                        field2.options[j]=option;
                        inserted=true;
                    }
                }
                if(!inserted) {
                    // this must be the last
                    field2.options[field2.length]=option;
                }
            }
            else {
                field2.options[field2.length]=option;
            }

			field1.options[i] = null;
			i--; // since you just deleted a option, redo this array position next loop
		}
	}

	return true;
}


// moves the selected options in selsrc (a selection form element) to seldest
function moveSelectionItems(selsrc,seldest) {
  _transferOptions(selsrc,seldest,true,"selected",true,false);
}

function selectAllOptions(sel) {
  for(index=0;index<sel.length;index++) {
    sel[index].selected=true;
  }
}

// removes all the options in destsel that exist in srcsel
function purgeOptions(srcsel,destsel) {
//      for(s=0;s<srcsel.length;s++) {
//        var sv=srcsel[s].value;
//        var ok=false;
//        for(d=0;d<destsel.length && !ok;d++) {
//            var dv=destsel[d].value;
//            if(dv==sv) {
//              destsel[d]=null;
//              d--;
//              ok=true;
//            }
//        }
//    }

  for(d=0;d<destsel.length;d++) {
    var dv=destsel[d].value;
    var ok=true;
    for(s=0;s<srcsel.length && ok;s++) {
      var sv=srcsel[s].value;
      if(dv==sv) {
        destsel[d]=null;
        d--;
        ok=false;
      }
    }
  }
}

function getEmailAddresses(s) {
 var addresses=new Array();
 var ai=0;
 var address="";
 var inQuotes=false;
 for(var i=0;i<s.length;i++) {
  var c=s.charAt(i);
  var add=true;
  if(c=='"' || c=='\'') {
   inQuotes=!inQuotes;
  }
  else if(inQuotes && c=='>') {
   // sometimes a ' is used as normal apostrophe rather than for quotes.
   // make sure that we catch the end of this address.
   // > is rarely used in quotes....
   inQuotes=false;
  }
  else if(c==',' || c==';') {
   if(!inQuotes) {
     address=trim(address);
     if(address.length>0) {
       addresses[ai]=address;
       ai++;
     }
     address="";
     add=false;
   }
  }
  if(add) {
   address+=c;
  }
 }
 address=trim(address);
 if(address.length>0) addresses[ai]=address;
 return addresses;
}

function plainToHtml(plain) {
  var txt=plain;
  //this line replaces all double line breaks with a "<p></p>"
  //it also adds a <p> to the beginning and the </p> to the end
  //   \r\n stands for a line break, and \s stands for any empty space
  txt="<p>"+txt.split(/\r\n(\s+)?\r\n/).join("</p><p>")+"</p>";
  //this line replaces all line breaks with a <br>
  txt=txt.split("\n").join("<br>");
  //this line replaces the links
  txt=txt.replace(/((http:\/\/)|(www))\.[^\s]+/gi,function(p1){return "<a href=\""+p1+"\">"+p1+"</a>";});
  //this line replaces all remaining line breaks with an empty space
  txt=txt.replace(/(\r|\n|\r\n)/gi,"");
  //this line adds a line breaks between each paragraph
  txt=txt.split("</p><p>").join("</p>\r\n<p>");

  txt=txt.replace(/&/gi,"&amp;");
  txt=txt.replace(/"/gi,"&quot;");
  //this just outputs the new text
  return txt;
}
function htmlToPlain(html) {
  var s=html;
  var inTag=false;
  s=s.replace(/<\/[ ]*p>/gi, "\n");
  s=s.replace(/<p[ ]*\/>/gi, "\n");
  s=s.replace(/<br>/gi, "\n");
  s=s.replace(/<br[ ]\/>/gi, "\n");
  s=s.replace(/&quot;/gi, "\"");
  s=s.replace(/&amp;/gi, "&");
  s=s.replace(/<\/li>/gi, "\n");
  s=s.replace(/<li>/gi, "- ");
  s=s.replace(/&nbsp;/gi, " ");
  var r="";
 for(var i=0;i<s.length;i++) {
  var c=s.charAt(i);
  if(c=='<' && !inTag) {
   inTag=true;
  }
  else if(c=='>' && inTag) {
   inTag=false;
  }
  else if(!inTag) {
   r+=c;
  }
 }
  r=r.replace(/&lt;/gi, "<");
  r=r.replace(/&gt;/gi, ">");
 return r;
}
function escapeHTML(s) {
  s=s.replace(/\&/gi, "&amp;");
  s=s.replace(/</gi, "&lt;");
  s=s.replace(/>/gi, "&gt;");
  s=replace2(s,"'","&quot;",true);
 return s;
}
function getWindowInnerWidth(win) {
if (document.all) return win.document.body.clientWidth;
else return window.innerWidth;
}
function getWindowInnerHeight(win) {
if (document.all) return win.document.body.clientHeight;
else return window.innerHeight;
}
function getElementTop(eElement)
{
    var nTopPos = eElement.offsetTop;            // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element
    while (eParElement != null)
    {                                            // move up through element hierarchy
        nTopPos += eParElement.offsetTop;        // appending top offset of each parent
        eParElement = eParElement.offsetParent;  // until no more offset parents exist
    }
    return nTopPos;                              // return the number calculated
}
function getElementLeft(eElement)
{
    var nLeftPos = eElement.offsetLeft;            // initialize var to store calculations
    var eParElement = eElement.offsetParent;     // identify first offset parent element
    while (eParElement != null)
    {                                            // move up through element hierarchy
        nLeftPos += eParElement.offsetLeft;        // appending top offset of each parent
        eParElement = eParElement.offsetParent;  // until no more offset parents exist
    }
    return nLeftPos;                              // return the number calculated
}
function selectOptionByValue(sel,val) {
  for(index=0;index<sel.length;index++) {
    if(sel[index].value==val) {
      sel[index].selected=true;
    }
  }
}
// a string replace that works even with special regex chars in the target
function replace2(src,target,rep,global) {
  target=target.replace(/\\/g,"\\\\");
  target=target.replace(/\*/g,"\\*");
  target=target.replace(/\^/g,"\\^");
  target=target.replace(/\$/g,"\\$");
  target=target.replace(/\+/g,"\\+");
  target=target.replace(/\?/g,"\\?");
  target=target.replace(/\./g,"\\.");
  target=target.replace(/\(/g,"\\(");
  target=target.replace(/\[/g,"\\[");
  target=target.replace(/\{/g,"\\{");
  target=target.replace(/\)/g,"\\)");
  target=target.replace(/\]/g,"\\]");
  target=target.replace(/\}/g,"\\}");
  target=target.replace(/\|/g,"\\|");
  var c=(global?"g":"");
  var regex=new RegExp(target,c);
  var res=src.replace(regex,rep);
//  alert("src: "+src+"\ntarget: "+target+"\nrep: "+rep+"\nres: "+res);
  return res;
}
function endsWith(s,s1) {
  var n=s.lastIndexOf(s1);
  return (n!=-1 && n==(s.length-s1.length));
}
function confirmAndGo(msg,url) {
if(confirm(msg)) {
 window.location=url;
}
}

var debugWindow=null;
function openDebug() {
  debugWindow=window.open("","debug","toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,width=700,height=500");
  debugWindow.document.writeln("<input type=button value='Clear' onclick='document.getElementById(\"divtext\").innerHTML=\"\"'/><br/><div id='divtext'></div>");
}
function debug(txt) {
if(debugWindow!=null) {
  if(typeof txt != "string") {
    txt=new String(txt);
  }
  txt=escapeHTML(txt);
  debugWindow.document.getElementById("divtext").innerHTML=debugWindow.document.getElementById("divtext").innerHTML+txt+"<br/>";
}
}

function getFirstChildElement(el,tagName) {
 return getNthChildElement(el,tagName,1);
}

function getNthChildElement(el,tagName,n) {
debug("getn: "+n);
var c=el.childNodes;
//debug('children: '+c.length);
for(var i=0;i<c.length;i++) {
  var ce=c[i];
//  debug(ce.nodeType+' , '+ce.tagName);
  if(ce.nodeType==1) {
    if(ce.tagName.toLowerCase()==tagName.toLowerCase() && ((--n) == 0)) return ce;
    debug("cec: "+ce.className);
    var sub=getNthChildElement(ce,tagName,n);
    if(sub!=null) {
       return sub;
    }
  }
}
  return null;
}

/** get the first element in the document that has the given name */
function getFirstElementByName(name) {
 var coll=document.getElementsByName(name);
 return coll.item(0);
}

/** get an Array of all the children nodes of el whose tagName is the given one (tr, td, etc).
* This is NOT recursive.
*/
function getChildElementsNotRecursive(el,tagName) {
var arr=new Array();
var c=el.childNodes;
for(var i=0;i<c.length;i++) {
  var ce=c[i];
  if(ce.nodeType==1) {
    if(ce.tagName.toLowerCase()==tagName.toLowerCase()) {
      arr[arr.length]=ce;
    }
  }
}
return arr;
}

function getChildElementsByCriterium(el,criteriumFunc) {
    var arr=new Array();
    getChildElementsInternal(el,criteriumFunc,arr);
    return arr;
}

/** get an Array of all the children nodes of el whose tagName is the given one (tr, td, etc).
* This is recursive. If a child is of class "excludechildren", the recursion does not explore the children of that element.
* for a non-recursive version, just use el.getElementsByTagName(name)
*/
var getChildElements_crit_tagName;
function getChildElements_crit(ce) {
    return ce.tagName.toLowerCase()==getChildElements_crit_tagName.toLowerCase();
}
function getChildElements(el,tagName) {
    getChildElements_crit_tagName=tagName;
    return getChildElementsByCriterium(el,getChildElements_crit);
}

function getChildElementsInternal(el,criteriumFunc,arr) {
var c=el.childNodes;
for(var i=0;i<c.length;i++) {
  var ce=c[i];
  if(ce.nodeType==1) {
      if(criteriumFunc(ce)) {
          arr[arr.length]=ce;
      }
      if(ce.className!="excludechildren") {
        getChildElementsInternal(ce,criteriumFunc,arr);
      }
  }
}
return arr;
}

/** Class to attach multiple event handlers to an event */
function EventManager() {}
EventManager.onLoadHandlers=new Array();
EventManager.onUnloadHandlers=new Array();
EventManager.onResizeHandlers=new Array();
EventManager.onDocumentClickHandlers=new Array();


/** set the given fun event handler to be called on the document.onclick event. fun can take an event as parameter */
EventManager.addOnDocumentClick = function(fun) {
  EventManager.onDocumentClickHandlers[EventManager.onDocumentClickHandlers.length]=fun;
}
/** set the given fun event handler to be called on the onload event. fun can take an event as parameter */
EventManager.addOnLoad = function(fun) {
  EventManager.onLoadHandlers[EventManager.onLoadHandlers.length]=fun;
//  for(i=0;i<EventManager.onLoadHandlers.length;i++)
//    debug("onload "+i+": "+EventManager.onLoadHandlers[i]);
}
/** set the given fun event handler to be called on the onresize event. fun can take an event as parameter */
EventManager.addOnResize = function(fun) {
  EventManager.onResizeHandlers[EventManager.onResizeHandlers.length]=fun;
}

/** set the given fun event handler to be called on the onunload event. fun can take an event as parameter */
EventManager.addOnUnload = function(fun) {
  EventManager.onUnloadHandlers[EventManager.onUnloadHandlers.length]=fun;
}

EventManager.on=function(hdl,ev) {
for(var i=0;i<hdl.length;i++) {
  hdl[i](ev);
}
}

window.onload = function(ev) {
  EventManager.on(EventManager.onLoadHandlers,ev);
}
window.onresize = function(ev) {
  EventManager.on(EventManager.onResizeHandlers,ev);
}
window.onunload = function(ev) {
  EventManager.on(EventManager.onUnloadHandlers,ev);
}
document.onclick = function(ev) {
  EventManager.on(EventManager.onDocumentClickHandlers,ev);
}

/** Prints the given String on the debug window, also displaying the code of every character */
function sdebug(txt) {
  debug(txt);
  for(var i=0;i<txt.length;i++) {
    debug(i+" "+txt.charAt(i)+" : "+txt.charCodeAt(i));
  }
}
/** Hides the elemnt whose ID is s */
function hide(s) {
  document.getElementById(s).style.display="none";
}

/** Shows the elemnt whose ID is s */
function show(s) {
  document.getElementById(s).style.display="";
}

/** grows the height of a given html element by adding <br> tags until its height is equal or just above the set value */
function growHTMLHeight(el,h) {
var eh=el.offsetHeight;
var i=50;
alert(1);
while(eh<h && i>0) {
  debug("eh: "+eh);
  el.innerHTML=el.innerHTML+i+"<br>";
  eh=el.offsetHeight;
  i--;
}
}

/** Get the keycode for the given event, cross-browser */
function getEventKeyPressed(evt) {
  if (evt) {
    var charCode = ((evt.keyCode) ? evt.keyCode :
                   ((evt.which) ? evt.which : 0));
    return charCode;
  }
  return 0;
}

/** Get the target of the given event, cross-browser */
function getEventTarget(e) {
 var targ;
 if (!e) var e = window.event;
 if (e.target) targ = e.target;
 else if (e.srcElement) targ = e.srcElement;
 if (targ.nodeType == 3) // defeat Safari bug
	targ = targ.parentNode;
 return targ;
}

/** Add a row to the table's body.
* @return the row element
*/
function addTableRow(table) {
  if(table.tBodies.length==0) {
    var tbody=document.createElement("tbody");
    table.appendChild(tbody);
  }
  var tr=table.tBodies[0].appendChild(document.createElement('tr'));
  return tr;
}

/** Add a td to the given row. The innerHTML of the td is set according to the html parameter.
* @return the td element
*/
function addTableRowCell(row,html) {
//    debug("TD: "+html);
  var td=row.appendChild(document.createElement('td'));
//  var tn= document.createTextNode(html);
//  td.appendChild(tn);
  td.innerHTML=html;
  return td;
}
function addTableRowHeading(row,html) {
//    debug("TH: "+html);
  var th=row.appendChild(document.createElement('th'));
//  var tn= document.createTextNode(html);
//  td.appendChild(tn);
  th.innerHTML=html;
  return th;
}

// warning! removeChild() has a memory leak in IE - cleared only when the page is unloaded. It is dangerous for pages that can stay loaded for a long time. */
function discardElement(element) {
    var garbageBin = document.getElementById('IELeakGarbageBin');
    if (!garbageBin) {
        garbageBin = document.createElement('DIV');
        garbageBin.id = 'IELeakGarbageBin';
        garbageBin.style.display = 'none';
        document.body.appendChild(garbageBin);
    }

    // move the element to the garbage bin
    garbageBin.appendChild(element);
    garbageBin.innerHTML = '';
}

function purgeEventHandlers(obj) {
    if(obj) {
        var a = obj.attributes, i, l, n;
        if (a) {
            l = a.length;
            for (i = 0; i < l; i += 1) {
                n = a[i].name;
                if (typeof obj[n] === 'function' && n.substr(0,2)=="on") {
                    debug("purge2:"+obj.tagName+" "+obj[n]);
                    obj[n] = null;
                }
            }
        }
        a = obj.childNodes;
        if (a) {
            l = a.length;
            for (i = 0; i < l; i += 1) {
                purgeEventHandlers(obj.childNodes[i]);
            }
        }
    }
}
function deleteTableRowCell(cell) {
  purgeEventHandlers(cell);
  discardElement(cell);
//  cell.parentNode.removeChild(cell);
}
function deleteTableRow(row) {
  purgeEventHandlers(row);
  discardElement(row);
//  row.parentNode.removeChild(row);
}
function clearTableBody(table) {
  if(table.tBodies.length>0) {
    var nrows=table.tBodies[0].rows.length;
    for(var i=0;i<nrows;i++) {
      deleteTableRow(table.tBodies[0].rows[0]);
    }
  }
}

function getTableRow(table,index) {
  return table.tBodies[0].childNodes[index];
}

function getTableRowCell(row,index) {
  return row.childNodes[index];
}

function setTableCellHtml(table,row,col,html) {
  var rowe=getTableRow(table,row);
  var celle=getTableRowCell(rowe,col);
  celle.innerHTML=html;
  return celle;
}

function arrayContains(arr,value) {
  for(var i=0;i<arr.length;i++) {
    if(arr[i]==value) {
      return true;
    }
  }
  return false;
}

function getMaxColWidth(table) {
var row=getFirstChildElement(table,"tr");
var n=0;
var l=row.childNodes.length;
for(var i=0;i<l;i++) {
  var m=row.childNodes[i].offsetWidth;
  if(m>n) n=m;
}
return n;
}

function compareNum(n1,n2) {
  if(n1==n2) return 0;
  if(n1>n2) return 1;
  return -1;
}
function compareDates(year1,month1,day1,year2,month2,day2) {
  var c=compareNum(year1,year2);
  if(c!=0) return c;
  c=compareNum(month1,month2);
  if(c!=0) return c;
  c=compareNum(day1,day2);
  return c;
}

function removepx(s) {
  if(!((typeof s)=="string")) {
    s=new String(s);
  }
  if(s.indexOf("px")!=-1) {
    s=s.substring(0,s.indexOf("px"));
  }
  alert(s);
  if(s=="") {
    alert("zero");
    s="0";
  }
  return s;
}
function gebid(s) {
  return document.getElementById(s);
}
function isSafari() {
  return navigator.userAgent.toLowerCase().indexOf("safari")!=-1;
}
function isIe() {
  return navigator.userAgent.toLowerCase().indexOf("msie")!=-1;
}
function isGecko() {
  return navigator.userAgent.toLowerCase().indexOf("gecko")!=-1;
}
function showHourglass() {
  //document.body.style.cursor = "wait";
  document.documentElement.style.cursor = 'wait';
}
function hideHourglass() {
//  document.body.style.cursor = "default";
  document.documentElement.style.cursor = '';
}
function closeOpenerIfTop() {
  var o=window.opener;
  if(o && o!=null && o==o.top) {
    o.close();
  }
}
// selects a range of text in a text/textarea input field
function setSelRange(inputEl, selStart, selEnd) {
 if (inputEl.setSelectionRange) {
  inputEl.focus();
  inputEl.setSelectionRange(selStart, selEnd);
 } else if (inputEl.createTextRange) {
  var range = inputEl.createTextRange();
  range.collapse(true);
  range.moveEnd('character', selEnd);
  range.moveStart('character', selStart);
  range.select();
 }
}

/** Utility to change the display property of a stylesheet rule based on whether a checkbox is checked or not.
* The styleIndex is the index in the document of the <style> where the rule with index ruleIndex will be changed
*/
function showHideByRule(cbox,styleIndex,ruleIndex) {
    var show=cbox.checked;
    var rules = document.styleSheets[styleIndex].cssRules||document.styleSheets[styleIndex].rules ;
    if(show) {
        rules[ruleIndex].style.display="";
    }
    else {
        rules[ruleIndex].style.display="none";
    }
}
function noop() {}


function startsWith(s,part) {
  if(s.length>part.length) {
    var ss=s.substr(0,part.length);
    return ss==part;
  }
  return false;
}

var util_themeResBase;
function setThemeResBase(s) {
    util_themeResBase=s+'/';
}
function themeRes(uri) {
    return util_themeResBase+uri;
}


function show_props(obj, obj_name) {
   var result = "";
   for (var i in obj)
      result += obj_name + "." + i + " = " + obj[i] + "\n";
   return result;
}



var debugWindow2=null;
var debug2Flags=new Object();
function setDebugFlag(flag,enable) {
    debug2Flags[flag]=enable;
}
function openDebug2() {
  debugWindow2=window.open("","debug","toolbar=0,location=0,directories=0,menubar=0,scrollbars=1,resizable=1,width=700,height=500");
  debugWindow2.document.writeln("<input type=button value='Clear' onclick='document.getElementById(\"divtext\").innerHTML=\"\"'/><br/><div id='divtext'></div>");
}
var debug2Time;
function debug2(/*flag,*/txt) {
if(debugWindow2!=null /*&& debug2Flags[flag]*/) {
  if(typeof txt != "string") {
    txt=new String(txt);
  }

  if(debug2Time) {
      var d=new Date();
      txt=d.getSeconds()+'.'+d.getMilliseconds()+" - "+txt;
  }
  txt=escapeHTML(txt);
  debugWindow2.document.getElementById("divtext").innerHTML=debugWindow2.document.getElementById("divtext").innerHTML+txt+"<br/>";
}
}

/** DWR has the bad habit of catching js errors in calback functions on displaying them in an alert.
 This handler will log them in debug, including filename and linenumber */
function dwrErrorHandler(e,msg) {
    debug("Error in dwr callback. Type:"+e.name+" Desc:"+e.message+" File:"+e.fileName+" Line:"+e.lineNumber+"\n"+e.stack);
}

debug2Time=true;

//openDebug();
//openDebug2();

