// based on http://www.aspandjavascript.co.uk/javascript/javascript_api/get_element_width_height.asp and http://www.howtocreate.co.uk/tutorials/javascript/browserwindow
function getIFrame() {
	var iFrame = document.getElementsByTagName('iframe')[0];
	var menuWidth = 256;
	if(document.getElementById) {
		menuWidth = document.getElementById('navigation').offsetWidth;
	}	
	resizeIFrame(iFrame,menuWidth);
	window.onresize = function() {
		resizeIFrame(iFrame,menuWidth);
	}
}
	
function resizeIFrame(iFrame,menuWidth) {
	var windowWidth = 800;
	if( typeof( window.innerWidth ) == 'number' ) {
		//Non-IE
		windowWidth = window.innerWidth;
	} else if( document.documentElement && ( document.documentElement.clientWidth || document.documentElement.clientHeight ) ) {
		//IE 6+ in 'standards compliant mode'
		windowWidth = document.documentElement.clientWidth;
	} else if( document.body && ( document.body.clientWidth || document.body.clientHeight ) ) {
		//IE 4 compatible
		windowWidth = document.body.clientWidth;
	}	
	iFrame.width = windowWidth-menuWidth;
	iFrame.style.width = (windowWidth-menuWidth)+'px';
}

if (document.all&&window.attachEvent) {
	// IE-Win 
	window.attachEvent("onload", getIFrame);
} else if (window.addEventListener) {
	// Others
	window.addEventListener("load", getIFrame, false);
}
