function asapCMS_showHideLayers() {
	var i,p,v,obj,args=asapCMS_showHideLayers.arguments;
	for (i=0; i<(args.length-2); i+=3) if ((obj=asapCMS_findObj(args[i]))!=null) { v=args[i+2];
		if (obj.style) {
			obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v;
		}
		obj.visibility=v;
	}
}

function asapCMS_preloadImages() {
	var d=document; if(d.images){ if(!d.asapCMS_p) d.asapCMS_p=new Array();
	var i,j=d.asapCMS_p.length,a=asapCMS_preloadImages.arguments; for(i=0; i<a.length; i++)
	if (a[i].indexOf("#")!=0) {
		d.asapCMS_p[j]=new Image; d.asapCMS_p[j++].src=a[i];}
	}
}

function asapCMS_swapImgRestore() {
	var i,x,a=document.asapCMS_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function asapCMS_swapImage() {
	var i,j=0,x,a=asapCMS_swapImage.arguments; document.asapCMS_sr=new Array; for(i=0;i<(a.length-2);i+=3)
	if ((x=asapCMS_findObj(a[i]))!=null){
		document.asapCMS_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];
	}
}

function asapCMS_reDirect(url) {
	window.location.href=url;
}

function asapCMS_confirmation(text, url) {
	result = window.confirm(text);
	if (result == true) {
		asapCMS_reDirect(url);
	}
}

function asapCMS_goToURL() {
	var i, args=asapCMS_goToURL.arguments; document.asapCMS_returnValue = false;
	for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

function asapCMS_jumpMenu(targ,selObj,restore) { //v3.0
	eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
	if (restore) selObj.selectedIndex=0;
}

function asapCMS_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=asapCMS_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function asapCMS_validateForm() {
  var i,p,q,nm,test,num,min,max,errors='',args=asapCMS_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=asapCMS_findObj(args[i]);
    if (val) { nm=val.name; if ((val=val.value)!="") {
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors += ' "'+nm+'" - angegebene Adresse nicht gueltig!\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+nm+' Sie muessen eine Zahl eingeben.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+nm+' Sie muessen eine Zahl zwischen '+min+' und '+max+' eingeben!\n';
    } } } else if (test.charAt(0) == 'R') errors += ' "'+nm+'" - nicht angegeben.\n'; }
  } if (errors) alert('Die folgenden Angaben sind nicht angegeben oder falsch:\n\n'+errors);
  document.asapCMS_returnValue = (errors == '');
}

function qedCMS_findObj(n, d) {
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=qedCMS_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function qedCMS_showHideLayers() {
  var i,p,v,obj,args=qedCMS_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=qedCMS_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

function qedCMS_preloadImages() {
  var d=document; if(d.images){ if(!d.qedCMS_p) d.qedCMS_p=new Array();
    var i,j=d.qedCMS_p.length,a=qedCMS_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.qedCMS_p[j]=new Image; d.qedCMS_p[j++].src=a[i];}}
}

function qedCMS_swapImgRestore() {
  var i,x,a=document.qedCMS_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function qedCMS_swapImage() {
  var i,j=0,x,a=qedCMS_swapImage.arguments; document.qedCMS_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=qedCMS_findObj(a[i]))!=null){document.qedCMS_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function qedCMS_reDirect(url) {
	window.location.href=url;
}

function qedCMS_confirmation(text, url) {
	result = window.confirm(text);
	if (result == true) {
		qedCMS_reDirect(url);
	}
}

function qedCMS_goToURL() {
  var i, args=qedCMS_goToURL.arguments; document.qedCMS_returnValue = false;
  for (i=0; i<(args.length-1); i+=2) eval(args[i]+".location='"+args[i+1]+"'");
}

var marked_row = new Array;
/**
 * @param   object    the table row
 * @param   interger  the row number
 * @param   string    the action calling this script (over, out or click)
 * @param   string    the default background color
 * @param   string    the color to use for mouseover
 * @param   string    the color to use for marking a row
 */
function setPointer(theRow, theRowNum, theAction, theDefaultColor, thePointerColor, theMarkColor)
{
    var theCells = null;
    if ((thePointerColor == '' && theMarkColor == '')
        || typeof(theRow.style) == 'undefined') {
        return false;
    }
    if (typeof(document.getElementsByTagName) != 'undefined') {
        theCells = theRow.getElementsByTagName('td');
    }
    else if (typeof(theRow.cells) != 'undefined') {
        theCells = theRow.cells;
    }
    else {
        return false;
    }
    var rowCellsCnt  = theCells.length;
    var domDetect    = null;
    var currentColor = null;
    var newColor     = null;
    if (typeof(window.opera) == 'undefined'
        && typeof(theCells[0].getAttribute) != 'undefined') {
        currentColor = theCells[0].getAttribute('bgcolor');
        domDetect    = true;
    }
    else {
        currentColor = theCells[0].style.backgroundColor;
        domDetect    = false;
    }
    if (currentColor == ''
        || currentColor.toLowerCase() == theDefaultColor.toLowerCase()) {
        if (theAction == 'over' && thePointerColor != '') {
            newColor              = thePointerColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == thePointerColor.toLowerCase()
             && (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])) {
        if (theAction == 'out') {
            newColor              = theDefaultColor;
        }
        else if (theAction == 'click' && theMarkColor != '') {
            newColor              = theMarkColor;
            marked_row[theRowNum] = true;
        }
    }
    else if (currentColor.toLowerCase() == theMarkColor.toLowerCase()) {
        if (theAction == 'click') {
            newColor              = (thePointerColor != '')
                                  ? thePointerColor
                                  : theDefaultColor;
            marked_row[theRowNum] = (typeof(marked_row[theRowNum]) == 'undefined' || !marked_row[theRowNum])
                                  ? true
                                  : null;
        }
    }
    if (newColor) {
        var c = null;
        if (domDetect) {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].setAttribute('bgcolor', newColor, 0);
            }
        }
        else {
            for (c = 0; c < rowCellsCnt; c++) {
                theCells[c].style.backgroundColor = newColor;
            }
        }
    }
	return true;
}