function openWindowWithPost(url,name,keys,values) { var newWindow = window.open(url, name); if (!newWindow) return false; var html = ""; html += ""; if (keys && values) { html += ""; } html += "document.getElementById('formid').submit();"; html += "<\/script>".toString().replace(/^.+?\*|\\(?=\/)|\*.+?$/gi, ""); newWindow.document.write(html); return newWindow; }