// JavaScript Document
<!-- Passord and text Script -->
<!--
function changeInputType(oldElm,iType,iValue,noFocus) {
if(!oldElm || !oldElm.parentNode || (iType.length<4) ||
!document.getElementById || !document.createElement) return;
var newElm = document.createElement('input');
newElm.type = iType;
if(oldElm.name) newElm.name = oldElm.name;
if(oldElm.id) newElm.id = oldElm.id;
newElm.onfocus = function() {
if(this.hasFocus) return;
var newElm = changeInputType(this,'password',
(this.value.toLowerCase()=='password')?'':this.value);
if(newElm) newElm.hasFocus=true;
}
newElm.onblur = function() {
if(this.hasFocus)
if(this.value=='' || this.value.toLowerCase()=='password') {
changeInputType(this,'text','password',true);
}
}

newElm.hasFocus=false;
oldElm.parentNode.replaceChild(newElm,oldElm);
if(iValue) newElm.value = iValue;
if(!noFocus || typeof(noFocus)=='undefined') {
window.tempElm = newElm;
setTimeout("tempElm.hasFocus=true;tempElm.focus();",1);
}
return newElm;
}
window.onload = function() {
// Example 1
var allowInputTypeChange = true;
var fld1 = document.forms[0].field1;
if(document.getElementById) {
try { // to keep IE from showing errors.
fld1.type = 'text';
if(fld1.type == 'text') fld1.value = 'password';
else allowInputTypeChange = false;
} catch(e) { allowInputTypeChange = false; }
}
if(allowInputTypeChange) {
fld1.onfocus = function() {
var tempVal = this.value; // NS6 fix.
var iType = this.type; // Opera 7 fix.
if(this.type != 'password') this.type = 'Password';
this.value = tempVal; // NS6 fix.
if(this.value.toLowerCase()=='Password')
this.value = '';
if(window.opera && iType != 'Password') this.focus();
}
fld1.onblur = function() {
if(this.type == 'Password')
if(this.value=='' || this.value.toLowerCase()=='Password') {
this.type = 'text';
this.value = 'Password';
}
}
}

var ua = navigator.userAgent.toLowerCase();
if((ua.indexOf('konqueror')==-1) && (ua.indexOf('safari')==-1) &&
((ua.indexOf('msie')==-1)||(ua.indexOf('mac')==-1)))
changeInputType(document.forms[0].password,'text','password',true);
}
// -->
