how to call function and how to pass paramters to function

1.how to pass input paramters to postgres function using extjs
2.how to call function after passing paramters usig extjs

// this is the function what i have written in pgadmin
CREATE or replace FUNCTION backup_tab.emp_test_n(
MasterClass_In text,
NatureofAsset_In text,
SubClassOfAsset_In text)
RETURNS varchar AS
$func$
DECLARE
current_year varchar = (SELECT to_char(current_date,‘YYMM’)::varchar);
x varchar ;
in_sno int4:= (select cast(max(“SerialNumber”)as int) from public.“AssetSubClass”
where “MasterClass”=MasterClass_In and “NatureofAsset”=NatureofAsset_In and
“SubClassOfAsset”=SubClassOfAsset_In );
BEGIN
–in_sno = in_sno+1;
–in_sno = in_sno ;
–in_sno=(lpad(in_sno::varchar+ 1)::varchar,6,‘0’);
x=cast(current_year as varchar)||lpad(cast(in_sno as varchar),4,‘0’);
in_sno = in_sno+1;
–20100002
Update public.“AssetSubClass”
set “SerialNumber”=lpad(cast(in_sno as varchar),4,‘0’)
where “MasterClass”=MasterClass_In and “NatureofAsset”=NatureofAsset_In and
“SubClassOfAsset”=SubClassOfAsset_In;

RETURN x ;

END
$func$ LANGUAGE plpgsql;