function txtInputOnFocus(txtInput,str){
	if(txtInput.hasFocus){
	 return;
	 }
	txtInput.hasFocus=true;
	if(str=='Password'&&txtInput.value==str){
		txtInput=swapInputType(txtInput,str);
	}
	if(txtInput.value==str)txtInput.value='';
	txtInput.onblur = function(){
		if(txtInput.value==''){
			if(txtInput.type=='password')txtInput=swapInputType(txtInput,str);
			txtInput.value=str;
		}
		txtInput.hasFocus=false;
	}
}

function swapInputType(txtInput,str){
	var newInput = document.createElement('input');
	if(txtInput.type=='password')newInput.type='text';
	else newInput.type='password';
	newInput.name = txtInput.name;
	newInput.value = txtInput.value;
	newInput.id = txtInput.id;
	newInput.className = txtInput.className;
	objParent=document.getElementById(txtInput.name).parentNode;
	objParent.replaceChild(newInput,txtInput);
	newInput.onfocus = function (){txtInputOnFocus(newInput,str)};
	newInput.hasFocus=false;
	window.newInput = newInput;
	newInput.onblur = function(){
		if(newInput.value==''){
			if(newInput.type=='password')newInput=swapInputType(newInput,str);
			newInput.value=str;
		}
		newInput.hasFocus=false;
	}
	setTimeout("newInput.hasFocus=true;newInput.focus();",1);
	return newInput;
}