//Urlcheck
function isUrl(s) {
	urlRE=/^http:\/\/[\w\.]/;
  	return urlRE.test(s);
}

//flash
function flash(id)
{
  jump=id.replace("document.reg.", "#");
  window.location.hash=jump;
  setTimeout(id + ".style.background='#FF6A6A';",0);
  setTimeout(id + ".style.background='#F4F4F4';",400);
  setTimeout(id + ".style.background='#FF6A6A';",800);
  setTimeout(id + ".style.background='#F4F4F4';",1200);
  setTimeout(id + ".style.background='#FF6A6A';",1600);
  setTimeout(id + ".style.background='#F4F4F4';",2000);
}

//check ifthis is a number
function IsNumeric(sText)
{
var ValidChars = "0123456789.";
var IsNumber=true;
var Char;

for (i = 0; i < sText.length && IsNumber == true; i++)
{
Char = sText.charAt(i);
if ((i == 0) && (Char == "-")) // check first character for minus sign
continue;
if (ValidChars.indexOf(Char) == -1)
{
IsNumber = false;
}
}
return IsNumber;

}

function alphanumeric(alphane)
{
	var numaric = alphane;
	for(var j=0; j<numaric.length; j++)
		{
		  var alphaa = numaric.charAt(j);
		  var hh = alphaa.charCodeAt(0);
		  if((hh > 47 && hh<58) || (hh > 64 && hh<91) || (hh > 96 && hh<123))
		  {
		  }
		else	{
			 return false;
		  }
		}
 return true;
}

function doWordCount(textParam)
{
 //replace all instances of one-or-more spaces with a single space
 var text2 = textParam.replace(/\s+/g, ' ');

 //trim leading and tailing spaces
 while(text2.substring(0, 1) == ' ')
  text2 = text2.substring(1);
 while(text2.substring(text2.length-2, text2.length-1) == ' ')
  text2 = text2.substring(0,text2.length-1);

 var text3 = text2.split(' ');

 return text3.length;
}