/*-------------------------------------------------------------------------*/ /* General JavaScript */ /*-------------------------------------------------------------------------*/ /*-------------------------------------------------------------------------*/ /* Image Handling */ /*-------------------------------------------------------------------------*/ // Search (1) Normal1 = new Image(); Highlight1 = new Image(); // Page Top (2) Normal2 = new Image(); Highlight2 = new Image(); function initImages() { Normal1.src = document.forms[0].searchNormalURL.value; Highlight1.src = document.forms[0].searchOverURL.value; Normal2.src = document.forms[0].pageUpNormalURL.value; Highlight2.src = document.forms[0].pageUpOverURL.value; } function changeImage(sImgNam, oImg) { window.document.images[sImgNam].src = oImg.src; } /*-------------------------------------------------------------------------*/ /* Search Handling */ /*-------------------------------------------------------------------------*/ function search() { sURL = document.forms[0].searchViewURL.value + document.forms[0].suche.value; // alert(sURL); location.href = sURL; } /*-------------------------------------------------------------------------*/ /* Open Popups */ /*-------------------------------------------------------------------------*/ function openPopup(url, iWidth, iHeight) { var param3 = "width=" + iWidth + ",height=" + iHeight + ",scrollbars=yes"; window.open(url,"",param3); return true; } /*** Open Window ***/ function openW(picURL,myname,picWidth,picHeight,features) { newWindow=window.open(picURL,'newWin','toolbar=no,width='+picWidth+', height='+picHeight) newWindow.document.write(' <\/head><\/body><\/html>') newWindow.resizeBy(picWidth-newWindow.document.body.clientWidth,picHeight-newWindow.document.body.clientHeight) newWindow.focus() } /*-------------------------------------------------------------------------*/ /* Disable Input */ /*-------------------------------------------------------------------------*/ function setFieldDisabled(state, fieldname) { frm = document.forms[0]; if (state!= 'disable') { frm.elements[fieldname].value=''; frm.elements[fieldname].disabled=true; } else { frm.elements[fieldname].disabled=false; } } /*-------------------------------------------------------------------------*/ /* Test Datumsformat */ /*-------------------------------------------------------------------------*/ function testDatumsFormat(datumStr) { // Leeres Datum: ok if (datumStr == "") { return(true); } // Checks for the following valid date formats: // // Also separates date into month, day, and year variables //Pattern mit zweistelligen Jahreszahlen. var datePat = /^(\d{1,2})(\.|-)(\d{1,2})\2(\d{2}|\d{4})$/; var datePat = /^(\d{1,2})(\.|-)(\d{1,2})\2(\d{4})$/; var matchArray = datumStr.match(datePat); // is the format ok? if (matchArray == null) { alert("Bitte Datumseingabe im Format TT.MM.JJJJ"); return(false); } var day = matchArray[1]; var month = matchArray[3]; var year = matchArray[4]; if (month < 1 || month > 12) { alert("Als Monat muss eine Zahl zwischen 1 und 12 eingegeben werden."); return (false); } if (day < 1 || day > 31) { alert("Der Tag muss zwischen den Zahlen 1 und 31 liegen."); return(false); } if((month==4 || month==6 || month==9 || month==11) && day==31) { if(month==4){monthname="April"} if(month==6){monthname="Juni"} if(month==9){monthname="September"} if(month==11){monthname="November"} alert("Der "+monthname+" hat nur 30 Tage!"); return(false); } if(month == 2) { var isleap = (year % 4 == 0 && (year % 100 != 0 || year % 400 == 0)); if (day>29 || (day==29 && !isleap)) { alert("Der Monat Februar " + year + " hat keine " + day + " Tage!"); return(false); } } return(true); }