
function ShowUpHintLayer(el_inp,defValue,popupValue)
    {
    
    var uph, uphs;
    
    uph = GetEl('uphint');
    if( !uph ) return;

    uphs = GetEl('uphint_stripe');
    if( !uphs ) return;

    uph.style.width = el_inp.style.width;
    if(parseInt(uph.style.width)<100) uph.style.width = '200px';
    uph.style.overflow = 'hidden';
                                    
    uph.style.left = GetControlX(el_inp);
    uph.style.top = (GetControlY(el_inp) - 22) + 'px';
    uphs.innerHTML = popupValue;

//    if( el_inp.value == defValue ) el_inp.value = '';
    HideLayer(el_inp.id + '_def');
    ShowLayer('uphint');
    el_inp.focus();

    }

function HideUpHintLayer(el_inp)
    {
    
    HideLayer('uphint');
    
    if( !el_inp.value.replace(' ','') )
        {
        ShowLayer(el_inp.id + '_def');
        }
    }


function SetupControlHints(id_inp, defValue, popupValue)
    {

//    return;

    var el_inp, el_def,el_def_id;
    
    el_inp = GetEl(id_inp);

    if( el_inp==undefined ) return;

    el_def_id = id_inp+'_def';
    
    CreateLayer(el_def_id, GetControlX(el_inp), GetControlY(el_inp), '&nbsp;');
    if( el_inp.value.replace(' ','') ) HideLayer(el_def_id);

    el_def = GetEl(el_def_id);
    el_def.style.width = el_inp.style.width;
    el_def.style.height = el_inp.style.height;
    el_def.style.color = 'ABABAB';
    el_def.style.fontStyle = 'normal';
    el_def.style.padding = '2px 0px 0px 2px';
    el_def.innerHTML = defValue;
    
    el_def.onclick = function(){ ShowUpHintLayer(el_inp,defValue,popupValue);};
    el_inp.onfocus = function(){ ShowUpHintLayer(el_inp,defValue,popupValue);};
    el_inp.onblur = function(){ HideUpHintLayer(this);};

    }

function InitPopupHints()
    {

    var divtxt;

    divtxt = '<span id="uphint_stripe" class="uphint_stripe">&nbsp;</span>';
    divtxt += '<div class="uphint_arrow">&nbsp;</div>';
    
    CreateLayer('uphint', 0, 0, divtxt);
    GetEl('uphint').style.zIndex = 10000;

    HideLayer('uphint');
    }