var currow=null;
function ValidateEntry(flag)
{
validate(document.getElementById("doctype"),flag,'');
validate(document.getElementById("docholdername"),flag,'SplInstruction');
if(validateHidden && $("#serviceprovider_hidden").val()=='')
{
$("#serviceprovider").val('');
}
validate(document.getElementById("serviceprovider"),flag,'SplInstruction');
var temp=$("#uniqueno").attr("onblur").replace( "validate(","" ).replace( ")","").replace(/'/g,"").split(",");
validate(document.getElementById("uniqueno"),flag,temp[2]);
var temp=$("#yearmonth").attr("onblur").replace( "validate(","" ).replace( ")","").replace(/'/g,"").split(",");
validate(document.getElementById("yearmonth"),temp[1],temp[2]);
validate(document.getElementById("city"),flag,'');
}
function AddNewDoc()
{
ValidateEntry('t');
if(checkForm())
{
UpdateDoc();
}
else
{
CallMessage('VLFRM:error:There are one or more error(s) in form. Please correct them and try again.',3000,200,300);
}
}
function AddDocRow(data,did,vname)
{
var tbody = $('#doclist');
var totdocs= $('#doclist tr').length;
var row = null;
if(data.doc_id=='0')
{
row = $('