$(document).ready(function() {
	$('input[type="text"]').addClass("idleField");
		$('input[type="text"]').focus(function() {
 			$(this).removeClass("idleField").addClass("focusField");
    		    if (this.value == this.defaultValue){ 
    		    	this.value = '';
				}
				if(this.value != this.defaultValue){
	    			this.select();
	    		}
    		});
    		$('input[type="text"]').blur(function() {
    			$(this).removeClass("focusField").addClass("idleField");
    		    if ($.trim(this.value) == ''){
			    	this.value = (this.defaultValue ? this.defaultValue : '');
			}
	});
});	


function xGetElementById(e) {
    if (typeof(e) != 'string') return e;
    if (document.getElementById) e = document.getElementById(e);
    else if (document.all) e = document.all[e];
    else e = null;
    return e;
}
function xDef() {
    for (var i = 0; i < arguments.length; ++i) {
        if (typeof(arguments[i]) == 'undefined') return false;
    }
    return true;
}
function mostrar(e) {
    if (!(e = xGetElementById(e))) return;
    //if (e.style && xDef(e.style.visibility)) e.style.visibility = 'visible';
    if (e.style && xDef(e.style.visibility)) e.style.display = 'inline';    
}
function ocultar(e) {
    if (!(e = xGetElementById(e))) return;
    //if (e.style && xDef(e.style.visibility)) e.style.visibility = 'hidden';
    if (e.style && xDef(e.style.visibility)) e.style.display = 'none';    
}
function mostrarbut(e) {
    if (!(e = xGetElementById(e))) return;
    if (e.style && xDef(e.style.visibility)) e.style.visibility = 'visible';
}
function ocultarbut(e) {
    if (!(e = xGetElementById(e))) return;
    if (e.style && xDef(e.style.visibility)) e.style.visibility = 'hidden';
}


