/*js for object6 and suche6 */ /* change log: 06032003 changed calcPrufZeichen 05052004 added redirect for IVL neu 10082004 changed empty 16082004 changed setButImgHover, added printObj,setHtml 16022005 changed imgwin 24012006 changed omoCursorOn/Off, new version of imgwin 17042009 changed calcPrufZeichen - Gattungszeichen Pu, Pg, Ps, EuM */ /* functions list: redirect() { calcPrufZeichen(but,suff) { setKatVars(doc) { setKat2(sel) { setButImgHover(doc) { omoCursorOn(but) { omoCursorOff(but) { omoHover(himg) { omoUnhover(himg) { editMode(but) { empty(but) { calwin(link,w,h,l,t) { helpwin(link,w,h,l,t) { imgwin(link,wid,hei,l,t) imgwinold(link) {old version chkimg() { closeback() { ws(txt) { right(num) { rightC(str) {rechts vom String SM 5.4.2006 dispSelect(sel) { toggleDisplay(id,onoff) { noenter() { printObj(obj) { setHtml(id,value,alrt) { function showId(id,doc) { function hideId(id,doc) { function formatDate(field): Datum formatieren mit führenden 0 SM 20.09.2007 */ var isEdit = false; var preloadImg = new Array(); var tracewin; //usage: /*tracewin=window.open('','tracewin', 'menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,'+ 'left=800,top=100,width=400,height=600');*/ /*if (tracewin) tracewin.document.writeln('traceString
');*/ var allKat;/*2-dim,row[i]: [i][0]=Kat, [i][j]=Subkats*/ /* Vars für imgwin/chkimg */ var img; var count; var msec = 100; function redirect() {/*for onLoad;redirect to link with id=redirect*/ var links = self.document.links; for (var i=0; i0; i-- ) kat2.options[i]=null; var kat2opt0 = new Option('--Keine Auswahl--','NUL'); num = 0; for (var i=1; i1 option selected? (Suche only)*/ if (num>1) {kat2.options[0] = kat2opt0;kat2.options[0].selected=true;return} var selind = sel.selectedIndex; /*--Bitte-- selected?*/ if (selind<=0) {kat2.options[0] = kat2opt0;kat2.options[0].selected=true;return} var kat2opt = allKat[selind-1]; //eval(selval); if (kat2opt) ; else {alert('Kat2 Options not found');return}; /*no suboptions avlbl?*/ if (kat2opt.length==1) {kat2.options[0] = kat2opt0;kat2.options[0].selected=true;return} kat2opt0 = new Option('--Bitte wählen--','NUL'); kat2.options[0] = kat2opt0; kat2.options[0].selected = true; for (var i=1; i xxxi.gif */ if (allimgs.search(new RegExp(newsrc))>-1) continue; allimgs += newsrc + '|'; //alert(allimgs); var j = preloadImg.length; preloadImg[j] = new Image(); preloadImg[j].src = newsrc; }/*if*/ }/*wi*/ }/*fo*/ } var butbgcol = '#c0c0c0'; /*Windows button colour: #d4d0c8 or #c0c0c0*/ var butcol = '#000000'; function omoCursorOn(but) {/*but:IE4 null,NS6 event; this:IE4,NS6 button*/ if (this) but = this; if (but.style) { if (but.currentStyle) {/*IE*/ butbgcol = but.currentStyle.backgroundColor; butcol = but.currentStyle.color; } else {/*FF*/ butbgcol = but.style.backgroundColor; butcol = but.style.color; } but.style.cursor = 'hand'; but.style.color = '#ffffff'; but.style.backgroundColor = '#666666'; } } function omoCursorOff(but) { if (this) but = this; if (but.style) { but.style.color = butcol; but.style.backgroundColor = butbgcol; } } function omoHover(himg) {/*himg:IE4 null,NS6 event; this:IE4,NS6 img*/ if (this) himg=this; if (himg.src) { himg.src = himg.src.replace(/\.gif/i,'i.gif'); } } function omoUnhover(himg) { if (this) himg=this; if (himg.src) { himg.src = himg.src.replace(/i\.gif/i,'.gif'); } } function editMode(but) { var url = self.document.location.href; self.document.location.href = url.replace(/!open/i, '!Edit'); } function empty(but) { /*handle Checkbox,Radio,Select,Text,Textarea 10082004*/ /*leave Button,FileUpload,Hidden,Password,Reset,Submit 10082004*/ var type;/*avoid undefined msg for radio/checkbox*/ var elem = but.form.elements; for (var i in fldns) { if (elem[fldns[i]]) { with (elem[fldns[i]]) { switch (type) { case 'text' : case 'textarea' : value = ''; break; case 'select-one' : selectedIndex = 0; break; case 'select-multiple' : for (var j=1;j0) {/*radio,checkbox 10082004*/ for (j=0;j' + self.document.title + ''); imgwindow.document.writeln(''); imgwindow.document.writeln('' + txt + ''); imgwindow.document.close(); imgwindow.focus(); return; }/*imgwin*/ function imgwinold(link) { img = new Image(); var modlink = link.replace(/\+/g,'%2b').replace(/\#/g,'%23');/*16022005*/ var appname = (navigator) ? ((navigator.appName) ? navigator.appName : 'unk') : 'unk'; img.src = (appname.indexOf('Explorer')>-1) ? modlink : unescape(modlink); // NS/Opera don't unescape, so get rid of escapes, esp %252B -> %2B window.status='Bild wird geladen'; count = 1; setTimeout(chkimg, msec); } function chkimg() { if (img.complete) { var w = Math.min( img.width + 40, screen.width-140); var h = Math.min( img.height + 40, screen.height-140); var imgwindow=window.open('/edikte/ex/edparm3.nsf/dummy!OpenPage','imgwindow', 'menubar=yes,toolbar=no,scrollbars=yes,resizable=yes,dependent,left=100,top=100,'+ 'width='+w+',height='+h); imgwindow.document.open('text/html'); imgwindow.document.writeln('Bild'); imgwindow.document.writeln(''); imgwindow.document.writeln('Klicken Sie hier zum Schließen des Fensters'); imgwindow.document.close(); window.status='Bild geladen in '+count+' Zyklen'; imgwindow.focus(); } else { count += 1; setTimeout(chkimg, msec); }; } function closeback() { if (window.name=='helpwindow') {self.close()} else {history.go(-1)} } function ws(txt) {/*set window status text*/ window.status=txt; return true; } function right(num) {/*@Right*/ return this.substr( this.length-num ); } function rightC(str) {/*@Right*/ return this.substr( 1+this.lastIndexOf(str) ); } function dispSelect(sel) {/* display Selection object*/ var result = sel.name+':
\n'; for (var i=0;i\n'; } if (tracewin) tracewin.document.writeln(result); else alert(result); } function toggleDisplay(id,onoff) { if (self.document.all) { var st = self.document.all[id].style; st.display = onoff ? 'block' : 'none'; } else { var st =self.document.getElementById(id).style; st.display = onoff ? 'block' : 'none'; } } function noenter() {/* disable submit by enter */ return !(window.event && window.event.keyCode == 13); } function printObj(obj) { if (obj==null) {alert('NULL');return false;} var result=''; if (obj.name) result+= 'NAME: '+obj.name+'\n'; if (obj.id) result+= 'ID: '+obj.id+'\n'; for (var i in obj){result+=i+': '+obj[i]+'\n';} alert(result); } function printObjW(obj) { var result=''; var newwindow=window.open("","printObjW") for (var i in obj){result+=i+': '+obj[i]+'
';} newwindow.document.write(result); newwindow.document.close(); } function setHtml(id,value,alrt) {/*if can't set, alert if alrt*/ var doc = document; if (doc.getElementById) { doc.getElementById(id).innerHTML = value; } else if (doc.all) { doc.all[id].innerHTML = value; } else { if (alrt) alert(value.replace(/|<\/strong>||<\/b>/gi,'').replace(/
/gi,'\n')); } } function showId(id,doc) { if (doc.getElementById) doc.getElementById(id).style.display='block'; else if (doc.all) doc.all[id].style.display='block'; } function hideId(id,doc) { if (doc.getElementById) doc.getElementById(id).style.display='none'; else if (doc.all) doc.all[id].style.display='none'; } function formatDateField(field) { /* Field validation and padding with leading 0 */ /* Prereq: function dateFormat in valid0.jsf, function right */ var origdat = field.value; if (dateFormat.isValid(origdat)) { var match = dateFormat.regexp.exec(origdat) var newdat = ('00' + match[dateFormat.dayix]).right(2)+'.'+ ('00' + match[dateFormat.monthix]).right(2)+'.'+ ('0000' + match[dateFormat.yearix]).right(4); field.value = newdat; } } function formatDate(datestring) { /* Field validation and padding with leading 0 */ /* Prereq: function dateFormat in valid0.jsf, function right */ var origdat = datestring; if (dateFormat.isValid(origdat)) { var match = dateFormat.regexp.exec(origdat) var newdat = ('00' + match[dateFormat.dayix]).right(2)+'.'+ ('00' + match[dateFormat.monthix]).right(2)+'.'+ ('0000' + match[dateFormat.yearix]).right(4); return(newdat) } }