menu_status = new Array();

function showHide(theid){
    if (document.getElementById) {
    var switch_id = document.getElementById(theid);

        if(menu_status[theid] != 'show') {
           switch_id.className = 'show';
           menu_status[theid] = 'show';
        }else{
           switch_id.className = 'hide';
           menu_status[theid] = 'hide';
        }
    }
}


// Magic Footer for Insta-Insulation

function getWindowHeight() {
	var windowHeight = 0;
	if (typeof(window.innerHeight) == 'number') {
		windowHeight = window.innerHeight;
	} else {
		if (document.documentElement && document.documentElement.clientHeight) {
			windowHeight = document.documentElement.clientHeight;
		} else {
			if (document.body && document.body.clientHeight) {
				windowHeight = document.body.clientHeight;
			}
		}
    }	
    return windowHeight;
}

function newDivs() {
	if (document.getElementById) {
		var windowHeight = getWindowHeight();
		var divs,contDivs,maxHeight,divHeight,d;
		
		divs=document.getElementsByTagName('div');
		contDivs=[];
		
		maxHeight=0;
		
		var mfElement = document.getElementById('mfDynamic');
		
		for(var i=0;i<divs.length;i++) {
			if(/\bcolumn\b/.test(divs[i].className)) {
				d=divs[i];
				contDivs[contDivs.length]=d;
				
				if(d.offsetHeight) {
					divHeight=d.offsetHeight + 260;
				} else if(d.style.pixelHeight) {
					divHeight=d.style.pixelHeight + 260;
				}

				if(divHeight>windowHeight) {
					maxHeight=Math.max(maxHeight, divHeight);
				} else {
					maxHeight=Math.max(maxHeight, windowHeight);
				}
				
			}
		}
		
		mfElement.style.height = (maxHeight - 260) + 'px';
		
	}
}	