function replace(search, replace, subject){ var ra = replace instanceof Array, sa = subject instanceof Array, l = (search = [].concat(search)).length, replace = [].concat(replace), i = (subject = [].concat(subject)).length; while(j = 0, i--) while(subject[i] = subject[i].split(search[j]).join(ra ? replace[j] || "" : replace[0]), ++j < l); return sa ? subject : subject[0]; } var bnzi = []; $(".scadv").each(function(){ var ThID = this.id.split("-")[1]; if (bnzi[ThID] !== undefined) { $(this).html(replace(["'+'", "\'"], ["", "'"], bnzi[ThID])); if (!$(this).is(":visible")) { $(this).css("display", ""); } if (!$("#bindpar-"+ThID).is(":visible")) { $("#bindpar-"+ThID).css("display", ""); } } });