function createNiceInput(fId, fDefaultValue, fValue, fInactiveClass, fActiveClass) {
	var el = document.getElementById(fId);
	var tagName = el.tagName;
	el.value = (fValue?fValue:fDefaultValue);
	
	if (fDefaultValue==fValue || !fValue)
		el.className = fInactiveClass;
	else
		el.className = fActiveClass;
		
	var myOnFocus = function(val) {
		if (tagName=="INPUT") {
			if (this.value==fDefaultValue) {
				this.value="";
				this.className = fActiveClass;
			}
		}
		if (tagName=="TEXTAREA") {
			if (this.value==fDefaultValue) {
				this.value="";
				this.className = fActiveClass;
			}
		}
	}
	var myOnBlur = function(val) {
		if (tagName=="INPUT") {
			if (this.value=="") {
				this.value=fDefaultValue;
				this.className = fInactiveClass;
			}
		}
		if (tagName=="TEXTAREA") {
			if (this.value=="") {
				this.value=fDefaultValue;
				this.className = fInactiveClass;
			}
		}
	}
	el.onfocus = myOnFocus;
	el.onblur = myOnBlur;
}


function showSkillProgress(fId, fTargetPercentage, fWidth, fStart) {
	var loader = document.getElementById(fId);
	var targetWidth = Math.round(fWidth*fTargetPercentage/100);
	w = fStart;
	w=w+2;
	if (w>targetWidth) {
		w = targetWidth;
		return;
	}
	perc = w/targetWidth;
	fSpeed = Math.sin(2*perc/fTargetPercentage)*5*100;
	
	
	//if (fId=="skill_score_1_skill1score")
	//	console.log(fId+"_"+fSpeed)
	w++;
	loader.style.width = w+"px";        		
	setTimeout("showSkillProgress('"+fId+"', "+fTargetPercentage+", "+fWidth+", "+w+")",fSpeed);
}
//

