Event.observe(window, "load", resaizeload);
Event.observe(window, "resize", resizeOnResize); 

function resaizeload() {
	var sizeload = getPageSizeWithScroll();
	var h;
	if($('pie') != null)
		h =  document.documentElement.clientHeight-$('bloq_menu').getHeight()-$('migas').getHeight()-$('pie').getHeight()-30;
	else
		h =  document.documentElement.clientHeight-$('bloq_menu').getHeight()-$('migas').getHeight()-30;
	if( $('principal_interior').getHeight() <= document.documentElement.clientHeight){
		document.getElementById("bloq_interior").style.height=h+"px";
	}
	if(document.getElementById("mapFrame") != null)
		document.getElementById("mapFrame").src = urlIMapa;
}

function resizeOnResize() {
	var sizeload = getPageSizeWithScroll();
	var h;
	if($('pie') != null)
		h =  document.documentElement.clientHeight-$('bloq_menu').getHeight()-$('migas').getHeight()-$('pie').getHeight()-30;
	else
		h =  document.documentElement.clientHeight-$('bloq_menu').getHeight()-$('migas').getHeight()-30;
	if( $('principal_interior').getHeight() <= document.documentElement.clientHeight){
		document.getElementById("bloq_interior").style.height=h+"px";
	}
}

function resaizeresize() {
	//if(sizeload == 0) {
	//	$('bloq_interior').setStyle({height:'0%'});
	//} 
	//else  {
	//var h;
		//if($('pie') != null){
		//	h =  document.documentElement.clientHeight-$('bloq_menu').getHeight()-$('migas').getHeight()-$('pie').getHeight()-30;
		//else
		//	h =  document.documentElement.clientHeight-$('bloq_menu').getHeight()-$('migas').getHeight() - 20;
		//$('bloq_interior').setStyle({height:h+'px'});
		//if($('pie') != null)
		//	sizeload = h +$('bloq_menu').getHeight()+$('migas').getHeight()+$('pie').getHeight();
		//else
		//	sizeload = h +$('bloq_menu').getHeight()+$('migas').getHeight();
	//}

}

function getPageSizeWithScroll(){
	if (window.innerHeight && window.scrollMaxY) {// Firefox
		yWithScroll = window.innerHeight + window.scrollMaxY;
		xWithScroll = window.innerWidth + window.scrollMaxX;
		
	} else if (document.body.scrollHeight > document.body.offsetHeight){ // all but Explorer Mac
		yWithScroll = document.body.scrollHeight;
		xWithScroll = document.body.scrollWidth;
	} else { // works in Explorer 6 Strict, Mozilla (not FF) and Safari
		yWithScroll = document.body.offsetHeight;
		xWithScroll = document.body.offsetWidth;
 	}
 	arrayPageSizeWithScroll = new Array(xWithScroll,yWithScroll);
	//alert( 'The height is ' + yWithScroll + ' and the width is ' + xWithScroll );
	return yWithScroll;
}




