﻿function checkPassword(pw){
		var sn = document.getElementById("notice");
		var iInd = document.getElementById("indicator");
		var intStrength   = 0;
		if (pw.match(/.[!,@,##,$,%,^,&,*,?,_,~,+,<,>,?,.,{,},|,(,),\,-,',",;]/))	
		{
			intStrength+=1;
		}
		if (pw.match(/[a-z]/)) 
		{
			intStrength+=1;
		}
		if (pw.match(/[A-Z]/))
		{
			intStrength+=1;
		}
		if (pw.match(/\d+/))
		{
			intStrength+=1;
		}
		if (intStrength>2 && pw.length>6){
			sn.innerHTML = 'Strong';
			iInd.className = 'green';
		}else if (intStrength>1 && pw.length>6){
			sn.innerHTML = 'Medium';
			iInd.className = 'yellow';
		}else if(pw.length>6) {
			sn.innerHTML = 'Weak';
			iInd.className = 'red';
		}else{
			sn.innerHTML = 'Too short';
			iInd.className = 'empty';
		}
		if (pw.length==0){
			sn.innerHTML = "";
			iInd.className = 'empty';
		}
		iInd.innerHTML = "";
}
