function loadImgSearch(key,dst){
 try{ if(img_flg[dst]==1){ var p=document.getElementById(dst+'_img'); pp=p.parentNode; pp.removeChild(p); img_flg[dst]=0; return false; } }
 catch(e){ }
 
 httpObj = createXMLHttpRequest();
 
 if(httpObj != null){
  img_flg[dst]=1;
  var ele=document.createElement("dd");
  ele.id=dst+"_img"; 
  ele.innerHTML="読み込み中...";
  ele.style.backgroundColor="#f0f0f0"; 
  ele.style.border="1px solid #d0d0d0"; 
  document.getElementById(dst).appendChild(ele);

  httpObj.onreadystatechange = function(){ document.getElementById(dst+'_img').innerHTML=httpObj.responseText; } ;
  httpObj.open("GET","./imageSearch.php?k="+encodeURI(key),true);
  httpObj.send(null);
 // document.getElementById(dst+'_img').innerHTML="Loading...";
 }
}
var img_flg={};


function createXMLHttpRequest(){
 var XMLhttpObject = null;
 try{
  XMLhttpObject = new XMLHttpRequest();
 }
 catch(e){
  try{
   XMLhttpObject = new ActiveXObject("Msxml2.XMLHTTP");
  }
  catch(e){
   try{
    XMLhttpObject = new ActiveXObject("Microsoft.XMLHTTP");
   }catch(e){
   return null;
   }
  }
 }
 return XMLhttpObject;
}

