Files
matrix/reporting.js
2025-04-19 17:50:17 +05:30

1334 lines
44 KiB
JavaScript

var prevSort=null;
var currow=0;
var curcol=13;
var precol=18;
var lastrow=0;
var maxrow=0;
var rowId='';
var suffix='';
var totports=0;
var autorem_temp = "";
var autorem_vals = new Array(1);
var verid=0;
function InitPage()
{
$('#casetable').flexigrid();
$("#portdiv").html($("#porthtml").val());
if($('#verdiv').length > 0){$("#verdiv").html($("#verhtml").val());}
maxrow=$('#tabbody tr').length-1;
ResetRow();
$("#casetable").tablesorter({debug: true});
if($("#page").val()=="scanreporting")
{
$('#tabbody tr [id*=report]').click(function (event) {
var parentRow=this.parentNode;
currow=$(parentRow).index();
curcol=$(this).index();
changeRow();
GetRowData(parentRow);
});
}
else
{
$('#tabbody tr').click(function (event) {
currow=$(this).index();
changeRow();
GetRowData(this);
});
highlightPcases();
}
}
function highlightPcases()
{
$('#tabbody tr').each(function (event) {
timei=$("#"+($(this).attr("id"))+"imei").val();
tport=$("#"+($(this).attr("id"))+"portfolio").val();
if(timei.length > 0 && tport==44)
{
$(this).css("color","#0e498f");
}
});
}
function hideSupSec(utype,reptype)
{
if (utype!="mgr" && utype!="bopr")
{
$("#divSupervisor").hide();
$("#titleSupervisor").hide();
$("#titleDedupe").hide();
$("#divDedupe").hide();
}
if($("#portfolioid").val()==81 || $("#portfolioid").val()==91) // for HDFC PFC Only, Updated on 29 June 2016
{
BypassValidation(reptype);
}
}
function BypassValidation(reptype)
{
if(reptype=='O' || reptype=='R')
{
$("#divGeneral").hide();
$("#divObservation").hide();
$("#divNeighbour").hide();
$("#divOther").hide();
$("#remarks").val("PFC CASE - AUTO UPDATED BY SYSTEM");
if(reptype=='O')
{
$("#divSaldetails").hide();
$("#divSelfempdetails").hide();
}
$("#status").val("Closed");
}
$("#addrconfd").val("No");
$("#changeinadd").val("No");
$("#correctaddr").val("PFC CASE - AUTO UPDATED BY SYSTEM");
if(reptype=='P')
{
$("#widaddconf").hide();
$("#widciadd").hide();
$("#widcadd").hide();
//$("#widvisdate").hide();
//$("#widvistime").hide();
$("#gendetlabel").text("Telecalling");
$("#lblobservation").text("PFC Collection");
$("#lblotherdet").text("Receipt Details");
$("#lblvcomment").html("Verifier's Remarks - Residence");
$("#widvopinion").hide();
$("#widdoubtfull").hide();
$("#widpollinks").hide();
$("#widifpol").hide();
$("#widrlevel").hide();
$("#widrremarks").hide();
$("#widalert").hide();
$("#widalertrem").hide();
$("#widocl").hide();
$("#widlimit").hide();
$("#widsadd").hide();
}
$("#veropinion").val("No");
$("#redalert").val("No");
$("#isocl").val("No");
$("#issameadd").val("No");
}
function setLostFocus()
{
$('#formcontainer :input').focusout(function(){
$("#lastfocused").val(this.id);
});
}
function setFocOnControl()
{
var elId=$("#lastfocused").val();
$("#"+elId).focus();
$('html, body').animate({scrollTop: $("#"+elId).offset().top-170}, 100);
$("#"+elId).addClass('highlight');
setTimeout(
function() { $("#"+elId).removeClass('highlight'); },
4000
);
}
function ResetRow()
{
currow=0;
curcol=13;
precol=16;
lastrow=maxrow;
changeRow();
}
function GetRowData(SelectedRow)
{
rowId=$(SelectedRow).attr('id');
tempStr='';
if($('#page').val()=="scanreporting")
{
suffix=$(SelectedRow).find('td').eq(curcol).attr('id').replace('report','');
tempStr=$(SelectedRow).find('td').eq(curcol).html();
}
else
{
suffix=$("#"+rowId+"visit").val().toLowerCase();
}
suffix = (suffix=='fdo' ? 'fd':suffix);
if(tempStr.search('>X<')==-1)
{
checkLock($("#"+rowId+"uuid").val(),suffix.toUpperCase());
}
}
function checkLock(uuid,report)
{
QryStr="val0="+uuid+"&val1="+report+"&val2="+$("#usid").val();
RunAjax("GET","checklock",QryStr,1);
}
function AfterResponse(AjaxResponse,OprID)
{
if(OprID==1)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else if(AjaxResponse.search('lockfree')>=0)
{
openReport();
}
else
{
CallMessage('2001LOCK:Info:Report is currently locked by '+AjaxResponse,3000,200,300);
}
}
if(OprID==2)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
}
if(OprID==3)
{
document.getElementById("DedupeSection").innerHTML="";
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else if(AjaxResponse.search('Dedupe not to be done')>=0)
{
var eardiv=document.createElement("div");
eardiv.setAttribute("class","FormPanel");
eardiv.setAttribute("style", "width:97%;text-align:center;overflow:auto;height:auto;padding:10px");
eardiv.innerHTML=AjaxResponse;
document.getElementById("DedupeSection").appendChild(eardiv);
}
else
{
var divheight="100px";
resparr=AjaxResponse.split(ColDelim);
var eardiv=document.createElement("div");
eardiv.innerHTML=resparr[0];
if(resparr[0].toUpperCase().search("NO EARLIER MATCH FOUND")>=0)
{
divheight="auto";
}
eardiv.setAttribute("class","FormPanel");
eardiv.setAttribute("style", "width:97%;overflow:auto;height:"+divheight+";padding:10px");
divheight="100px";
if(resparr[0].toUpperCase().search("NO NEGATIVE MATCH FOUND")>=0)
{
divheight="auto";
}
var negdiv=document.createElement("div");
negdiv.setAttribute("class","FormPanel");
negdiv.setAttribute("style", "width:97%;overflow:auto;height:"+divheight+";padding:10px");
negdiv.innerHTML=AjaxResponse.split(ColDelim)[1];
document.getElementById("DedupeSection").appendChild(eardiv);
document.getElementById("DedupeSection").appendChild(negdiv);
}
}
if(OprID==4)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else
{
showApplicants(AjaxResponse);
}
}
if(OprID==5)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else
{
var pordbranch=AjaxResponse.split(ColDelim);
$("#branch").html(pordbranch[0]);
$("#productid").html(pordbranch[1]);
}
}
if(OprID==6)// Update QC Feedback
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else
{
ClrFieldsRemoveDiag('optDiv',document.getElementById('inptDialog'));
}
}
if(OprID==7)// Get QC Feedback
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
DrawQCFeedbackDiag('0');
}
else
{
DrawQCFeedbackDiag(AjaxResponse);
}
}
if(OprID==8)// Get DOC Remarks
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else if(AjaxResponse.trim()=='')
{
CallMessage('No documents found or remarks are not updated yet.',3000,200,300);
}
else
{
$("#remarks").val(($("#remarks").val()+" "+AjaxResponse).trim());
}
}
if(OprID==101)
{
if(AjaxResponse.search('Error')>=0)
{
if(AjaxResponse.search('NULST')>=0)
{
CallMessage('2001:Info:No records found.',3000,200,300);
}
else
{
CallMessage('2001:Info:Fetching report editor list failed. '+AjaxResponse,3000,200,300);
}
}
else
{
showEditorList(AjaxResponse, "Report Editors");
}
}
if(OprID==102)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage('2001LOCK:Info:Fetching contact numbers failed. '+AjaxResponse,3000,200,300);
}
else
{
showContactNos(AjaxResponse);
}
}
if(OprID==106)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage('2001LOCK:Info:Fetching contact numbers failed. '+AjaxResponse,3000,200,300);
$("#btnajaxproc").attr("value",AjaxResponse);
$("#btnajaxproc").attr("id","btndoubtfull");
}
else
{
$("#btnajaxproc").prop( "onclick", null );
$("#btnajaxproc").attr("value","Request sent successfully");
$("#btnajaxproc").attr("id","btnok");
}
}
if(OprID==107)
{
if(AjaxResponse.search('Error')>=0)
{
$("#btnajaxproc").attr("value",AjaxResponse);
}
else
{
$("#btnajaxproc").attr("value",AjaxResponse);
$("#btnajaxproc").prop("onclick", null );
$("#btnajaxproc").attr("id","btndoubtfull");
window.returnValue=1;
window.close();
}
}
if(OprID==108)
{
if(AjaxResponse.trim()!='')
{
var cols=AjaxResponse.split(ColDelim);
if(cols.length > 1)
{
$("#btnautorem").show();
autorem_vals=cols[1].split(",");
autorem_temp=cols[0];
}
}
}
if(OprID==109)
{
if(AjaxResponse.trim()!='')
{
rows=AjaxResponse.split(RowDelim);
nov = rows.length-1;
var respHtml='<select id="verlist" style="width:118px">';
var rindx=0;
for(rindx=0;rindx<nov;rindx++)
{
respHtml=respHtml+'<option value="'+rows[rindx].split(ColDelim)[0].trim()+'">'+rows[rindx].split(ColDelim)[1].split('|')[0].trim()+'</option>';
}
respHtml=respHtml+'</select>';
respHtml=respHtml.replace('value="'+verid+'"', "value="+verid+" selected");
UpdateVer(respHtml);
}
}
if(OprID==110)
{
if(AjaxResponse.trim()!='success')
{
RemoveDialog(document.getElementById('inptDialog'));
}
else
{
CallMessage('2001LOCK:Info:Case transfered successfully!',3000,200,300);
RemoveDialog(document.getElementById('inptDialog'));
}
}
if(OprID==111)
{
if(AjaxResponse.search('Error')>=0)
{
CallMessage(AjaxResponse,3000,200,300);
}
else
{
$("#docContainer").html(AjaxResponse);
}
}
}
function openReport()
{
var retVal=0;
var uuid=$("#"+rowId+"uuid").val();
var pid=$("#"+rowId+"portfolio").val();
QueryStr="rand="+Math.round(Math.random()*4+1)+"&uuid="+uuid+"&pid="+pid;
retVal=window.showModalDialog(suffix+"report?"+QueryStr,'',"dialogWidth:1020px; dialogHeight:800px;center:yes");
if((retVal==1 && $('#page').val()!='scanreporting') || retVal==2)
{
$("#"+rowId).remove();
lastrow=currow-1;
changeRow();
}
QryStr="val0="+uuid+"&val1="+suffix;
RunAjax("GET","freelock",QryStr,2);
}
function onReportClose(uuid,reptype)
{
QryStr="val0="+uuid+"&val1="+reptype;
RunAjax("GET","freelock",QryStr,2);
}
function keyListen(param1,param2,e) {
var keycode = e.keyCode;
if(keycode==13)
{
GetRowData($('tr:eq('+currow+')', $("#tabbody")));
}
else
{
if(keycode==40)
{
currow=currow+1;
if(currow>=$('#tabbody tr').length){currow=0;lastrow=maxrow;}
changeRow();
}
if(keycode==38)
{
currow=currow-1;
if(currow<0){currow=maxrow;lastrow=0;}
changeRow();
}
if(keycode==39) // Right Arrow
{
curcol=curcol+1;
if(curcol>18){curcol=13;precol=18;}
changeCol();
}
if(keycode==37) // Left Arrow
{
curcol=curcol-1;
if(curcol<13){curcol=18;precol=13;}
changeCol();
}
}
}
function changeRow()
{
var row=$('tr:eq('+currow+')', $("#tabbody"));
row.addClass('chover');
if(maxrow>0)
{
var lrow=$('tr:eq('+lastrow+')', $("#tabbody"));
lrow.removeClass('chover');
}
if($('#page').val()=='scanreporting')
{
changeCol();
}
lastrow=currow;
}
function changeCol()
{
var cTd=$('tr:eq('+currow+')', $("#tabbody")).find('td').eq(curcol);
cTd.addClass('selCol');
if(maxrow>=0)
{
var lTd=$('tr:eq('+lastrow+')', $("#tabbody")).find('td').eq(precol);
lTd.removeClass('selCol');
}
precol=curcol;
}
function FilterGrid(repType,targetController,formId)
{
$("#porthtml").val($("#portdiv").html());
if(repType=="opr" || repType=="bopr" || repType=="mgr")
{
if($('#verdiv').length > 0){$("#verhtml").val($("#verdiv").html());}
}
SubmitForm(targetController,'_parent',formId);
}
function FetchProdBranch(portid)
{
QryStr="val0="+portid;
RunAjax("POST","pordbranch",QryStr,5);
}
function CheckSelPorts()
{
var cond=$("#portcond").val();
totports=cond.split(' or ').length-1;
if(totports > 1)
{
ResetProdBranch();
}
}
function ResetProdBranch()
{
$("#productid").html('<option value="-1">Select</option>');
$("#branch").html('<option value="-1">Select</option>');
}
function AddFilter(el,itm)
{
var elval=$(el).val();
var widgWid=(itm=="ver" ? "width:86%":"width:93%");
var eltxt=(itm=="ver" ? $("option:selected", el).text().substring(0,2):$("option:selected", el).text());
if(elval=="-1")
{
totports=0;
$("#"+itm+"cond").val("1=1");
$("#"+itm+"div").html("");
ResetProdBranch();
}
else
{
var cond='';
var targEl=$("#"+itm+"cond");
cond=$(targEl).val();
cond=(cond=='1=1') ? '':cond;
if(!(cond.search(itm+'='+elval+' or ') >= 0))
{
cond=cond+itm+'='+elval+' or ';
if(itm=='port')
{
totports=cond.split(' or ').length-1;
ResetProdBranch();
if(totports==1)
{
FetchProdBranch(elval);
}
}
var icnWidget=document.createElement('div');
icnWidget.setAttribute('class', 'icnwidget');
icnWidget.setAttribute('style', widgWid);
icnWidget.setAttribute('title', 'remove this filter');
icnWidget.setAttribute('id', itm+elval);
icnWidget.setAttribute("onclick", "RemoveWidget(this,'"+itm+"',"+elval+")");
var text=document.createTextNode(eltxt);
icnWidget.appendChild(text);
document.getElementById(itm+'div').appendChild(icnWidget);
$(targEl).val(cond);
}
}
}
function RemoveWidget(el,itm,elval)
{
var cond='';
var targEl=$("#"+itm+"cond");
cond=$(targEl).val();
cond=cond.replace(itm+'='+$(el).attr('id').replace(itm,'')+' or ','');
if(itm=='port')
{
ResetProdBranch();
}
if(cond=='')
{
cond= '1=1';
$("#"+itm+"list").val("-1");
}
$(targEl).val(cond);
$(el).remove();
}
function ValidateSubmitReport(formId,saveMode,repType)
{
$("#iscompsave").val(saveMode);
if(saveMode==1)
{
if(repType=='r')
{
ValidateResiReport();
}
if(repType=='o')
{
ValidateOffReport();
}
if(repType=='t')
{
ValidateTeleReport();
}
if(repType=='p')
{
ValidateOthReport();
}
if(repType=='rt')
{
ValidateRTReport();
}
if(repType=='fd')
{
ValidateFDReport();
}
if(checkForm())
{
SubmitForm(repType+'reportsave', '_parent', formId);
}
else
{
alert("There are one or more errors in page. Please fill all required fields.");
}
}
else
{
SubmitForm(repType+'reportsave', '_parent', formId);
}
}
function FindByAppno(visit)
{
QueryStr="val0="+$("#applno").val()+"&val1="+$("#portfolioid").val()+"&val2="+visit+"&val3="+$("#uuid").val();
RunAjax('POST','findbyappno', QueryStr, 4);
}
function showApplicants(responseHtml)
{
var optDiv=document.createElement("div");
optDiv.setAttribute("id","optDiv");
optDiv.setAttribute("class","FormPanel");
optDiv.setAttribute("style","font-family:Tahoma;overflow:visible");
var OptionPanel="<table border='0' cellspacing='0' id='FormControls'><tr><td>";
OptionPanel=OptionPanel+""+responseHtml;
OptionPanel=OptionPanel+"</td></tr><tr><td colspan='3'><input type='button' class='button' name='btncancel' style='margin-top:10px;float:right' value='Close' id='btncancel' accesskey='C' onclick=\"document.getElementById('inptDialog').parentNode.removeChild(document.getElementById('inptDialog'));\"";
OptionPanel=OptionPanel+"</table>";
optDiv.innerHTML=OptionPanel;
ShowInputDialog(optDiv,"Match Found","hint","inptDialog");
}
function copyReport(visit,cuuid)
{
$("#cuuid").val(cuuid);
SubmitForm('copy'+visit+'report', '_parent', document.forms[0].name);
}
function fetchDedupe()
{
$("#DedupeSection").html("<div style='width:98%;text-align:center'><b>Loading</b> <img src='/matrix/images/loading.gif' align='absmiddle' /></div>");
var usid=$("#usid").val();
var uuid=$("#uuid").val();
QueryStr="val0="+uuid+"&val1="+usid;
RunAjax('GET','fetchdedupe', QueryStr, 3);
}
function callkeydownhandler(evnt) {
ev = (evnt) ? evnt : event;
keyListen('','',ev);
}
if (window.document.addEventListener) {
window.document.addEventListener("keydown", callkeydownhandler, false);
} else {
window.document.attachEvent("onkeydown", callkeydownhandler);
}
function ValidateResiReport()
{
//validate(document.getElementById("addrconfd"),'t','');
if(document.getElementById("addrconfd").value!='-1')
{
validate(document.getElementById("changeinadd"),'t','');
validate(document.getElementById("correctaddr"),'t','Remarks');
}
if(document.getElementById("addrconfd").value=='Yes')
{
validate(document.getElementById("visitdate"),'t','Date');
validate(document.getElementById("visittime"),'t','Time');
validate(document.getElementById("metperson"),'t','Remarks');
validate(document.getElementById("metrela"),'t','');
if(document.getElementById("metrela").value=='Others')
{
validate(document.getElementById("metrelaoth"),'t','Remarks');
}
if(document.getElementById("owner").value=='Others')
{
validate(document.getElementById("owneroth"),'t','Remarks');
}
if(document.getElementById("proof").value=='Yes')
{
validate(document.getElementById("proofdet"),'t','Remarks');
}
validate(document.getElementById("access"),'t','');
validate(document.getElementById("accmode"),'t','');
validate(document.getElementById("locality"),'t','');
if(document.getElementById("locality").value=='Others')
{
validate(document.getElementById("locaoth"),'t','SplInstruction');
}
validate(document.getElementById("carpetarea"),'t','SplInstruction');
validate(document.getElementById("socboard"),'t','');
if(document.getElementById("socboard").value=='Yes')
{
validate(document.getElementById("socboarddet"),'t','SplInstruction');
}
validate(document.getElementById("restype"),'t','');
if(document.getElementById("restype").value=='Others')
{
validate(document.getElementById("typeoth"),'t','SplInstruction');
}
validate(document.getElementById("construction"),'t','');
if(document.getElementById("construction").value=='Others')
{
validate(document.getElementById("constoth"),'t','SplInstruction');
}
validate(document.getElementById("nameplate"),'t','');
if(document.getElementById("nameplate").value=='Yes')
{
validate(document.getElementById("platedet"),'t','SplInstruction');
}
if(document.getElementById("interior").value!='-1')
{
validate(document.getElementById("furlevel"),'t','');
}
validate(document.getElementById("doubtfull"),'t','');
validate(document.getElementById("political"),'t','');
if(document.getElementById("political").value=='Yes')
{
validate(document.getElementById("politicdet"),'t','Remarks');
}
validate(document.getElementById("risklevel"),'t','');
if(document.getElementById("risklevel").value!='-1')
{
validate(document.getElementById("riskremarks"),'t','Remarks');
}
}
validate(document.getElementById("verremarks"),'t','Remarks');
validate(document.getElementById("veropinion"),'t','');
if(document.getElementById("utype").value=='mgr')
{
var stat=document.getElementById("status");
validate(stat,'t','');
if(stat.value.toUpperCase()=='NOT RECOMMENDED' || stat.value.toUpperCase()=='NEGATIVE')
{
validate(document.getElementById("negreason"),'t','');
}
validate(document.getElementById("remarks"),'t','Remarks');
validate(document.getElementById("redalert"),'t','');
if(document.getElementById("redalert").value=='Yes')
{
validate(document.getElementById("alertrem"),'t','Remarks');
}
validate(document.getElementById("isocl"),'t','');
if(document.getElementById("isocl").value=='Yes')
{
validate(document.getElementById("distance"),'t','SplInstruction');
}
validate(document.getElementById("issameadd"),'t','');
}
ValidateHdfcCCPhoto();
}
function ValidateHdfcCCPhoto()
{
if(document.getElementById("utype").value=='opr')
{
if(document.getElementById("portfolioid").value==44)
{
validate(document.getElementById("Field15_1"),'t','');
}
}
}
function ValidateOffReport()
{
//validate(document.getElementById("addrconfd"),'t','');
if(document.getElementById("addrconfd").value!='-1')
{
validate(document.getElementById("changeinadd"),'t','');
validate(document.getElementById("correctaddr"),'t','Remarks');
}
if(document.getElementById("addrconfd").value=='Yes')
{
validate(document.getElementById("visitdate"),'t','Date');
validate(document.getElementById("visittime"),'t','Time');
validate(document.getElementById("metperson"),'t','Remarks');
validate(document.getElementById("metrela"),'t','');
if(document.getElementById("metrela").value=='Others')
{
validate(document.getElementById("metrelaoth"),'t','Remarks');
}
if(document.getElementById("appdesign").value=='Others')
{
validate(document.getElementById("appdesignoth"),'t','SplInstruction');
}
if(document.getElementById("compprof").value=='Others')
{
validate(document.getElementById("compprofoth"),'t','Remarks');
}
validate(document.getElementById("appcategory"),'t','');
validate(document.getElementById("bizboard"),'t','');
validate(document.getElementById("locality"),'t','');
if(document.getElementById("locality").value=='Others')
{
validate(document.getElementById("locaoth"),'t','SplInstruction');
}
validate(document.getElementById("easeloc"),'t','');
if(document.getElementById("ownership").value=='Others')
{
validate(document.getElementById("owneroth"),'t','Remarks');
}
validate(document.getElementById("doubtfull"),'t','');
validate(document.getElementById("political"),'t','');
if(document.getElementById("political").value=='Yes')
{
validate(document.getElementById("politicdet"),'t','Remarks');
}
validate(document.getElementById("risklevel"),'t','');
if(document.getElementById("risklevel").value!='-1')
{
validate(document.getElementById("riskremarks"),'t','Remarks');
}
}
validate(document.getElementById("verremarks"),'t','Remarks');
validate(document.getElementById("veropinion"),'t','');
if(document.getElementById("utype").value=='mgr')
{
var stat=document.getElementById("status");
validate(stat,'t','');
if(stat.value.toUpperCase()=='NOT RECOMMENDED' || stat.value.toUpperCase()=='NEGATIVE')
{
validate(document.getElementById("negreason"),'t','');
}
validate(document.getElementById("remarks"),'t','Remarks');
validate(document.getElementById("redalert"),'t','');
if(document.getElementById("redalert").value=='Yes')
{
validate(document.getElementById("alertrem"),'t','Remarks');
}
validate(document.getElementById("isocl"),'t','');
if(document.getElementById("isocl").value=='Yes')
{
validate(document.getElementById("distance"),'t','SplInstruction');
}
validate(document.getElementById("issameadd"),'t','');
}
ValidateHdfcCCPhoto();
}
function ValidateTeleReport()
{
if($("#raddr").length > 0)
{
validate(document.getElementById("rcontno"),'t','Phone');
validate(document.getElementById("rcontacted"),'t','');
if(document.getElementById("rcontacted").value=='Yes')
{
validate(document.getElementById("rcontpers"),'t','Remarks');
validate(document.getElementById("rcontrela"),'t','');
if(document.getElementById("rcontrela").value=='Others')
{
validate(document.getElementById("rcontrelaoth"),'t','Remarks');
}
if(document.getElementById("rowner").value=='Others')
{
validate(document.getElementById("rowneroth"),'t','Remarks');
}
validate(document.getElementById("rnameconfd"),'t','');
validate(document.getElementById("loanappconfd"),'t','');
validate(document.getElementById("raddrconfd"),'t','');
}
else
{
validate(document.getElementById("rnotcontres"),'t','');
}
validate(document.getElementById("rtotattempt"),'t','');
validate(document.getElementById("rattempt1"),'t','Date');
validate(document.getElementById("rtime1"),'t','Time');
validate(document.getElementById("rstatus1"),'t','');
validate(document.getElementById("roverallstat"),'t','');
validate(document.getElementById("rremarks"),'t','Remarks');
}
if($("#oaddr").length > 0)
{
validate(document.getElementById("ocontno"),'t','Phone');
validate(document.getElementById("ocontacted"),'t','');
if(document.getElementById("ocontacted").value=='Yes')
{
validate(document.getElementById("ocontpers"),'t','Remarks');
validate(document.getElementById("ocontrela"),'t','');
if(document.getElementById("ocontrela").value=='Others')
{
validate(document.getElementById("ocontrelaoth"),'t','Remarks');
}
if(document.getElementById("odesign").value=='Others')
{
validate(document.getElementById("odesignoth"),'t','SplInstruction');
}
if(document.getElementById("onob").value=='Others')
{
validate(document.getElementById("onoboth"),'t','Remarks');
}
validate(document.getElementById("onameconfd"),'t','');
validate(document.getElementById("oaddrconfd"),'t','');
}
else
{
validate(document.getElementById("onotcontres"),'t','');
}
validate(document.getElementById("oattempt"),'t','');
validate(document.getElementById("oattempt1"),'t','Date');
validate(document.getElementById("otime1"),'t','Time');
validate(document.getElementById("ostatus1"),'t','');
validate(document.getElementById("ooverallstat"),'t','');
validate(document.getElementById("oremarks"),'t','Remarks');
}
}
function ValidateOthReport()
{
validate(document.getElementById("addrconfd"),'t','');
if(document.getElementById("addrconfd").value!='-1')
{
validate(document.getElementById("changeinadd"),'t','');
validate(document.getElementById("correctaddr"),'t','Remarks');
}
if($("#portfolioid").val()==81 || $("#portfolioid").val()==91) // for HDFC PFC Only, Updated on 29 June 2016
{
validate(document.getElementById("visitdate"),'t','Date');
}
if(document.getElementById("addrconfd").value=='Yes')
{
validate(document.getElementById("visitdate"),'t','Date');
validate(document.getElementById("visittime"),'t','Time');
validate(document.getElementById("doubtfull"),'t','');
validate(document.getElementById("political"),'t','');
if(document.getElementById("political").value=='Yes')
{
validate(document.getElementById("politicdet"),'t','Remarks');
}
validate(document.getElementById("risklevel"),'t','');
if(document.getElementById("risklevel").value!='-1')
{
validate(document.getElementById("riskremarks"),'t','Remarks');
}
}
validate(document.getElementById("verremarks"),'t','Remarks');
validate(document.getElementById("veropinion"),'t','');
if(document.getElementById("utype").value=='mgr')
{
var stat=document.getElementById("status");
validate(stat,'t','');
if(stat.value.toUpperCase()=='NOT RECOMMENDED' || stat.value.toUpperCase()=='NEGATIVE')
{
validate(document.getElementById("negreason"),'t','');
}
validate(document.getElementById("remarks"),'t','Remarks');
validate(document.getElementById("redalert"),'t','');
if(document.getElementById("redalert").value=='Yes')
{
validate(document.getElementById("alertrem"),'t','Remarks');
}
validate(document.getElementById("isocl"),'t','');
if(document.getElementById("isocl").value=='Yes')
{
validate(document.getElementById("distance"),'t','SplInstruction');
}
validate(document.getElementById("issameadd"),'t','');
}
}
function ValidateFDReport()
{
var stat=document.getElementById("overallstatus");
validate(stat,'t','');
}
function ValidateRTReport()
{
var stat1=document.getElementById("ref1status");
var rem1=document.getElementById("ref1remarks");
var stat2=document.getElementById("ref2status");
var rem2=document.getElementById("ref2remarks");
var ref1=document.getElementById("refcontactno1");
var ref2=document.getElementById("refcontactno2");
if(ref1.value !='' && ref1.value.trim().length > 5)
{
validate(stat1,'t','');
validate(rem1,'t','Remarks');
}
if(ref2.value !='' && ref2.value.trim().length > 5)
{
validate(stat2,'t','');
validate(rem2,'t','Remarks');
}
}
function CheckLoan(lamt,prod)
{
prod=prod.toUpperCase();
if(Number(lamt) >= 500000 && (prod.search('AUTO LOAN')>-1 || prod=='AL' || prod=='CAR LOAN' || prod=='TW LOAN' || prod=='TWO WHEELER LOAN'))
{
return true;
}
else if(Number(lamt) >= 3000000 && (prod=='HOME LOAN' || prod=='HL' || prod.search('MORTGAGE')>-1 || prod=='LAP'))
{
return true;
}
else
{
return false;
}
}
function FilterNegReason(elm)
{
var val=$(elm).val().trim();
var port=$("#portfolioid").val();
if(port==65)
{
if(val != '-1')
{
$("#negreason > option").each(function() {
if(this.value.search(val+'-') > -1)
{
$(this).show();
}
else
{
if(this.value != '-1')
{
$(this).hide();
}
}
});
}
else
{
$("#negreason > option").each(function() {
$(this).show();
});
}
$("#negreason").val('-1');
}
}
function NegRepCalc()
{
var res=0;
var off=0;
var prop=0;
$("#pending").val(maxrow+1);
$('#tabbody tr [id*=visit]').each(function () {
if($(this).val()=='R'){res=res+1;}
else if($(this).val()=='O'){off=off+1;}
else if($(this).val()=='P'){prop=prop+1;}
});
$("#totresi").val(res);
$("#totoff").val(off);
$("#totprop").val(prop);
}
function fetchAutorem(pid,rtype,cat)
{
autorem_temp="";
autorem_vals= new Array(1);
RunAjax('POST','fetchautorem', "pid="+pid+"&rtype="+rtype+"&cat="+cat, 108); //108 reserved for fetching Hard Copy details
}
function AutoRemarks()
{
$("#remarks").val("");
var mulvals= new Array(1);
var tval="";
var indx=0;
if(autorem_temp != "")
{
var autorem=autorem_temp;
for(indx = autorem_vals.length-1; indx >= 0; indx--)
{
mulvals=autorem_vals[indx].split("-");
tval=$("#"+mulvals[0]).val();
if(mulvals.length > 1 && tval=="Others")
{
tval=$("#"+mulvals[1]).val();
}
else
{
tval=$("#"+mulvals[0]).val();
}
autorem=autorem.replace("<<Mf13ld-"+indx+">>",tval);
}
$("#remarks").val(autorem.toUpperCase());
}
}
function DisableFields(fields,elm,keyVal)
{
var flist= new Array(1);
flist=fields.split(",");
var indx=0;
for(indx = flist.length-1; indx >= 0; indx--)
{
keyVal.search($(elm).val()) > -1 ? $("#"+flist[indx]).show():$("#"+flist[indx]).hide();
}
}
function triggers(vistype) //25 Apr 2016
{
var trigs=document.getElementById("triggers");
if(vistype=='O')
{
if(document.getElementById("appcategory").value=='Salaried')
{
trigs.value = document.getElementById("sal_area").value == 'Negative' || document.getElementById("sal_area").value == 'Low Income' ? document.getElementById("sal_area").value+" Area":"";
if((document.getElementById("sal_area").value == 'Negative' || document.getElementById("sal_area").value == 'Low Income') && document.getElementById("ownership").value.toUpperCase().search("RENT") > -1)
{
trigs.value = trigs.value.length > 0 ? trigs.value+", Rented Premises" : "Rented Premises";
}
}
else
{
trigs.value = document.getElementById("se_area").value == 'Negative' || document.getElementById("se_area").value == 'Low Income' ? document.getElementById("se_area").value+" Area":"";
if(document.getElementById("ownership").value.toUpperCase().search("RENT") > -1)
{
trigs.value = trigs.value.length > 0 ? trigs.value+", Rented Premises" : "Rented Premises";
}
}
if(document.getElementById("rco").value == '1' && document.getElementById("ownership").value.toUpperCase().search("RENT") > -1)
{
trigs.value = trigs.value.length > 0 ? trigs.value+", RCO and Rented Premises" : "RCO and Rented Premises";
}
}
else
{
trigs.value = trigs.value = document.getElementById("res_area").value == 'Negative' || document.getElementById("res_area").value == 'Low Income' ? document.getElementById("res_area").value+" Area":"";
if(document.getElementById("metrela").value == 'Others')
{
trigs.value = trigs.value.length > 0 ? trigs.value+", Met person is not a family member" : "Met person is not a family member";
}
if(document.getElementById("rco").value == '1' && document.getElementById("owner").value.toUpperCase().search("RENT") > -1)
{
trigs.value = trigs.value.length > 0 ? trigs.value+", RCO and Rented Premises" : "RCO and Rented Premises";
}
}
}
function ChangeVerifier(vid)
{
verid=vid;
RunAjax('GET','verlist', "bid=1", 109);
}
function UpdateVer(verlist)
{
var optDiv=document.createElement("div");
optDiv.setAttribute("id","optDiv");
optDiv.setAttribute("class","FormPanel");
optDiv.setAttribute("style","font-family:Tahoma;overflow:visible;padding-right:15px;width:315px");
var OptionPanel="<table border='0' cellspacing='0' width='100%' id='FormControls'><tr><td>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Verifier</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<div class=\"divselect\" id=\"divverlist\" style=\"width:100px;\">";
OptionPanel=OptionPanel+verlist;
OptionPanel=OptionPanel+"</div></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Verifier</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<div class=\"divselect\" id=\"divvisit\" style=\"width:100px;\"><select id=\"tvisit\" onblur=\"validate(this,'f','');\" style=\"width:118px\">";
OptionPanel=OptionPanel+"<option value=\"RV\" selected>RESI</option>";
OptionPanel=OptionPanel+"<option value=\"OV\">OFFICE</option></select>";
OptionPanel=OptionPanel+"</div></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\" style=\"text-transform: none;padding-bottom:5px\">&nbsp;&nbsp;SMS</div>";
OptionPanel=OptionPanel+"<div class=\"inputcontainer\" style=\"width:24px;padding-bottom:5px\"><input id=\"sms1\" name=\"sms1\" type=\"checkbox\"></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\" style=\"padding-bottom:5px\">Special Instruction</div><br />";
OptionPanel=OptionPanel+"<div class=\"inputcontainer\" style=\"padding-bottom:5px\"><input id=\"dsplinst\" name=\"dsplinst\" style=\"width:300px\" type=\"textbox\" maxlength=\"100\"></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">";
OptionPanel=OptionPanel+"<input type='button' class='button' name='btncancel' style='margin-top:5px;float:right;margin-left:5px' value='Close' id='btncancel' accesskey='C' onclick=\"RemoveDialog(document.getElementById('inptDialog'));\" />";
OptionPanel=OptionPanel+"<input type='button' class='button' name='btntransfer' style='margin-top:5px;float:right' value='Transfer' id='btntransfer' accesskey='T' onclick=\"InitiateTransfer(document.getElementById('inptDialog'),document.getElementById('verlist').value,document.getElementById('sms1').checked,document.getElementById('dsplinst').value,document.getElementById('tvisit').value,this);\" /></div></div>";
OptionPanel=OptionPanel+"</td></tr>";
OptionPanel=OptionPanel+"</table>";
optDiv.innerHTML=OptionPanel;
ShowInputDialog(optDiv,"Transfer Case","hint","inptDialog");
}
function InitiateTransfer(dialg,vid,issms,spinst,tvisit,sender)
{
//if(vid==verid){ alert('Cannot transfer to same verifier. Please change verifier');return false;}
var pid=$('#portfolioid').val();
var usid=$('#usid').val();
var uuid=$('#uuid').val();
issms=issms ? 1:0;
$(sender).css("background","url('/matrix/images/loading_circle.gif') 4px center no-repeat");
$(sender).val("Transfering...");
QueryStr="val0="+pid+"&val1="+uuid+"&val2="+verid+"&val3="+vid+"&val4="+issms+"&val5="+spinst+"&val6="+usid+"&val7="+tvisit;
RunAjax('POST','transfersinglevisit', QueryStr, 110);
}
function fetchDocs(uuid,vtype)
{
RunAjax('POST','fetchtaggeddocs', "uuid="+$("#uuid").val()+"&vtype="+vtype, 111);
}
/*function tagDocuments(vtype)
{
var uuid=$("#uuid").val();
$("#duuid").val(uuid);
$("#vtype").val(vtype);
$("#dport").val($("#portfolioid").val());
var optDiv=document.createElement("div");
optDiv.setAttribute("id","optDiv");
optDiv.setAttribute("class","FormPanel");
optDiv.setAttribute("style","font-family:Tahoma;overflow:visible;padding-right:15px;width:355px");
var OptionPanel="<table border='0' cellspacing='0' width='100%' id='FormControls'><tr><td>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Doc Type</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<div class=\"divselect\" id=\"divdtype\" style=\"width:180px;\"><select id=\"dtype1\" onblur=\"validate(this,'f','');\" style=\"width:198px\">";
OptionPanel=OptionPanel+"<option value=\"REPORT ATTACHMENT\" >REPORT ATTACHMENT</option>";
OptionPanel=OptionPanel+"<option value=\"POV\" selected>POV</option>";
OptionPanel=OptionPanel+"<option value=\"OFF ADD PROOF\" >OFF ADD PROOF</option>";
OptionPanel=OptionPanel+"<option value=\"RES ADD PROOF\" >RES ADD PROOF</option>";
OptionPanel=OptionPanel+"<option value=\"KYC DOC\" >KYC DOC</option>";
OptionPanel=OptionPanel+"<option value=\"BANK STATEMENT\" >BANK STATEMENT</option>";
OptionPanel=OptionPanel+"<option value=\"FINANCIALS\" >FINANCIALS</option>";
OptionPanel=OptionPanel+"<option value=\"OTHERS\">OTHERS</option></select>";
OptionPanel=OptionPanel+"</div></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\"><input type='button' class='button' name='btntag' style='margin-top:5px;float:right;margin-left:5px' value='Tag' id='btntag' accesskey='T' onclick=\"$('#dtype').val($('#dtype1').val());getFile();\" /></div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"</div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div id=\"docContainer\" class=\"lblcontainer\" style=\"padding-bottom:5px;width:355px\">fetching documents please wait...</div></div>";
OptionPanel=OptionPanel+"<input type='button' class='button' name='btncancel' style='margin-top:5px;float:right;margin-right:15px' value='Close' id='btncancel' accesskey='C' onclick=\"RemoveDialog(document.getElementById('inptDialog'));\" />";
OptionPanel=OptionPanel+"</td></tr>";
OptionPanel=OptionPanel+"</table>";
optDiv.innerHTML=OptionPanel;
ShowInputDialog(optDiv,"Tag Documents","hint","inptDialog");
fetchDocs(uuid,vtype);
} OLD CODE*/
function tagDocs(vtype)
{
var uuid=$("#uuid").val();
QueryStr="rand="+Math.round(Math.random()*4+1)+"&uuid="+uuid+"&type="+vtype+"&pid="+($("#portfolioid").val())+"&photo="+($("#requiredphoto").val())+"&mvcode="+($("#mvcode").val());
retVal=window.showModalDialog("tagdocs?"+QueryStr,'',"dialogWidth:980px; dialogHeight:800px;center:yes");
}
function validateBeforeUpload()
{
getFile();
}
function showPreview(elm)
{
if(document.getElementById('prevDiv') !== null)
{
$("#prevDiv").remove();
}
var optDiv=document.createElement("div");
optDiv.setAttribute("id","prevDiv");
optDiv.innerHTML = "<img src='"+($(elm).attr("img"))+"' />";
document.body.appendChild(optDiv);
$("#prevDiv").attr("style","position:absolute;height:auto;width:auto;z-index:20");
$("#prevDiv").attr("ondblclick","$('#prevDiv').remove()");
centerDivBoth(optDiv,'B');
}
function UpdateFeedback(visit)
{
RunAjax('POST','getQCFeedback', "uuid="+$("#uuid").val()+"&vtype="+visit, 7);
}
function DrawQCFeedbackDiag(vals)
{
var valarr = new Array(8);
if(vals!='0')
{
valarr = vals.split(ColDelim);
}
var optDiv=document.createElement("div");
optDiv.setAttribute("id","optDiv");
optDiv.setAttribute("class","FormPanel");
optDiv.setAttribute("style","font-family:Tahoma;overflow:visible;padding-right:15px;width:350px");
var OptionPanel="<table border='0' cellspacing='0' width='100%' id='FormControls'><tr><td>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Visit Confd</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<div class=\"divselect\" id=\"divqc_vconfd\" style=\"width:65px;\"><select id=\"qc_vconfd\" onblur=\"validate(this,'f','');\" style=\"width:83px\">";
OptionPanel=OptionPanel+"<option value=\"-1\" >NA</option>";
OptionPanel=OptionPanel+"<option value=\"YES\" "+(valarr[1]=='YES' ? 'selected':'')+">YES</option>";
OptionPanel=OptionPanel+"<option value=\"NO\" "+(valarr[1]=='NO' ? 'selected':'')+">NO</option></select>";
OptionPanel=OptionPanel+"</div></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Integrity Issue</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<div class=\"divselect\" id=\"divqc_intiss\" style=\"width:65px;\"><select id=\"qc_intiss\" onblur=\"validate(this,'f','');\" style=\"width:83px\">";
OptionPanel=OptionPanel+"<option value=\"-1\" >NA</option>";
OptionPanel=OptionPanel+"<option value=\"YES\" "+(valarr[2]=='YES' ? 'selected':'')+">YES</option>";
OptionPanel=OptionPanel+"<option value=\"NO\" "+(valarr[2]=='NO' ? 'selected':'')+">NO</option></select>";
OptionPanel=OptionPanel+"</div></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Contacted No</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<input type=\"text\" id=\"qc_contactedno\" value=\""+(typeof valarr[3]=='undefined' ? '' : valarr[3])+"\" name=\"qc_contactedno\" style=\"width:225px\" onblur=\"validate(this,'f','SplInstruction')\" />";
OptionPanel=OptionPanel+"</div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Contacted Person</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<input type=\"text\" id=\"qc_contpers\" value=\""+(typeof valarr[4]=='undefined' ? '' : valarr[4])+"\" name=\"qc_contpers\" style=\"width:193px\" onblur=\"validate(this,'f','SplInstruction')\" />";
OptionPanel=OptionPanel+"</div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Remarks</div><br /><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<textarea id=\"qc_remakrs\" rows=\"3\" style=\"width:332px\" name=\"qc_remakrs\" onblur=\"validate(this,'t','Remarks')\" >"+(typeof valarr[5]=='undefined' ? '' : valarr[5])+"</textarea>";
OptionPanel=OptionPanel+"</div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Risk</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<div class=\"divselect\" id=\"divqc_risk\" style=\"width:302px;\"><select id=\"qc_risk\" onblur=\"validate(this,'f','');\" style=\"width:320px\">";
OptionPanel=OptionPanel+($("#risklevel").html());
OptionPanel=OptionPanel+"</select>";
OptionPanel=OptionPanel+"</div></div></div>";
OptionPanel=OptionPanel+"<div class=\"widget\"><div class=\"lblcontainer\">Dailed From</div><div class=\"inputcontainer\">";
OptionPanel=OptionPanel+"<input type=\"text\" id=\"qc_dialfrom\" value=\""+(typeof valarr[6]=='undefined' ? '' : valarr[6])+"\" name=\"qc_dialfrom\" style=\"width:233px\" onblur=\"validate(this,'t','Phone')\" />";
OptionPanel=OptionPanel+"</div></div><br />";
OptionPanel=OptionPanel+"<button class='button' name='btncancel' style='margin-top:5px;float:right;margin-right:15px' value='Close' id='btncancel' accesskey='C' onclick=\"ClrFieldsRemoveDiag('optDiv',document.getElementById('inptDialog'));\" >Cancel</button>";
OptionPanel=OptionPanel+"<button class='button' name='btnsave' style='margin-top:5px;float:right;margin-right:15px' value='Save' id='btnsave' accesskey='S' onclick=\"UpdateQCRemarks('optDiv',document.getElementById('inptDialog'),'"+valarr[0]+"');\" >Save</button>";
OptionPanel=OptionPanel+"</td></tr>";
OptionPanel=OptionPanel+"</table>";
optDiv.innerHTML=OptionPanel;
ShowInputDialog(optDiv,"QC Feedback","hint","inptDialog");
if(typeof valarr[7]!='undefined')
{
$("#qc_risk").val(valarr[7]);
}
}
function UpdateQCRemarks(divID,diag,visit)
{
var $inputs = $('#'+divID).find('input,textarea');
$inputs.trigger('blur');
if(checkForm())
{
var vconf=$("#qc_vconfd").val();
var intiss=$("#qc_intiss").val();
var risk = $("#qc_risk").val();
var dfrom = encodeURIComponent($("#qc_dialfrom").val());
var contno=encodeURIComponent($("#qc_contactedno").val());
var contp=encodeURIComponent($("#qc_contpers").val());
var qcrem=encodeURIComponent($("#qc_remakrs").val());
RunAjax('POST','updateQCremarks', "uuid="+$("#uuid").val()+"&vtype="+visit+"&vconf="+vconf+"&intiss="+intiss+"&contno="+contno+"&contp="+contp+"&qcrem="+qcrem+"&usid="+($("#usid").val())+"&dfrom="+dfrom+"&risk="+risk, 6);
}
}
function ClrFieldsRemoveDiag(divID,diag)
{
var $inputs = $('#'+divID).find('input,textarea');
$inputs.val("");
$txtarea = $('#'+divID).find('textarea');
$("#qc_dialfrom").attr("onblur","validate(this,'f','')");
$txtarea.attr("onblur","validate(this,'f','')");
$inputs.trigger('blur');
RemoveDialog(diag);
}
function expandPanel(elm)
{
var divhtml="<div class='expandedcontent'><div style='line-height:30px;width:80px;background-color:#ff354d;font-weight:bold;cursor:pointer;position:absolute;float:right;top:0;text-align:center' onclick='$(\".expandmask\").hide().html(\"\")'>Close</div>"+$(elm).html()+"</div>";
var windowpos = $(window).scrollTop();
$(".expandmask").html(divhtml).show();
$(".expandmask").css("top", windowpos);
}
// 18 Mar 2019
function FetchDocRemarks()
{
var appno = encodeURIComponent($("#applno").val());
var cname = encodeURIComponent($("#customername").val());
var pid = 47;
RunAjax('POST','fetchDocRemarks', "appno="+appno+"&cname="+cname+"&pid="+pid, 8);
}