
function resizeParentFrame(idClient, idHost){

	var width = 0;
	var height = 0;
	var client;

	client = document.getElementById(idClient);
	
	//alert(client);

	//width = (getObjectWidth(client) + 64) + "px";
	height = (getObjectHeight(client) + 64) + "px";
	
	//alert(width);
	//alert(height);

	window.parent.resizeFrame(idHost, width, height);

	return true;
}

function resizeFrame(id, width, height){
	
	//alert(id);
	//alert(width);
	//alert(height);
	
	var iframeObject;

	iframeObject = document.getElementById(id);

	if(iframeObject) {
	
		if(width <= 0){
			width = getObjectWidth(iframeObject) + "px";
		}
		iframeObject.style.width = width;
		
		
		if(height <= 0){
			height = getObjectHeight(iframeObject) + "px";
		}
		iframeObject.style.height = height;
	}
	
	//alert(width);
	//alert(height);

	return true;
}

function getObjectWidth(object){

	var width = 0;

	if(object) {
		if (object.innerWidth && object.scrollMaxX) {	
			
			width = object.innerWidth + object.scrollMaxX;
		}
		else if (object.scrollWidth > object.offsetWidth) {
		
			width = object.scrollWidth;
		} 
		else {
		
			width = object.offsetWidth;
		}
	}
	
	return width;
}

function getObjectHeight(object){

	var height = 0;

	if(object) {
		if (object.innerHeight && object.scrollMaxY) {
		
			height = object.innerHeight + object.scrollMaxX;
		}
		else if (object.scrollHeight > object.offsetHeight) {
		
			height = object.scrollHeight;
		} 
		else {
		
			height = object.offsetHeight;
		}
	}
	
	return height;
}