// http://wiki.mintel.co.uk/index.php/GNPD/JavaScript_loading
var cached=""
$A(document.getElementsByTagName("script")).findAll( function(s) {
    return (s.src && s.src.match(/js\/loader\.\d+\.js$/))
}).each( function(s) {
  m=s.src.match(/\.(\d+)\./)
  if (m) cached=m[1]
});
function jsload(s) {
  if(s.startsWith("http://")) {
    document.write('<script charset="windows-1252" src="'+s+'"><\/script>')
  } else {                  
    document.write('<script charset="windows-1252" src="'+s+"."+cached+".js" +'"><\/script>')
  }
}
function cssload(s) {
  var ssEl = document.createElement('link')
  if(s.startsWith("http://")) {
    ssEl.href = s;
  } else {
    ssEl.href = s+"."+cached+".css";
  }
  ssEl.rel = 'stylesheet';
  ssEl.type = 'text/css';
  document.documentElement.firstChild.appendChild(ssEl);
}
if (typeof GNPD=='undefined') {
  [ "/gnpd/js/shadedborder", "/gnpd/js/utilities",
    "/gnpd/sidebar","/gnpd/js/jsolait/hooks", "/gnpd/js/commandlets",
    "/gnpd/js/look_and_feel",
    "/gnpd/asynch_request"].each(function(s){jsload(s)})
}
if ((document.styleSheets[0].cssRules && document.styleSheets[0].cssRules.length==0)
     || (document.styleSheets[0].rules && document.styleSheets[0].rules.length==0)) {
  ["/gnpd/stylesheet", "/gnpd/global"].each(function(s){cssload(s)})
}
