function addLoadEvent(func)
{
    var oldonload = window.onload;
    if (typeof window.onload != 'function')
    {
        window.onload = func;
    }
    else
    {
        window.onload = function()
        {
            if (oldonload)
            {
                oldonload();
            }
            func();
        }
    }
}

function prefillTextBoxes()
{
    var texts = document.getElementsByTagName('input');
    
    for (var i = 0;i < texts.length;i++)
    {
        if (texts[i].className.indexOf('prefilled|') > -1)
        {
            var preFilledText = texts[i].className.split('|')[1].replace(/\_/g, ' ');
            texts[i].value = preFilledText;
            texts[i].prefilled = preFilledText;
            
            texts[i].onfocus = function()
            {
                 if (this.value == this.prefilled) this.value = '';
            }
            texts[i].onblur = function()
            {
                if (this.value == '') this.value = this.prefilled;
            }
            
            if (!texts[i].form.onsubmit)
            {
                texts[i].form.onsubmit = function()
                {
                    var inputs = this.getElementsByTagName('input');
                    
                    for (var i=0;i < inputs.length;i++)
                    {
                        if (inputs[i].prefilled && inputs[i].value == inputs[i].prefilled)
                        {
                            inputs[i].value = '';
                        }
                    }
                    
                    return true;
                }
            }
        }
    }
}

function cookiesEnabled()
{
    return (document.cookie.indexOf('PHPSESSID') > 0);
}

addLoadEvent(prefillTextBoxes);

try
{
    document.execCommand("BackgroundImageCache", false, true);
}
catch(err)
{}