// Hide instruction text for password field
function txt2pwd(obj, pwd){
	obj.style.visibility = "hidden";
	document.getElementById(pwd).focus();
}
// Display instruction text for password field
function pwd2txt(obj, txt){
	if(obj.value.length==0){
		document.getElementById(txt).style.visibility = "visible";
	}
}
// Display instruction text [str] if field is blank
// Clear instruction text if field is clicked
	function resetField(obj,str){
		if(obj.value.length==0){
			obj.value=str;
			return;
		}
		if(obj.value==str){
			obj.value="";
		}
	}

// initials should be before validation transformed to capital letters with dots behind, example xyz -> X.Y.Z.
function formatInitials(thisObj) {
	var formatedString = thisObj.value;
	if( isNotEmpty(thisObj)  &&  thisObj.value.trim().length !=0 )
	{
		formatedString = "";
		for(x=0; thisObj.value.length > x ; x++)
		{
			if(thisObj.value.charAt(x) !=" "  &&  thisObj.value.charAt(x) !=".")
			{
				formatedString += thisObj.value.charAt(x).toUpperCase()+ ".";
			}
		}
	}
	 thisObj.value = formatedString;
}
			
function isNotEmpty(string){
	if(string!=null && string!=""){
		return true;
	}else{
		return false;
	}
}

function limitSize(input, limit) {
	if (input.value.length>limit) {
		input.value = input.value.substring(0, limit);
	}
}	
function removeComment(str){
	return str.substring(0, str.indexOf('<!--'));
}
