function blur (e) {caption(e.target,true)}
function keypress(e) {caption(e.target)}
function caption(elm, title) {
  if (arguments.length>1) {
  console.log(elm)
    if (!elm.title && title) elm.title= title;
    if (elm.value.length>0) if (elm.value!=elm.title) return;
    elm.value= elm.title;
    elm.style.color='#bbb';
    if (elm.attachEvent) {
      elm.attachEvent("blur", blur );
      elm.attachEvent("keypress", keypress );
    } else {
      elm.addEventListener("blur", blur , false);
      elm.addEventListener("keypress", keypress , false);
    }
  } else {
    //if (elm.value.length==0) return caption(elm,true);
//console.log(elm.style.color.indexOf('187'))
    if (elm.style.color.indexOf('187')>0) {
//console.log(2)
      elm.value='';
      elm.style.color='#000';
    }
  }
}
