/********* txtLIT 0.1 *********
    Developed by Robert Gaal
  www.internetprogrammeurs.nl
******************************/

// Set the color of the input/textarea when focussed
var litColor = '#EEE';
////////////////////////////////////////////////////

window.onload = function()
{   
    //get all the inputs on the page
    inputs = document.getElementsByTagName('input');
    for(var i=0; i < inputs.length; i++) 
    {
        //check if the input is a checkbox
        if(inputs[i].getAttribute('type') == 'text') 
        {
            inputs[i].onfocus 	= new Function('lit(inputs,'+i+')');
            inputs[i].onblur 	= new Function('dim(inputs,'+i+')');
        }
    }
    
    //get all the textareas on the page
    textareas = document.getElementsByTagName('textarea');
    for(var i=0; i < textareas.length; i++) 
    {

   		textareas[i].onfocus 	= new Function('lit(textareas,'+i+')');
        textareas[i].onblur 	= new Function('dim(textareas,'+i+')');
    }
}

function lit(el,i)
{
	var arr = el;
	el[i].style.backgroundColor = litColor;
}
function dim(el,i)
{
    var arr = el;
	el[i].style.backgroundColor = '';
}
