function isEmpty(fieldname,fieldvalue)
{
	
	var str=checkTrim(fieldvalue)
	if(str.length==0)
	{
		alert(fieldname + ' can not be blank ');
		return true;
	}
	return false;
}



function checkTrim(txtString)
{
	txtString = LTrim(txtString);
	txtString = RTrim(txtString);
	return txtString;
}

//returns the string after deleting  the trailing spaces
function LTrim(txtString) 
{
	ctr = 0;
	while( ctr < txtString.length && (txtString.substring(ctr,ctr+1) == " "))
	{
		ctr=ctr+1;
	}
	return txtString.substring(ctr);
}
// returns the string after deleting the leading spaces
function RTrim(txtString) 
{
	ctr = txtString.length;
	while( ctr > 0  && (txtString.substring(ctr,ctr-1) == " "))
	{
		ctr = ctr - 1;
	}
	return txtString.substring(0,ctr);
}
