function createRequestObject() { var ro; var browser = navigator.appName; if(browser == "Microsoft Internet Explorer"){ ro = new ActiveXObject("Microsoft.XMLHTTP"); }else{ ro = new XMLHttpRequest(); } return ro; } var http = createRequestObject(); function sndReq(request) { wait = window.setTimeout("$('#LoadingDiv').vCenter(); $('#LoadingDiv').fadeIn('fast');", 300); http.open('get', 'stadt.php?ajax=PS_brancheKundenList_stadt&'+request); http.onreadystatechange = handleResponse; http.send(null); } function handleResponse() { if(http.readyState == 4) { window.clearTimeout(wait); var response = http.responseText; var script = ""; response1 = response.replace(/]*>([\s\S]*?)<\/script>/gi, function(){ if (response !== null) script += arguments[1] + '\n'; return '';}); document.getElementById('pslist').innerHTML = response; if(script) (window.execScript) ? window.execScript(script) : window.setTimeout(script, 0); $('#LoadingDiv').fadeOut('fast'); } } function submitForm(form) { queryStr = getFormValues(form); if (document.getElementsByName('firma')[1].value != "" || document.getElementsByName('ort')[0].value != "") document.getElementById('divZuruecksetzen').style.display = "inline"; sndReq(queryStr); return false; } function getFormValues(form) { var str = ""; for(var i = 0;i < document.forms[form].elements.length;i++) { if (document.forms[form].elements[i].type == "checkbox") { if (document.forms[form].elements[i].checked) { str += document.forms[form].elements[i].name + '=' + encodeURIComponent(document.forms[form].elements[i].value) + '&'; } } else if (document.forms[form].elements[i].type == "select-multiple") { for(j=0; j < document.forms[form].elements[i].length; j++) { if (document.forms[form].elements[i].options[j].selected) { str += document.forms[form].elements[i].name + '=' + encodeURIComponent(document.forms[form].elements[i].options[j].value) + '&'; } } } else { str += document.forms[form].elements[i].name + '=' + encodeURIComponent(document.forms[form].elements[i].value) + '&'; } } str = str.substr(0,(str.length - 1)); return str; } function disableEnterKey(e) { var key; if(window.event) key = window.event.keyCode; //IE else key = e.which; //firefox return (key != 13); } /** * * UTF-8 data encode / decode * http://www.webtoolkit.info/ * **/ var Utf8 = { // public method for url encoding encode : function (string) { string = string.replace(/\r\n/g,"\n"); var utftext = ""; for (var n = 0; n < string.length; n++) { var c = string.charCodeAt(n); if (c < 128) { utftext += String.fromCharCode(c); } else if((c > 127) && (c < 2048)) { utftext += String.fromCharCode((c >> 6) | 192); utftext += String.fromCharCode((c & 63) | 128); } else { utftext += String.fromCharCode((c >> 12) | 224); utftext += String.fromCharCode(((c >> 6) & 63) | 128); utftext += String.fromCharCode((c & 63) | 128); } } return utftext; }, // public method for url decoding decode : function (utftext) { var string = ""; var i = 0; var c = c1 = c2 = 0; while ( i < utftext.length ) { c = utftext.charCodeAt(i); if (c < 128) { string += String.fromCharCode(c); i++; } else if((c > 191) && (c < 224)) { c2 = utftext.charCodeAt(i+1); string += String.fromCharCode(((c & 31) << 6) | (c2 & 63)); i += 2; } else { c2 = utftext.charCodeAt(i+1); c3 = utftext.charCodeAt(i+2); string += String.fromCharCode(((c & 15) << 12) | ((c2 & 63) << 6) | (c3 & 63)); i += 3; } } return string; } }