//20091104

function getBody(iname){
 if(document.all){
  return(document.all(iname))
 } else if(document.getElementById){
  return(document.getElementById(iname))
 }
}

function callJSONP(Url, code){
 var c = (code) ? code : 'utf-8';
 var script = document.createElement('script');
 script.src = Url;
 script.charset = c;
 document.body.appendChild(script);
}

function addOnload2(){
 if (typeof(document.onload2) == 'undefined'){
  document.onload2 = {};
  document.onload2.add = function(f){
   if (document.onload2.load)
    return(f());
   if(typeof(document.onload2.funcs) == 'undefined' || document.onload2.funcs.length == 0){
    document.onload2.funcs = [f];
   }else{
    document.onload2.funcs.push(f);
   }
    if (document.onload2.running){
    return;
   }else{
    document.onload2.running = function(){
     document.onload2.load = true;
     while(document.onload2.funcs.length > 0){
      document.onload2.funcs[0]();
      document.onload2.funcs.shift();
     }
     document.onload2.running = null;
    }
   }
    //mac safari
   if(/WebKit/i.test(navigator.userAgent)){
    setInterval(function(){
     if (/loaded|complete/.test(document.readyState)) {
      document.onload2.running();
     }
    }, 10);
   //Firefox
   }else if (window.addEventListener){
    document.addEventListener("DOMContentLoaded", document.onload2.running, false);
   //MSIE
//   }else if(document.readyState && !!(window.attachEvent && !window.opera)){
//    document.write('<script defer src="javascript:void(0)" onreadystatechange="if (this.readyState == \'complete\')  document.onload2.running();"><\/script>');
   //その他
   }else{
    if (window.onload){
     if (window.attachEvent){
      window.attachEvent('onload', document.onload2.running);
     }else if (window.addEventListener){
      window.addEventListener('load', document.onload2.running, true);
     }else{
      window.onload = document.onload2.running;
     }
    }else{
     window.onload = document.onload2.running;
    }
   }
  }
 }
}
addOnload2();
