// JavaScript Document


	function getcount( mstr ) {
		
		
		var y=0;
		var x=0;
		
		bTags = 0;
		eTags = 0;
		
		newString = '';
		
		//Remove all html tags
		for(x=0;x<=mstr.length;x++) {
			
			ch = mstr.substr(x,1);
			
			if(ch == '<') {
				bTags++;
			} else if(ch == '>') {
				bTags--;
			} else if(bTags == 0) {
				newString += ch;
			}
			
		}


		//Remove all & tags
		nString = '';
		bSkip = false;
		for(x=0;x<=newString.length;x++) {
			ch = newString.substr(x,1);
			if(ch == '\&') {
				bSkip = true;
			} else if(bSkip && ch == '\;') {
				bSkip = false;
			} else if (!bSkip && newString.charCodeAt(x) != 13 && newString.charCodeAt(x) != 10 && newString.charCodeAt(x) != 9) {
				nString += ch;
			}
		}
		
		//Remove duplicate spaces
		xString = '';
		xSpace = 0;
		for(x=0;x<=nString.length;x++) {
			if(nString.charCodeAt(x) == 32) {
				xSpace++;
			} else {
				xSpace = 0;
			}
			if(xSpace <= 1) {
				xString += nString.charAt(x);
			}
				
		}
		
		//if(xString.length > 1) {
		//	document.getElementById('w_count').value = xString.split(' ').length;
		//}
		return xString.split(' ').length;
	}















function IsNumberValue(sText) {
   var ValidChars = "0123456789.$";
   var IsNumber=true;
   var Char;

 
   for (i = 0; i < sText.length && IsNumber == true; i++) 
      { 
      Char = sText.charAt(i); 
      if (ValidChars.indexOf(Char) == -1) 
         {
         IsNumber = false;
         }
      }
   return IsNumber;
   
   }

String.prototype.stripHTML = function()
{
        var matchTag = /<(?:.|\s)*?>/g;
        return this.replace(matchTag, "");
}


function stripSpaces(sText) {
	var newstring;
	var char;
	for (i=0; i<sText.length;i++) {
		char = sText.charCodeAt(i);
		if(char != 32 && char != 10 && char != 13) {
			newstring += sText.charAt(i);
		}
	}
	return newstring;
}

function stripHTML(s) {
	var re= /<\S[^>]*>/g; 
	s = s.replace(re,""); 
	return s;
}



