// this site functions 
function openhelp(a, w, h) 
{w = typeof(w) != 'undefined' ? w : 200;
 h = typeof(h) != 'undefined' ? h : 450;   
window.open(a.href, 'help', "width="+w+", height="+h+",menubar=no,location=no,scrollbars=yes,resizable=no");
return false}


// loxotron js-lib
function $(id) {
	var e = document.getElementById(id);
	if (e) {
		e.show = function () { this.style.display = ''; }
		e.hide = function () { this.style.display = 'none'; }
	}
	return e;
}

function $F(id) {
	var e = document.getElementById(id);
	if (e) {return e.value;}
	return null;
}

function getElementsByClassName(node,searchClass,tag) {
	if (node.getElementsByClassName)
		return node.getElementsByClassName(searchClass);
	else {
		var classElements = new Array();
		if ( node == null ) node = document;
		if ( tag == null ) tag = '*';
        var els = node.getElementsByTagName(tag);
        var elsLen = els.length;
        var pattern = new RegExp("(^|\\s)"+searchClass+"(\\s|$)");
        for (i = 0, j = 0; i < elsLen; i++) {
			if ( pattern.test(els[i].className) ) {
				classElements[j] = els[i];
				j++;
			}
		}
		return classElements;
	}
}

function $toggle(id)
{
	var e = $(id);
	if (e.style.display != 'none')
		e.style.display = 'none';
	else
		e.style.display = '';
}

function ajaxObject(url, callbackFunction) {
  var that=this;      
  this.updating = false;
  this.abort = function() {
    if (that.updating) {
      that.updating=false;
      that.AJAX.abort();
      that.AJAX=null;
    }
  }
  this.update = function(passData,postMethod) { 
    if (that.updating) { return false; }
    that.AJAX = null;                          
    if (window.XMLHttpRequest) {              
      that.AJAX=new XMLHttpRequest();              
    } else {                                  
      that.AJAX=new ActiveXObject("Microsoft.XMLHTTP");
    }                                             
    if (that.AJAX==null) {                             
      return false;                               
    } else {
      that.AJAX.onreadystatechange = function() {  
        if (that.AJAX.readyState==4) {             
          that.updating=false;                
          that.callback(that.AJAX.responseText,that.AJAX.status,that.AJAX.responseXML);        
          that.AJAX=null;                                         
        }                                                      
      }                                                        
      that.updating = new Date();                              
      if (/post/i.test(postMethod)) {
        var uri=urlCall+'?'+that.updating.getTime();
        that.AJAX.open("POST", uri, true);
        that.AJAX.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
        that.AJAX.setRequestHeader("Content-Length", passData.length);
        that.AJAX.send(passData);
      } else {
        var uri=urlCall+'?'+passData+'&timestamp='+(that.updating.getTime()); 
        that.AJAX.open("GET", uri, true);                             
        that.AJAX.send(null);                                         
      }              
      return true;                                             
    }                                                                           
  }
  var urlCall = url;        
  this.callback = callbackFunction || function () { };
}
