//a function that resizes a window
function resizExact(width,height) {
	//get someting to work with
	window.resizeTo(width,height);
	//set the height
	thePageHeight = document.body.clientHeight; //get the height of the window
	winBarHeight = height - thePageHeight; //get the height of the top and bottom bars of the window
	exactPageHeight = winBarHeight + height; //set the height of the window to the height and bars
	//set the width
	thePageWidth = document.body.clientWidth; //get the width of the window
	winBordersWidth = width - thePageWidth; //get the width of the left and right borders of the window
	exactPageWidth = winBordersWidth + width; //set the width of the window to the width and borders
	//resize to exact values
	window.resizeTo(exactPageWidth,exactPageHeight);
}

//a function that sets the height of an iframe
function setIframeHeight(changeValue,iframeId,resizeTo) {
	if (document.getElementById(iframeId)) { //check if the iframe exists
		if (resizeTo == "fullDoc") { //resizes the iframe to the size of the document in it
			newHeight = window.frames[iframeId].document.body.scrollHeight + changeValue; //calculate the new height
		} else { //resizes the iframe to the size of the document containing the iframe
			newHeight = eval('document.'+htmlType()+'.clientHeight') + changeValue; //calculate the new height
		}
		newHeight = newHeight + '';	//make the new height a string and not an integer
		if (newHeight.indexOf("px") == -1) { //check if the value contains 'px'
			newHeight = newHeight + 'px'; //if it doesn't, add it
		}
		document.getElementById(iframeId).style.height = newHeight; //set the height of the iframe
	}
}

//if document is html it returns body else (xhtml) it returns documentElement
function htmlType() {
	if (document.documentElement.clientHeight == 0) {
		return 'body'; //document is html
	} else {
		return 'documentElement'; //document is xhtml
	}
}

function resizeCaller() {
	return setIframeHeight(0,'aciroiframe','fullDoc');
}

if (window.addEventListener) {
	window.addEventListener("load", resizeCaller, false);
} else if (window.attachEvent) {
	window.attachEvent("onload", resizeCaller);
} else {
	window.onload=resizeCaller;
}
