<!--
/*function changecount()
{
	val=document.catform.proddesc.value;
	if (document.catform.proddesc.value.length>1000)
		{document.catform.proddesc.value=val.substring(0,1000);	}	

	document.catform.tcount.value=document.catform.proddesc.value.length;
}*/


function checkfrm(form)
{
 form.catname.value=form.category.options[form.category.options.selectedIndex].text;

  var val,errorstr="";
  //check for product name 
  if(checkempty(form.prodname.value)==true ) 
	{	
		errorstr=":->Kindly Enter Product Name";
	}
 // else if( checkalpha(form.prodname.value)==false) 
 // {errorstr=":->Product Name can have only alphabets A-Z";}

//check for product price
  if(checkempty(form.prodprice.value)==true) {errorstr=errorstr+"\n:->Kindly Enter a valid Price";}
  else if(checkmoney(form.prodprice.value)==false) {errorstr=errorstr+"\n:->Price should only have numbers  greater than zero and less than  or equal to 8 digits";}

//Check for product quantity
//  if(checkempty(form.prodqty.value)==true) {errorstr=errorstr+"\n:->Kindly Enter a valid Stock quantity";}
//  else if(checkmoney(form.prodqty.value)==false) {errorstr=errorstr+"\n:->Quantity should only have numbers  greater than zero and less than  or equal to 8 digits";}

//check for product discount
 
 /* if( checkempty(form.discount.value)==false ) 
  {
  	if( checkmoney(form.discount.value)==false ) 
	{
	errorstr=errorstr+"\n:->Discount value should only have numbers  greater than zero and less than  or equeal to 100000";
	}
  	else if(checkmoney(form.prodprice.value)==true)
	{
  		if(parseFloat(form.discount.value)>=parseFloat(form.prodprice.value))
		{
			errorstr=errorstr+"\n:->Price should be greater than Discount";			
		}
	}
  }*/
  //else if(parseFloat(form.prodprice.value)<0 || parseFloat(form.prodprice.value)>100000 ) {errorstr=errorstr+"\n:->Price should be greater than zero and less than  or equeal to 100000";}	

  //check for Product Description
  proddescval = RemoveHTML(form.proddesc.value)
  if(checkempty(form.proddesc.value)==true) {errorstr=errorstr+"\n:->Kindly Enter a valid Description";}
  else if (proddescval.length>1000)  {errorstr=errorstr + "\n:->Product Description should not be greater than 1000 charachters. Current charachter count is " + proddescval.length;  }

  if(errorstr!="")  
	{
	  alert(errorstr);
	  return false ;
	}
  
  else 
	{
	  //form.submit();
	  return (true);	 
	}
}



//-->