function word_count(w)
	{
		var y=w.value;
		var r = 0;
		a=y.replace(/\s/g,' ');
		a=a.split(' ');
		for (z=0; z<a.length; z++)
			{
				if (a[z].length > 0) r++;
			}
		return r;
	}
	
	
function getvalue(loca, limit)
	{
		no_of_words = word_count(loca);
		if(no_of_words>limit)
			{
				alert("You just type more than " + limit + " words!\nPlease reduce you word count!");
				return false;
			}
		else
			{
				if(no_of_words==0)
					{
						alert("Please input less than " + limit + " words!");
						return false;
					}
				else
					{
						return true;
					}
			}
	}
	
function focuson(idname)
	{
		return document.getElementById(idname).focus();
	}

function IsDigit(wek)
	{
		var e;
		if (window.event)
			{
				e = wek.keyCode;
			}
		else
			{
				e = wek.which;
			}
		if ((e >= 48 && e <= 57) || (e == 45) || (e == 47) || (e == 13) || (e == 8) || (e == 0))
			{
				return true;
			}
		else
			{
				return false;
			}
	}

function count(array)
	{
		var counter = 0;
		for(items in array) // in returns key, not object
			if(array[items] != undefined)
				counter++;
		return counter;
	}

function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}

