function refreshCaptcha(componentId, captchaPath) { if(!captchaPath) captchaPath = 'index.php?option=com_rsform&task=captcha&componentId=' + componentId; document.getElementById('captcha' + componentId).src = captchaPath + '&' + Math.random(); document.getElementById('captchaTxt' + componentId).value=''; document.getElementById('captchaTxt' + componentId).focus(); } function number_format(number, decimals, dec_point, thousands_sep) { var n = number, prec = decimals; n = !isFinite(+n) ? 0 : +n; prec = !isFinite(+prec) ? 0 : Math.abs(prec); var sep = (typeof thousands_sep == "undefined") ? ',' : thousands_sep; var dec = (typeof dec_point == "undefined") ? '.' : dec_point; var s = (prec > 0) ? n.toFixed(prec) : Math.round(n).toFixed(prec); //web.archive.orghttp://fix/ for IE parseFloat(0.55).toFixed(0) = 0; var abs = Math.abs(n).toFixed(prec); var _, i; if (abs >= 1000) { _ = abs.split(/\D/); i = _[0].length % 3 || 3; _[0] = s.slice(0,i + (n < 0)) + _[0].slice(i).replace(/(\d{3})/g, sep+'$1'); s = _.join(dec); } else { s = s.replace('.', dec); } return s; } function buildXmlHttp() { var xmlHttp; try { xmlHttp=new XMLHttpRequest(); } catch (e) { try { xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) { alert("Your browser does not support AJAX!"); return false; } } } return xmlHttp; } function ajaxValidation(form, page) { try { var el = form.elements.length; } catch (err) { form = this; } var xmlHttp = buildXmlHttp(); var url = 'index.php?option=com_rsform&task=ajaxValidate'; if (page) url += '&page=' + page; var params = new Array(); var submits = new Array(); var success = false; var formId = 0; for (i=0; i