var IE = document.all?true:false;

function Vaciar(campo,changeType,oldvalue) {
	if (campo.value == oldvalue){
		campo.value = '';
		if (changeType) {
			if (IE) {
				newElement = changeInputType(campo, 'password');
				setTimeout("newElement.focus(); newElement.select()", 10);
			} else {
				campo.type = 'password';
			}
		}
	}
}

function Rellenar(campo,changeType,valor) {
	if (campo.value == '') {
		campo.value = valor;
		if (changeType) {
			if (IE) {
				newElement = changeInputType(campo, 'text');
			} else {
				campo.type = 'text';
			}
		}
	}
}

function changeInputType(oldObject, oType) {
	var newObject = document.createElement('input');
	newObject.type = oType;
	if (oldObject.size) newObject.size = oldObject.size;
	if (oldObject.value) newObject.value = oldObject.value;
	if (oldObject.name) newObject.name = oldObject.name;
	if (oldObject.id) newObject.id = oldObject.id;
	if (oldObject.onfocus) newObject.onfocus = oldObject.onfocus;
	if (oldObject.onblur) newObject.onblur = oldObject.onblur;
	if (oldObject.className) newObject.className = oldObject.className;
	oldObject.parentNode.replaceChild(newObject,oldObject);
	if (oldObject.hasFocus) {
		newObject.focus();
		newObject.select();
	}
	return newObject;
}
