var domLoadedFunctionList=new Array();
  var domLoaded=false;

  function callWhenDOMLoaded(func) {
   if (domLoaded) {
    func();
   } else {
    domLoadedFunctionList.push(func);
   }
  }
  
  function domLoadedEvent() {
   domLoaded=true;
   // quit if this function has already been called
       if (arguments.callee.done) return;
 
       // flag this function so we don't do the same thing twice
       arguments.callee.done = true;
    
    for (var i=0;i<domLoadedFunctionList.length;i++) {
     domLoadedFunctionList[i]();
    }
  }
  
   /* for Mozilla */
   if (document.addEventListener) {
       document.addEventListener("DOMContentLoaded", domLoadedEvent, null);
   }
 
   /* for Internet Explorer */
   /*@cc_on @*/
   /*@if (@_win32)
       //document.write("<script defer src="+baseurl+"/js/ie_onload.js><"+"/script>");
   /*@end @*/
 
   /* for other browsers */
   window.onload = domLoadedEvent;
   
   function createPopUpLink(element) {
    element.target='_blank';
    element.title+=" [opens in a new window]";
}
   
   function initPopupLinks() {
    var aTags=document.getElementsByTagName('a');
    for (var i=0;i<aTags.length;i++) {
     if (aTags[i].className.indexOf("newWindow")!=-1) {
      createPopUpLink(aTags[i]);
     }
     
    //alert(aTags[i].className+" "+aTags[i].className.indexOf("popuplink"));
    }
   }
   
   
callWhenDOMLoaded(initPopupLinks);