function jsFlash(ps_flash, pi_width, pi_height) { document.write('' + '' + '' + '' + '' + '' + ''); } function jsCreateRequest() { return (navigator.appName == 'Microsoft Internet Explorer')? new ActiveXObject('Microsoft.XMLHTTP'): new XMLHttpRequest(); } var go_http = null; var go_target = null; function jsLoadTab(ps_type, pi_index, ps_parameters) { for (var i = 1; i < 15; i++) { oObj = document.getElementById('tab_' + i); if (oObj != null) { oObj.className = (i == pi_index)? 'tabon': 'taboff'; } oObj = document.getElementById('tabbody_' + i); if (oObj != null) { oObj.style.display = (i == pi_index)? 'block': 'none'; } if (i == pi_index) { jsLoad(i, '/index.php/page/' + ps_type + '_tab_' + pi_index + ps_parameters); } } document.cookie = 'ci_' + ps_type + 'tab=' + pi_index + '; expire=; path=/;'; } function jsLoad(pi_index, ps_url) { go_target = null; oObj = document.getElementById('tabsource_' + pi_index); if (oObj == null) return; jsSetStatus(oObj, true); go_target = oObj; go_http = (go_http == null)? jsCreateRequest(): go_http; go_http.open('get', ps_url); go_http.onreadystatechange = function() { if (go_http.readyState != 4) return; if (go_target == null) return; jsSetStatus(go_target, false); go_target.innerHTML = go_http.responseText; go_target = null; } go_http.send(null); } function jsSubmit(pi_index, po_form, ps_url) { go_target = null; oObj = document.getElementById('tabsource_' + pi_index); if (oObj == null) return; var ls_parameters = ''; for (var i = 0; i < po_form.elements.length; i++) { lo_element = po_form.elements[i]; switch(lo_element.type) { case 'radio': case 'checkbox': if (lo_element.checked) ls_parameters += lo_element.name + '=' + escape(lo_element.value) + '&'; break; case 'select-one': ls_parameters += lo_element.name + '=' + escape(lo_element.options[lo_element.selectedIndex].value) + '&'; break; default: ls_parameters += lo_element.name + '=' + escape(lo_element.value) + '&'; break; } } jsSetStatus(oObj, true); go_target = oObj; // Escape all + chars in the submitted values ls_parameters = ls_parameters.replace(/\+/g, '%2B'); go_http = (go_http == null)? jsCreateRequest(): go_http; go_http.open('POST', ps_url); go_http.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded'); go_http.onreadystatechange = function() { if (go_http.readyState != 4) return; if (go_target == null) return; jsSetStatus(oObj, false); go_target.innerHTML = go_http.responseText; go_target = null; } go_http.send(ls_parameters); } function jsSetStatus(po_element, pb_working) { if (po_element == null) return; po_element.style.backgroundImage = pb_working? 'url(/_ps/images/ajaxworking.gif)': 'none'; if (pb_working) po_element.innerHTML = ''; }