// Removes leading whitespaces
function LTrim( value ) {
	
	var re = /\s*((\S+\s*)*)/;
	return value.replace(re, "$1");
	
}

// Removes ending whitespaces
function RTrim( value ) {
	
	var re = /((\s*\S+)*)\s*/;
	return value.replace(re, "$1");
}

// Removes leading and ending whitespaces
function trim( value ) {
	
	return LTrim(RTrim(value));
	
}
function show()
{
	 var s=document.cal_log;
	 var number=10;
 	if(s.name.value=="")
	{
	alert ("Please enter name");
	s.name.focus()
	s.name.select()
	return false; 
	}
	if(s.contact_no.value=="")
	{
	alert ("Please enter contact number");
	s.contact_no.focus()
	s.contact_no.select()
	return false;
	}
		
	if(s.company_name.value=="")
	{
	alert ("Please enter company name");
	s.company_name.focus()
	s.company_name.select()
	return false;
	}
		
	if(s.report.value=="")
	{
	alert ("Please report your problem");
	s.report.focus()
	s.report.select()
	return false;
	}
	else
	{
		var len=s.report.value;
		var kin=trim(len);
		if(kin=="")
		{
        alert("Please report your problem");
		s.report.focus();
		return false;
		}
		else
		{
			return true;
		}
		
     }
	
	return true;
}
function isNumberKey(evt)
      {
         var charCode = (evt.which) ? evt.which : event.keyCode
         if ((charCode >=48 && charCode <=57 )|| (charCode == 46 )||(charCode == 10 )||(charCode == 13 )|| (charCode == 8)||(charCode == 32)||(charCode == 45))
        {
	       return true; 
        }
         else
          {
	         alert("Please enter only numbers");
            return false;
            
        }
        
    }
    function limitlength(obj, length)
{
	var maxlength=length
	if (obj.value.length>maxlength)
	{
	obj.value=obj.value.substring(0, maxlength)
     }
}  

