// JavaScript Document
//Inspection parameters Settings
function ValidateNum(item,type,str)
{
	var returnVal = 0;
	var intVal;
	var strVal = new String(item.val());
	var ch;
	var i;
	if(type == "OUTRATE")//Input/output card output bitrate
	{
		if(strVal=="")
	    {
			alert("Please input"+str);
			item.focus();
			return false; 
	    }
		for ( i = 0 ; i < strVal.length ; i++ )
		{      
			ch = strVal.charAt(i);
 			if(ch < '0' || ch > '9')
			{
				alert(str+"Please input valid decimal integer!");
				item.focus();
	       		return false;
			}
		}
		intVal= parseInt(item.val(),10);
		if(intVal > 213000000 || intVal <0)
		{
			alert(str+"must be between 0 and 213000000!");
			item.focus();
			return false; 
		}
	}
	else if(type == "REFRATE")//Output bitrate and ref-bitrate
	{
		if(strVal=="")
	    {
			alert("Please input"+str);
			item.focus();
			return false; 
	    }
		for ( i = 0 ; i < strVal.length ; i++ )
		{      
			ch = strVal.charAt(i);
 			if(ch < '0' || ch > '9')
			{
				alert(str+"Please input valid decimal integer!");
				item.focus();
	       		return false;
			}
		}
		intVal= parseInt(item.val(),10);
		if((intVal <500000)||(intVal > 205000000))
		{
			alert(str+"must be between 500000 and 205000000!");
			item.focus();
			return false;
		}
	}
	else if(type == "SYSRATE")//Output bitrate and ref-bitrate
	{
		if(strVal=="")
	    {
			alert("Please input"+str);
			item.focus();
			return false; 
	    }
		for ( i = 0 ; i < strVal.length ; i++ )
		{      
			ch = strVal.charAt(i);
 			if(ch < '0' || ch > '9')
			{
				alert(str+"Please input valid decimal integer!");
				item.focus();
	       		return false;
			}
		}
		intVal= parseInt(item.val(),10);
		if((intVal <0)||(intVal > 213000000))
		{
			alert(str+"must be between 0 and 213000000!");
			item.focus();
			return false;
		}
	}
	else if(type == "DELAYTIME")//Output time delay
	{
		if(strVal=="")
	    {
			alert("Please input"+str);
			item.focus();
			return false; 
	    }
		for ( i = 0 ; i < strVal.length ; i++ )
		{      
			ch = strVal.charAt(i);
 			if(ch < '0' || ch > '9')
			{
				alert(str+"Please input valid decimal integer!");
				item.focus();
	       		return false;
			}
		}
		intVal= parseInt(item.val(),10);
		if((intVal <0)||(intVal > 19418))
		{
			alert(str+"must be between 0 and 19418!");
			item.focus();
			return false;
		}
	}
  return true;
}