﻿function apcl_checkAll(chkAll)
{
var table = chkAll.parentNode.parentNode.parentNode.parentNode;
for(var i = 1; i <= table.rows.length - 1; i++ )
{
	table.rows[i].cells[0].childNodes[1].checked = chkAll.checked;
}
}
function apcl_maskToFloat(txt)
{
  var keys = ',8,16,35,36,37,39,46,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105,188';
	return (keys.indexOf(','+event.keyCode) != -1);
}
function apcl_maskToInt(txt)
{
  var keys = ',8,16,35,36,37,39,46,48,49,50,51,52,53,54,55,56,57,96,97,98,99,100,101,102,103,104,105';
	return (keys.indexOf(','+event.keyCode) != -1);
}

function apcl_formatFloat(value,decimalPlaces,decimalSeparator)
{
	if(value==0)
		return 0;

	var parts = (''+value).split('.');
	if(parts.length>1)
		return parts[0] + decimalSeparator + parts[1].substr(0,decimalPlaces);	
	else
		return value;
}


function apcl_openWindow(url,name,tool,ww,hh,scro,res,men)
{
	var xx;
	var yy;
	xx = (screen.width/2)-(ww/2);
	yy = (screen.height/2)-(hh/2);
	window.open(url,name,'toolbar='+tool+',width='+ww+',height='+hh+',left='+xx+',top='+yy+', status=no,scrollbars='+scro+',resizable='+res+',menubar='+men);
}