// A function to find all specified objects on a page and then show/hide them by definining the 'visibility' parameter to 'show' or 'hide'
// Function needed for IE 6 and below to hide select objects when dropdown layers are to be displayed (otherwise the select obj is showing through the layer)

// Object detection of IE7
var ie7 = (document.documentElement && typeof document.documentElement.style.maxHeight!="undefined")? true:false;

function tagVisibility(tag, visibility) {
	try {
	    if(ie && !ie7){ // Only fire if IE and not (e.g. less than)  IE7
	        var numOfForms = document.forms.length;
	        
	        for(var f=0; f<numOfForms; f++){
	            theForm = document.forms[f];

	            for(var i=0; i<theForm.length; i++){
	                var theElement = theForm.elements[i];
	                if(theElement.tagName == tag){
	                    if(visibility == 'hide'){
	                        hideElement(theElement);
	                    }else if(visibility == 'show'){
	                        showElement(theElement);
	                    }
	                }
	                
	                
	            }
	        }
	    }
	} catch (e) {}
}

function showElement(obj){
	obj.style.visibility = "visible";
}

function hideElement(obj){
	obj.style.visibility = "hidden";
}
