triumphost 120 Posting Whiz

Can someone explain why my function is not working? Description: ToggleFrame(TagID, FrameID).. Given those two, get the two elements.. If the iframe is showing, hide the tagID element.. if the tagID element is showing, hide the iframe..

My attempt & failure:

function ToggleFrame(ID, FrameID){			//Given the tag, show/hide it..
	var IDTag = document.getElementById(ID);
	var FTag = document.getElementById(FrameID);
	
	if(FTag.style.display == 'block')
	{
		IDTag.style.display = 'none';
	}
	else if(IDTag.style.display == 'block')
		FTag.style.display = 'none';
}