function bindEvent(elementToBind, eventToBind, functionToBind){
  if(elementToBind){
  	if (elementToBind.addEventListener) elementToBind.addEventListener(eventToBind, functionToBind, false);
  	if (elementToBind.attachEvent) elementToBind.attachEvent('on'+eventToBind, functionToBind);
  }
}
function ajaxFunction(url, div, additionalFunction, el){
    var xmlHttp;
    try{xmlHttp=new XMLHttpRequest();}
    catch (e){
      try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
      catch (e){
        try{xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
        catch (e){return false;}
      }
    }
    xmlHttp.onreadystatechange = function(){
      if(xmlHttp.readyState==4){
        if(document.getElementById(div))
            document.getElementById(div).innerHTML = xmlHttp.responseText;
        if (typeof additionalFunction == "function") {
          additionalFunction(el, url.substr(url.indexOf("?")));
        }
      }
    }
    window.status = "Loading...";
    xmlHttp.open("GET" ,url ,true);
    xmlHttp.send(null);
    return false;
}
function closeFunction(e){
	e["target"] ? el = e["target"] : el = e["srcElement"];
	el.parentNode.style.display = "none";
}

if(document.getElementById("closeNotice"))
  bindEvent(document.getElementById("closeNotice"), 'click', closeFunction);if(document.getElementById("closeNotice"))
if(document.getElementById("closeError"))
  bindEvent(document.getElementById("closeError"), 'click', closeFunction);
