

function imgChangeOn(name) {
    img = eval('document.images.'+name);
    imgsrc = img.src.replace('_a.gif','.gif');
    img.src = imgsrc.replace('.gif','_a.gif');
}
function imgChangeOff(name) {
    img = eval('document.images.'+name);
    img.src = img.src.replace('_a.gif','.gif');
}

function spacer(flag){
	if (document.layers || flag=="all") {
		document.write ('<font size=1>');
		for (n=0;n<30;n++) {
		document.write ('&nbsp;&nbsp; ');
		}
		document.write ('</font>');
	}
}
function mailto(str) {
    var mailto='';
    for (n=0;s=str.substring(n*2,2*n+2);n++) {
        mailto+= unescape('%'+s) ;
    }
    location.href="mailto:"+ mailto;
}

/**
* toggles the visibility of an object, identified by its ID
 * @author Christian Reinecke
 * @date 2007-05-08
 */
function ElementToggle(containerId)
{
    var containerObject = document.getElementById(containerId);
    if (ElementIsVisible(containerObject)) {
        ElementHide(containerObject);
    } else {
        ElementShow(containerObject);
    }
}

/**
* checks wether an object is visible or not, identified by its object-resource
 * @author Christian Reinecke
 * @date 2007-05-08
 */
function ElementIsVisible(containerObject)
{
    return containerObject.className.search(/\bhide\b/) == -1;
}

/**
* hides an object, identified by its object-resource
 * @author Christian Reinecke
 * @date 2007-05-08
 */
function ElementHide(containerObject)
{
    containerObject.className = containerObject.className.replace(/\b(hide|show)\b/g, '');
    containerObject.className += ' hide';
}

/**
* shows an object, identified by its object-resource
 * @author Christian Reinecke
 * @date 2007-05-08
 */
function ElementShow(containerObject)
{
    containerObject.className = containerObject.className.replace(/\b(hide|show)\b/g, '');
    containerObject.className += ' show';
}

/**
  * sets the source-path for an image, identified by its object-resource
  * @author Christian Reinecke
  * @date 2007-05-08
  */
function ElementImage(imageObject, imageSrc)
{
    imageObject.src = imageSrc;
}


function ElementToggle_BusinessGuide(containerId, imageId)
{
    var containerObject = document.getElementById(containerId);
    var imageObject     = document.getElementById(imageId);
    if (ElementIsVisible(containerObject)) {
        ElementImage(imageObject, 'img/arrow_closed.gif');
        ElementHide(containerObject);
    } else {
        ElementImage(imageObject, 'img/arrow_open.gif');
        ElementShow(containerObject);
    }
}    