general.js
上传用户:gzy2002
上传日期:2010-02-11
资源大小:1785k
文件大小:2k
源码类别:

电子政务应用

开发平台:

Java

  1. function getElement(name) {
  2. if (document.getElementById) {
  3. return document.getElementById(name);
  4. } else if (document.all) {
  5. return document.all[name];
  6. } else if (document.layers){
  7. return document[name];
  8. } else {
  9. return 0;
  10. }
  11. }
  12. function jprompt(message,url) {
  13. input_box=confirm(message);
  14. if (input_box==true) {
  15. window.location=url;
  16. }
  17. }
  18. function jprompt_multi(message, message2, urltrue, urlfalse) {
  19. input_box=confirm(message);
  20. if (input_box == true) {
  21. second_box=confirm(message2);
  22. if (second_box == true) {
  23. window.location = urltrue;
  24. } else {
  25. window.location = urlfalse;
  26. }
  27. }
  28. }
  29. function checkall(formname) {
  30. for (var i = 0; i < formname.elements.length; i++) {
  31. var element = formname.elements[i];
  32. if ((element.name != "allbox") && (element.type == "checkbox"))
  33. {
  34. element.checked = formname.allbox.checked;
  35. }
  36. }
  37. }
  38. function oc(id) {
  39. var e=document.getElementById(id).style;
  40. if (e.display=='') {
  41. e.display='none';
  42. } else {
  43. e.display='';
  44. }
  45. }
  46. function visno(id) {
  47. e=document.getElementById(id).style;
  48. e.display='none';
  49. }
  50. function visyes(id) {
  51. e=document.getElementById(id).style;
  52. e.display='';
  53. }
  54. function wysiwyg(form, element, element2) {
  55. openWindow('./../home/editor.php?form='+form+'&element='+element+'&element2='+element2, 660, 460);
  56. }
  57. function openWindow(url,w,h,windowname){
  58. if (!w) {
  59. w = '600';
  60. }
  61. if (!h) {
  62. h = '400';
  63. }
  64. if (!windowname) {
  65. windowname = 'window';
  66. }
  67. popupWin=window.open(url,windowname,'scrollbars,resizeable,status,'+'width='+w+',height='+h);
  68. }
  69. function submitform(formname,valuename,thevalue) {
  70. var str = "<input type='hidden' name='" + valuename + "' value='" + thevalue + "'>"
  71. document.getElementById("hiddenbit").innerHTML = str;
  72. document.forms[formname].submit();
  73. }
  74. function datePop(formname,fieldname) {
  75. var w = '205';
  76. var h = '185';
  77. var windowname = 'dateselect';
  78. year = eval('document.' + formname + '.y' + fieldname + '.options[document.' + formname + '.y' + fieldname + '.' + 'selectedIndex].value;');
  79. month = eval('document.' + formname + '.m' + fieldname + '.options[document.' + formname + '.m' + fieldname + '.' + 'selectedIndex].value;');
  80. openWindow('./datepop.php?formname='+formname+'&fieldname='+fieldname+'&year='+year+'&month='+month, w, h, windowname);
  81. }