//*******************************************
//****** ******
//****** template.js ******
//****** ******
//*******************************************
var bildschirmx = screen.availWidth;
var bildschirmy = screen.availHeight;
var breite=Math.round((bildschirmx) / 2);
var hoehe =Math.round((bildschirmy) / 2);
var startx = Math.round((bildschirmx) - (breite) - 10);
var starty = 0;
var wibreite = Math.round((bildschirmx) / 3);
var wihoehe = Math.round((bildschirmy) / 2);
var wistartx = Math.round((bildschirmx) - (wibreite) - 10);
var wistarty = Math.round(((bildschirmy) - (wihoehe)) / 2);
var wfsbreite = Math.round((bildschirmx) / 4);
var wfshoehe = Math.round((bildschirmy) / 6);
var wfsstartx = Math.round((bildschirmx) - (wfsbreite) - 10);
var wfsstarty = Math.round(((bildschirmy) - (wfshoehe)) / 2);
var objbreite=Math.round((bildschirmx) * 70 / 100);
var objhoehe =Math.round((bildschirmy) * 70 / 100);
var objstartx = Math.round((bildschirmx) - (objbreite) - 10);
var objstarty = 0;
function hilfeisrv(URL,ID) {
if (ID.length>0) URL = URL+document.forms['main'].elements['id'+ID].value+'&';
win = window.open(URL, "neu", "width=" + breite + ",height=" + hoehe + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + startx + ",left=" + startx + ",screenY=" + starty + ",top=" + starty + " ");
}
function showhinw(URL) {
win = window.open(URL, "neu", "width=" + breite + ",height=" + hoehe + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + startx + ",left=" + startx + ",screenY=" + starty + ",top=" + starty + " ");
}
function waitforsearch() {
win = window.open("waitforsearch.html", "waitforsearch", "width=" + wfsbreite + ",height=" + wfshoehe + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + wfsstartx + ",left=" + wfsstartx + ",screenY=" + wfsstarty + ",top=" + wfsstarty + " ");
}
function closewfs() {
win = window.close("waitforsearch");
}
function objwindow(URL) {
win = window.open(URL, "DabisSecondary", "width=" + objbreite + ",height=" + objhoehe + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + objstartx + ",left=" + objstartx + ",screenY=" + objstarty + ",top=" + objstarty );
}
function wimorescr(URL) {
win = window.open(URL, "neu", "width=" + wibreite + ",height=" + wihoehe + ",status=no,toolbar=no,menubar=no,resizable=yes,scrollbars=yes,screenX=" + wistartx + ",left=" + wistartx + ",screenY=" + wistarty + ",top=" + wistarty + " ");
}
function scrconfirm(txt) {
if (confirm(txt)) {
var formObj = document.forms['main'];
var waitForResult = document.getElementById("waitForResult");
if (waitForResult) {
setVisibility();
}
formObj.action = formObj.action + '&confirm=ok&f_search,ALL=&';
// xform.submit();
formObj.submit();
}
}
// Checkboxes
function selectCheckbox(type,flag){
i=0;
while(document.forms['main'].elements[i]){
if (document.forms['main'].elements[i].name == type) document.forms['main'].elements[i].checked = flag;
i++;
}
}
// Confirm Delete
var confVar = '';
// remember weather a button with value=delete has been pushed
function setDeleteRequest(reqType){
confVar = reqType;
}
// confirm Request for deletion
function confirmDeleteRequest(){
var confOK = true;
switch (confVar) {
case 'Löschen':
confOK = confirm('Löschvorgang vortsetzen?');
if (!confOK) { confVar = ''; }
break;
case 'Ändern':
/* confOK = confirm('Änderung durchführen?'); */
if (!confOK) { confVar = ''; }
break;
case 'Neu':
/* confOK = confirm('News neu aufnehmen?'); */
if (!confOK) { confVar = ''; }
break;
default:
// return changeTarget();
// return warningOnSubmit();
if (!confOK) { confVar = ''; }
break;
}
warningOnSubmit();
return confOK;
}
// COOKIE include
var today = new Date();
var zero_date = new Date(0,0,0);
today.setTime(today.getTime() - zero_date.getTime());
var todays_date = new Date(today.getYear(),today.getMonth(),today.getDate(),0,0,0);
var expires_date = new Date(todays_date.getTime() + (1 * 600000)); // Expire: 10 minute
function Get_Cookie(name) {
var start = document.cookie.indexOf(name+"=");
var len = start+name.length+1;
if ((!start) && (name != document.cookie.substring(0,name.length))) return null;
if (start == -1) return null;
var end = document.cookie.indexOf(";",len);
if (end == -1) end = document.cookie.length;
return unescape(document.cookie.substring(len,end));
}
function Set_Cookie(name,value,expires,path,domain,secure) {
document.cookie = name + "=" +escape(value) +
( (expires) ? ";expires=" + expires.toGMTString() : "") +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
( (secure) ? ";secure" : "");
}
function Delete_Cookie(name,path,domain) {
if (Get_Cookie(name)) document.cookie = name + "=" +
( (path) ? ";path=" + path : "") +
( (domain) ? ";domain=" + domain : "") +
";expires=Thu, 01-Jan-70 00:00:01 GMT";
}
function storeMasterCookie() {
if (!Get_Cookie('MasterCookie'))
Set_Cookie('MasterCookie','MasterCookie');
}
function storeIntelligentCookie(name,value) {
if (Get_Cookie('MasterCookie')) {
var IntelligentCookie = Get_Cookie(name);
if ((!IntelligentCookie) || (IntelligentCookie != value)) {
Set_Cookie(name,value,expires_date);
var IntelligentCookie = Get_Cookie(name);
if ((!IntelligentCookie) || (IntelligentCookie != value))
Delete_Cookie('MasterCookie');
}
}
}
var src_loaded = true;
if (src_loaded) {
storeMasterCookie();
}
// Scripts for edit language.ini
function clickLink(p,t,i) {
// activate clicked-box, display respective text
// p: text in the row, t:picture background of the button, i: hidden that holds the actual value
p.value=i.value;
var hyPos = t.id.indexOf('-');
var j = t.id.substring(hyPos-1,hyPos);
var tIdBef = t.id.substring(0,hyPos-1);
var tIdAft = t.id.substring(hyPos,t.id.length);
for (k = 1; (tTmp = document.getElementById(tIdBef + k + tIdAft)) != null; k = k + 1) {
if (k==j) {
if (tTmp.style.backgroundImage == 'url(images/x_nt_exist.bmp)') {
tTmp.style.backgroundImage = 'url(images/x_nt_aktiv.bmp)'
} else if (tTmp.style.backgroundImage == 'url(images/x_exist.bmp)') {
tTmp.style.backgroundImage = 'url(images/x_aktiv.bmp)'
}
} else {
if (tTmp.style.backgroundImage == 'url(images/x_nt_aktiv.bmp)') {
tTmp.style.backgroundImage = 'url(images/x_nt_exist.bmp)'
} else if (tTmp.style.backgroundImage == 'url(images/x_aktiv.bmp)') {
tTmp.style.backgroundImage = 'url(images/x_exist.bmp)'
}
}
}
}
function blurText(p) {
// changed text rewrite in language.ini (call language.psi with the appropriate parameters)
if (p.id.indexOf('tags') >= 0) {
tIdBef = 'idtagsTd';
tHidBef = 'idtagsHidden';
tIdLan = p.id.substring(11,p.id.length);
tIdRow = p.id.substring(11,p.id.length);
tIdName = document.getElementById('idtagsName' + tIdRow).value
tIdAft = '-' + p.id.substring(11,p.id.length);
tIdType = '';
} else if (p.id.indexOf('asp') >= 0) {
tIdBef = 'idaspTd';
tHidBef = 'idaspHidden';
tIdRow = p.id.substring(10,p.id.length);
tIdName = document.getElementById('idaspName' + tIdRow).value
tIdAft = '-' + p.id.substring(10,p.id.length);
tIdType = 'A-';
} else { // fnam
tIdBef = 'idfnamTd';
tHidBef = 'idfnamHidden';
tIdRow = p.id.substring(11,p.id.length);
tIdName = document.getElementById('idfnamName' + tIdRow).value
tIdAft = '-' + p.id.substring(11,p.id.length);
tIdType = 'F-';
}
// alert('tHidBef:'+tHidBef+'\n'+'p.id:'+p.id+'\n'+'p.value:'+p.value);
var j = 0;
for (k = 1; (tTmp = document.getElementById(tIdBef + k + tIdAft)) != null; k = k + 1) {
if (tTmp.style.backgroundImage == 'url(images/x_nt_aktiv.bmp)' ||
tTmp.style.backgroundImage == 'url(images/x_aktiv.bmp)') {
j = k;
document.getElementById(tHidBef + k + tIdAft).value = p.value;
if (p.value.length > 0 && tTmp.style.backgroundImage == 'url(images/x_nt_aktiv.bmp)') {
tTmp.style.backgroundImage = 'url(images/x_aktiv.bmp)';
} else if (p.value.length == 0 && tTmp.style.backgroundImage == 'url(images/x_aktiv.bmp)') {
tTmp.style.backgroundImage = 'url(images/x_nt_aktiv.bmp)';
}
}
}
var sessid = document.getElementById('sessid').value;
var langfile = document.getElementById('langfile').value;
var URL = '/PSI/language.psi&sessid=' + sessid + '&f_langwri=&langfile=' + langfile + '&language=' + j + '&tagtype=' + tIdType + '&tagname=' + tIdName + '&tagvalue=' + p.value + '&';
window.status = URL;
win = window.open(URL, "_blank", "width=1,height=1,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no");
}
// flickering text: please wait for result
function setVisibility() {
var waitForResult = document.getElementById("waitForResult");
if (waitForResult) {
if (waitForResult.style.visibility == "hidden") {
waitForResult.style.visibility = "visible";
} else {
waitForResult.style.visibility = "hidden";
}
setTimeout("setVisibility()", 1000);
}
return true;
}
// this function is called from confirmDeleteRequest() on return
// it calls setVisibility if the form is submitted with a search requirement
function warningOnSubmit() {
var formObj = document.forms['main'];
// var formObj = document.getElementById("main");
var fromSite = document.getElementById("fromsite");
var waitForResult = document.getElementById("waitForResult");
if (waitForResult) {
if (((fromSite.value == 'xHome' || fromSite.value == 'xSearch' || fromSite.value == 'xStrSearch') &&
!formObj.submitButton) ||
(formObj.submitButton && typeof(formObj.submitButton) == 'string' && formObj.submitButton.indexOf('f_search') >= 0)) {
setVisibility();
}
}
return true;
}