function trimchar(val)
	{		 
			if(val)
			{
				str =new String(val.value) 
				 
				for (i=0;i<val.value.length;i++)
				{
					if (val.value.charAt(i)!=" ")
					{
						break
					};
				}
				
				val.value=str.substring(i,val.value.length);
				str=(val.value);
				for (i=val.value.length-1;i>-1;i-=1)
				{
					if (val.value.charAt(i)!=" ")
					{
						break;
					}
					 
				}
				val.value=str.substring(0,i+1);
				
			}
	}
	
	
function openWin(strurl,w,h,n)
{ 
	if ((strurl!='')&&(w!='')&&(h!='')&&(n!=''))
	{
		nextWin=window.open(strurl,n,'width='+w+',height='+h+',left=100,top=100,scrollbars=yes,resizable=yes,status=yes'); 
		nextWin.focus();
	} 
}
function octab(val)
	{
		if(val.style.display=='none')
		{
			val.style.display='';		
		}
		else
		{
			val.style.display='none';
		}
	}
 
	function plainReport(dt,ctitle)
		{	if(dt)
			{
 				myWindow = window.open("",ctitle, 'toolbar,resizable,width=600,height=800,scrollbars') ;
				myWindow.document.write('<html><head><title>Estimate Report</title><link rel=stylesheet href="../../style/getclaim.css" type="text/css">');
				myWindow.document.write('<script language=\"javascript\" src=\"../../style/format.js\"></script>');
				myWindow.document.write('</head><body bgcolor="#ffffff">');
				myWindow.document.write(dt.innerHTML);
				myWindow.document.write('</body></html>');
				
				myWindow.document.focus() ;
			}
	}
	
function formatphone(ophone)
	{	 
		var ts=new String();
		var s=ophone.value;
		for(i=0; i  < s.length;i++)
		{	
			if((!isNaN(s.charAt(i) ) )&&(s.charAt(i)!=" "))
			{
				ts+=s.charAt(i);
			}

		}
	 
		switch(ts.length)
		{
			case 10:
				ophone.value=ts.substring(0,3)+"-"+ts.substring(3,6)+"-"+ts.substring(6,10);
			break;
			case 7:
				ophone.value=ts.substring(0,3) + "-" + ts.substring(3,7);
			break;
			
			default:
			break;
		}		
	}
	

