function  CheckStringValidity( eleid,eleName,max,min,msg )
    {
        var id = document.getElementById(eleid);

	if (id)
			;
        else 
			return true 
              
        var  elem =removeThousandsSeparator( Trim(id.value));
	    
		if( elem == "")
	    {
		    
		   if(msg=="")
		   	   alert("Please enter "+ eleName +"!" );
		   else
		    alert(msg);
		    
		   id.focus();
		   id.select()
		   
           return false; 
		 }
		   else
		   {
				 if(max != -1)
				  {									
					if( elem.length > max)
						{
						alert(eleName + " should contain maximum " + max + " characters!");
						id.focus();
						id.select()		   
						return false;     						 		
						}						
				  }	   
				  
				  if(min!=-1)
					{
						if(elem.length < min )
						{
							alert(eleName + " must contain at least " + min + " characters!");
							id.focus();
							id.select()		   
							return false;	                			
						}
					}
			}	
          return true ;
      
	  
	  }



function  Checknull( eleid ,msg)
{
var id = document.getElementById(eleid);
 if (id.value == "")
{
alert("Please enter " + msg + "!");
id.focus();
return false;
}
	   return true ;
}

function  CheckList( eleid ,msg)
{
var id = document.getElementById(eleid);
 if (id.value == -1)
{
alert("Please select " + msg + "!");
id.focus();
return false;
}
	   return true ;
}


function isFloat(ele)
{
	 var reFloat=/^\d+(\.\d+)?$/;
	 var element=document.getElementById(ele);
	 //alert(removeThousandsSeparator(element.value));
	 if( ! reFloat.test(removeThousandsSeparator(element.value)))
		{
			alert("Please input correct value");
			element.focus();
			return false;
		}
	return true;
}

function IsNegative(strString)
{
   var strChar;
      var blnResult = true;
   for (i = 0; i<strString.length; i++)
   {   
     blnResult == true;
     strChar = strString.charAt(i);
     if (strChar == "-")
      {
        blnResult = false;
       }
     }
   return blnResult;
}

function IsNumeric(strString)//negative
//  check for valid numeric strings
   {
   
   var strValidChars = "0123456789.,";
   var strChar;
   var blnResult = true;
   var i;
  // if (strString.length == 0) return false;
   for (i = 0; i<strString.length; i++)
      {   
       blnResult == true;
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }  
   
   function IsInteger(strString)//negative
//  check for valid numeric strings
   {
   
   var strValidChars = "0123456789";
   var strChar;
   var blnResult = true;
   var i;
  // if (strString.length == 0) return false;
   for (i = 0; i<strString.length; i++)
      {   
       blnResult == true;
      strChar = strString.charAt(i);
      if (strValidChars.indexOf(strChar) == -1)
         {
         blnResult = false;
         }
      }
   return blnResult;
   }  
