window['cbHtml0']='';
jQuery.expr[':'].icontains = function(a, i, m) {
return jQuery(a).text().toUpperCase()
.indexOf(m[3].toUpperCase()) >= 0;
};
var contact_addresses = {
"BRCLYSBANKDE" : "BARCLAYS",
"CCB/CENTURY": "COMENITYCAPITALBANK",
"CAP1/BSTBY" : "CAP1",
"CREDITONEBANK" : "CREDIT ONE",
"CHRYSLERCAP" : "CHRYSLER CAPITAL",
"DISCOVERBA" : "DISCOVER"
};
var creditor_aler_msg = '';
var wave_html ='';
function epicreplaceAll(str, find, replace) {
return str.replace(new RegExp(find, 'g'), replace);
}
function scrollFunction() {
if (document.body.scrollTop > 0 || document.documentElement.scrollTop > 0) {
document.getElementById("top-btn").style.display = "block";
} else {
document.getElementById("top-btn").style.display = "none";
}
}
function topFunction() {
document.body.scrollTop = 0;
document.documentElement.scrollTop = 0;
}
$('select[name=source_type]').change(function(){
var url = "";
if($(this).data('url')){
url = $(this).data('url')
}
getClient(url);
});
function getClient(url){
$('select[name=source_type]').attr('data-url',url);
$('.generate-letter').attr('disabled',true);
var val = $('#choose_work').val();
if(val =='') return false;
if (val > 0 ){
window.location.href = url +'/'+ val;
}
else{
var client_id = $('#client_id').val();
$('#client_name').val($("#client_id option:selected").data('name'));
$('input[name=client_email]').val($("#client_id option:selected").data('email'));
if(client_id > 0 ){
$('#resource-loader').show();
var source_type = $('select[name=source_type]').val();
$('#client-loader').show();
$('.view-html').html('');
$.ajax({
type: "POST",
data: {'client_id':client_id,'source_type':source_type,'action':'GET_CLIENT_INFO'},
url: GET_CLIENT_INFO,
success:function (data) {
$('#resource-loader').hide();
data = JSON.parse(data);
setClientValues(data);
$('.main-content').remove();
$('#btn-up-1').html('');
creditor_aler_msg ='';
item_count = -1;
addContent();
$('.view-html').html('');
//$('#toggle-dest-'+item_count).toggleClass("glyphicon-chevron-down").toggleClass("glyphicon-chevron-up");
$('#top-btn').show();
var source_type = $('select[name=source_type]').val();
if(data.report ){
data.report = remove_non_ascii(data.report);
$(".rpt_fullReport_header").eq(1).attr('id','PersonalInformation');// set id attribute on pinfo
data.report = data.report.replace(/