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);
}

/*
function preload(images) {
    if (document.images) {
        var i = 0;
        var imageArray = new Array();
        imageArray = images.split(',');
        var imageObj = new Image();
        for(i=0; i<=imageArray.length-1; i++) {
            //document.write('<img src="' + imageArray[i] + '" />');// Write to page (uncomment to check images)
            imageObj.src=images[i];
        }
    }
}
*/

function hideLoadingLayer() {
      document.getElementById('loading_layer').style.visibility='hidden'
}

function winalign(){
   if (ie7 == true) {
      window.resizeBy(-10,-10);
      window.resizeBy(10,10);
   }
}

function stop() {
   if (ytplayer) {
      ytplayer.stopVideo();
   }
}
