function set_input_bg_img(id, style) {
    //alert('set_input_bg_img: '+id+'\n\nval:'+document.getElementById(id).value);
    if(document.getElementById(id).value==""){
        document.getElementById(id).style.background=style;
    }
    return true;
}
function hide_input_bg_img(id) {
    document.getElementById(id).style.backgroundImage="";
    document.getElementById(id).onfocus="";
    return true;
}

function set_input_text(id, txt) {
    //alert('set_input_bg_img: '+id+'\n\nval:'+document.getElementById(id).value);
    if(document.getElementById(id).value=="" || document.getElementById(id).value == txt){
        document.getElementById(id).value=txt;
    }
    return true;
}
function hide_input_text(id, match) {
    //alert(document.getElementById(id).value + '\n\n' + match)
    if(document.getElementById(id).value==match){
        document.getElementById(id).value="";
        document.getElementById(id).onfocus="";
        if(match=='password'){
            textToPassword(id);
        }
    }
    return true;
}

function textToPassword( id ){
    elem = document.getElementById(id);
    var eData={v:elem.value, t:elem.type, s:elem.size, n:elem.name}, newElem, newType=(eData.t=='password'?'text':'password');

    try{
        newElem=document.createElement("<input type='"+newType+"' name='"+eData.n+"' value='"+eData.v+"' size='"+eData.s+"' id='"+id+"'>");
    } catch(e) {
        newElem=document.createElement('input');
        newElem.name=eData.n;
        newElem.name=eData.n;
        newElem.type=newType;
        newElem.size=eData.s;
        newElem.value=eData.v;
        newElem.id=id;
    }

    elem.parentNode.replaceChild(newElem, elem);
   // alert(newElem.id)
    setTimeout("document.getElementById('"+id+"').focus();", 10);
    return newElem.type;
}