/*******************************************************
toggle visibility
*******************************************************/ 
// toggle visibility

 
function toggle(targetId, BGID) {
    if (document.getElementById) {
        target = document.getElementById(targetId);
        if (target.style.display == "none") {
            target.style.display = "";
        } else {
            target.style.display = "none";
        }
        arrow = document.getElementById(BGID);
        if (arrow.className == "arrowUp") {
            arrow.className = "arrowDown";
        } else {
            if (arrow.className == "arrowDown") {
                arrow.className = "arrowUp";
            }
        }
    }
}


//Modified to get Scriptaculus right

function toggleLayer(whichLayer) {
	var stylePopup;
	var stylepopupHelper;
	var stylepopupHelperObject;
    if (document.getElementById) {
// this is the way the standards work
        stylePopup = document.getElementById(whichLayer).style;
        stylepopupHelper = document.getElementById('popupHelper').style;
        stylepopupHelperObject = document.getElementById('popupHelper');
    } else {
        if (document.all) {
// this is the way old msie versions work
            stylePopup = document.all[whichLayer].style;
            stylepopupHelper = document.all['popupHelper'].style;
            stylepopupHelperObject = document.all['popupHelper'];
        } else {
            if (document.layers) {
// this is the way nn4 works
                stylePopup = document.layers[whichLayer].style;
                stylepopupHelper = document.layers['popupHelper'].style;
                stylepopupHelperObject = document.layers['popupHelper'];
            }
        }
    }
    
    if (stylePopup.display) {
    	//stylepopupHelperObject.opacity=0.25;
    	//stylePopup.opacity = 1;
		new Effect.Opacity(whichLayer,{ from: 1, to: 0 });
		new Effect.Opacity('popupHelper',{ from: 0.25, to: 1 });
		//stylePopup.opacity = 0;
		//stylepopupHelper.opacity=1;
    	stylepopupHelper.display = "";
		stylePopup.display = "";    	
    } else {
    	//stylePopup.opacity = 0;
    	//stylepopupHelper.opacity=1;
    	new Effect.Opacity('popupHelper',{ from: 1, to: 0.25 });
    	new Effect.Opacity(whichLayer,{ from: 0, to: 1 });
    	//stylepopupHelperObject.opacity=0.25;
    	//stylePopup.opacity = 1;
    	stylepopupHelper.display = "block";
    	stylePopup.display = "block";
    }
    
}



