//----------------------------------------------------------------------------------- function infostr(pid, pstr) { var mele = document.createElement("div"); var mstr = document.createTextNode(pstr); mele.appendChild(mstr); var mout = document.getElementById("main"); mout.appendChild(mele); } //----------------------------------------------------------------------------------- function getElementByRegex(pmother, pregex) // regex without delimiters { for(var i = 0; i < pmother.length; i++) { mele = pmother[i]; ispos = mele.name.search(pregex); if(ispos != -1) return mele; } return null; } //----------------------------------------------------------------------------------- function addhidden(pform, pname, pvalue) { var mnew = false; var minp = getElementByRegex(pform, pname); if(!minp) {mnew = true; minp = document.createElement('input');} minp.type = 'hidden'; minp.name = pname; minp.value = pvalue; if(mnew) pform.appendChild(minp); return minp; } //----------------------------------------------------------------------------------- function evalonsubmit(pname) { var mpos = window.pageXOffset + ',' + window.pageYOffset; if(typeof(window.pageYOffset) == 'undefined') { mpos = document.documentElement.scrollLeft + ',' + document.documentElement.scrollTop; } mhpos = addhidden(document.forms['sdbmain'], 'xenv:pos', mpos); return true; } //----------------------------------------------------------------------------------- function DoOnChangeSelection(selname) { mhsel = addhidden(document.forms['sdbmain'], 'xenv:action_changesel', selname); document.sdbmain.submit(); } //----------------------------------------------------------------------------------- function DoOnClickSelection(selname) { mhsel = addhidden(document.forms['sdbmain'], 'xenv:action_changesel', selname); document.sdbmain.submit(); } //----------------------------------------------------------------------------------- function CheckInputTextFieldSize() { var i = document.sdbmain.YourName.size; var j = document.sdbmain.YourName.value.length; if((i - j) <= 3) {document.FormName.YourName.size = (j + 10);} } //----------------------------------------------------------------------------------- function CheckTextareaFieldSize(pele) { var ic = pele.cols; var ir = pele.rows; var j = pele.value.length; pele.rows = Math.max(ir, (j / ic) + 1); } //----------------------------------------------------------------------------------- function settextarea() { for (var i = 0; i < document.getElementsByTagName("textarea").length; i++) { mele = document.getElementsByTagName("textarea")[i]; CheckTextareaFieldSize(mele); } } //----------------------------------------------------------------------------------- function openPopUp(URL) { var My_Popup_window = ''; // Open Popup at right edge of window var width = 620; var height = 450; var left = (screen.width - width) - 20; var top = (screen.height - height)/2; var params = 'width='+width+', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=no'; params += ', menubar=no'; params += ', resizable=yes'; params += ', scrollbars=yes'; params += ', status=no'; params += ', toolbar=yes'; // Check if Popup already exists, if not open new if (!My_Popup_window.closed && My_Popup_window.location) { My_Popup_window.location.href = URL; } else { My_Popup_window=window.open(URL,'Popup_window', params); } if (window.focus) {My_Popup_window.focus()} } //----------------------------------------------------------------------------------- // call: return popUpInfoUrl(this, event) // // obj refers to the calling element (calling variable is ) // // the parameter e is handled differently by browser families // IE knows global variable // Gecko hands over event by calling function via variable // // Since the release of Firefox 3 it is not possible to hide the address bar. // this is for security reasons // // return false needs to be handed over to the onclick call // so that the original href is not processed (this is done if no js is available) //----------------------------------------------------------------------------------- function href_popup(obj, e, width, height, title) { var e = window.event || e //cross browser event object var width = width || 400; // best way of defining optional parameters var height = height || 400; // var title = title || 'info'; var top = e.clientY - height/2; var left = e.clientX - width/2; var params = 'width='+width+', height='+height; params += ', top='+top+', left='+left; params += ', directories=no'; params += ', location=yes'; params += ', menubar=no'; params += ', statusbar=no'; params += ', resizable=yes'; params += ', scrollbars=yes'; params += ', status=no'; params += ', toolbar=no'; newwindow=window.open(obj.href, 'name', params); if (window.focus) {newwindow.focus()} return false; } //----------------------------------------------------------------------------------- function popUp1(wintype) { popUp=window.open(wintype, 'NewWindows', 'toolbar=yes,location=yes,directories=no,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=620,height=450,left=22,top=22'); } //----------------------------------------------------------------------------------- function ie_einblenden() { this.style.backgroundColor = "#FFFFFF";} function ie_ausblenden() { this.style.backgroundColor = "#C9DBD8";} //----------------------------------------------------------------------------------- function ie_sethover() { for (var i = 0; i < document.getElementsByTagName("input").length; i++) { mname = document.getElementsByTagName("input")[i].name; isbut = mname.search(/chbut/); if(isbut!=-1) { document.getElementsByTagName("input")[i].onmouseover=ie_einblenden; document.getElementsByTagName("input")[i].onmouseout =ie_ausblenden; } } } //----------------------------------------------------------------------------------- function setpopuplinks() { // create an array of objects of each link in the document var popuplinks = document.getElementsByTagName("a"); // loop through each of these links (anchor tags) for (var i=0; i < popuplinks.length; i++) { // if the link has a class of "popup"... if (popuplinks[i].className == "popup") { // add an onclick event on the fly to pass the href attribute // of the link to our second function, openPopUp popuplinks[i].onclick = function() { openPopUp(this.getAttribute("href")); return false; } } } } //----------------------------------------------------------------------------------- function move2focus() { var melepos = getElementByRegex(document.forms['sdbmain'], 'xenv:pos'); if(melepos) { var mpos = melepos.value; var mx = mpos.split(','); window.scrollTo(mx[0], mx[1]); } } //----------------------------------------------------------------------------------- window.onload = function() { if(window.navigator.systemLanguage && !window.navigator.language) ie_sethover(); setpopuplinks(); settextarea(); move2focus(); } //-----------------------------------------------------------------------------------