function hello(){ alert("hello"); } function get_radio_value(radioElement){ for (var i = 0; i < radioElement.length; i++) if (radioElement[i].checked) return rad_val = radioElement[i].value; return ""; } /* function isEmpty(field){ // alert(field.value); if (field.value == undefined) return true; if (field.value.length < 1) return true; return false; } */ function callJSP(url){ if (window.XMLHttpRequest) { ajax = new XMLHttpRequest(); } else { ajax = new ActiveXObject("Microsoft.XMLHTTP"); } if (ajax) { // alert(url); var url2 = encodeURI(url); ajax.open("GET", url2, false); ajax.send(null); //alert(ajax.responseText); return ajax.responseText; } else { alert("something wrong when getting AJAX object"); return false; } } function callJSPAsync(url2, func, exception) { var http_request = false; // alert("fjsl"); if (window.XMLHttpRequest) { // FireFox http_request = new XMLHttpRequest(); } else if (window.ActiveXObject) { // IE try { http_request = new ActiveXObject("Msxml2.XMLHTTP"); } catch (e) { try { http_request = new ActiveXObject("Microsoft.XMLHTTP"); } catch (e) {} } } if (!http_request) { alert('Something Wrong creating XMLHTTP instance'); return false; } //alert("fdsf"); var url = encodeURI(url2); http_request.onreadystatechange = function() { processAsyncRequest(http_request,func, exception); }; http_request.open('GET', url, true); http_request.send(null); } function processAsyncRequest(http_request, func, exception) { if (http_request.readyState == 4) { if (http_request.status == 200) { var text = http_request.responseText; // alert(text); func(text); } else { alert('Something wrong with the request. Please relogin.'); if (exception != null) exception(); } } }