/*
* Display and hide tab blocks on mouse hover
*/

function reload_captcha(){
	img = document.getElementById('captcha_bild');
	src = "/netactive/formmailer.php?captcha=png&"+Math.round(Math.random()*10000);
	img.src = src;
}
 
function showObject(anID) {
    if (document.getElementById) {
        var o = document.getElementById(anID);
        if (o) o.style.display = 'block';
    }
    return true;
}


function hideObject(anID) {
    if (document.getElementById) {
        var o = document.getElementById(anID);
        if (o) o.style.display = 'none';
    }
    return true;
}




function openPopup(theURL,winName,features,width,height)
{
    var winWidth    = width;
    var winHeight   = height;
    var strWinSize  = ",width=" + winWidth + ",height=" + winHeight;

    if (window.screen) {
        var winPosL = (screen.availWidth - winWidth) / 2;
        var winPosT = (screen.availHeight - winHeight) / 2;
        strWinSize += ",left=" + winPosL + ",screenX=" + winPosL + ",top=" + winPosT + ",screenY=" + winPosT;
    }       
    
    window.open(theURL,winName,features + strWinSize);
}


function getObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	    // W3C DOM
	    return document.getElementById(objectId);
    } else if (document.all && document.all(objectId)) {
	    // MSIE 4 DOM
	    return document.all(objectId);
    } else if (document.layers && document.layers[objectId]) {
	    // NN 4 DOM.. note: this won't find nested layers
	    return document.layers[objectId];
    } else {
	   return false;
    }
} // getStyleObject


// ************************
// layer utility routines *
// ************************


// setStyleById: given an element id, style property and 
// value, apply the style.
// args:
//  i - element id
//  p - property
//  v - value
//
function setStyleById(i, p, v) {
    var n = document.getElementById(i);
    n.style[p] = v;
}


function clearStyleById(i, p) {
    var n = document.getElementById(i);
    n.style[p] = none;
}


function getStyleObject(objectId) {
    // cross-browser function to get an object's style object given its id
    if(document.getElementById && document.getElementById(objectId)) {
	    // W3C DOM
	    return document.getElementById(objectId).style;
    } else if (document.all && document.all(objectId)) {
	    // MSIE 4 DOM
	    return document.all(objectId).style;
    } else if (document.layers && document.layers[objectId]) {
	    // NN 4 DOM.. note: this won't find nested layers
	    return document.layers[objectId];
    } else {
	   return false;
    }
} // getStyleObject



function changeObjectVisibility(objectId, newVisibility) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
	    styleObject.visibility = newVisibility;
	    return true;
    } else {
	   // we couldn't find the object, so we can't change its visibility
	   return false;
    }
} // changeObjectVisibility


function changeObjectDisplay(objectId, newDisplay) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if (styleObject) {
	    styleObject.display = newDisplay;
	    return true;
    } else {
	   // we couldn't find the object, so we can't change its display
	   return false;
    }
} // changeObjectDisplay


function moveObject(objectId, newXCoordinate, newYCoordinate) {
    // get a reference to the cross-browser style object and make sure the object exists
    var styleObject = getStyleObject(objectId);
    if(styleObject) {
        styleObject.left = newXCoordinate;
        styleObject.top = newYCoordinate;
        return true;
    } else {
	   // we couldn't find the object, so we can't very well move it
	   return false;
    }
} // moveObject