﻿function filterKeyPress(a) { if (window.event) { a = window.event } var b = (window.event ? a.keyCode : a.which); if (b == 8 || b == 46) { return true } if (b == 36 || b == 35) { return true } if (b == 37 || b == 38 || b == 39 || b == 40) { return true } } function checkText(a, b, c, d, e) { var f = a.value.length; if (b - f > 0) { c.value = b - f } else { c.value = 0 } c.innerHTML = c.value; if (f >= b) { if (!filterKeyPress(e)) { d.innerHTML = document.getElementById('ctl00$hdnYouHaveReachedXCharLimit').value.replace('{0}', b); d.style.display = 'block'; return false } } else { d.style.display = 'none' } } function getLengthMCE(a) { var b; var c; c = tinyMCE.get(a).getContent(); c = c.replace(/<!--(.|\n)*?-->/gi, ""); c = c.replace(/&lt;!--(.|\n)*?--&gt;/gi, ""); c = c.replace(/<(.|\n)*?>/gi, ""); c = c.replace(/\r\n|\r|\n/g, ""); c = c.replace(/^\s+|\s+$/gi, ""); b = c.length; return b } function getCheckLengthMCE() { var a = 3000; var b = getLengthMCE("ctl00_cpMainColumn_mceDescription"); document.getElementById('mce_count').innerHTML = 3000 - b; if (b > 3000) { document.getElementById('descErr').innerHTML = 'You have reached the ' + a + ' character limit for this field.  Please reduce your text.'; document.getElementById('descErr').style.display = 'block' } if (b < 3000) { document.getElementById('descErr').style.display = 'none' } } function stripComments(a) { a = a.replace(/<!--(.|\n)*?-->/gi, ""); a = a.replace(/&lt;!--(.|\n)*?--&gt;/gi, ""); return a }