// JavaScript Document

function loadDimensions()
{
	try{
		available_height=document.viewport.getHeight();
		available_width=document.viewport.getWidth();				
		header_dimensions = header.getDimensions();	
		footer_dimensions =footer.getDimensions();		
	}catch(e){alert("error in function loadDimensions(document_structure_utilities.js). Error:"+e)}
}

var the_scroll;

function page_assembly(called_from)
{	
	try{	
		if (!pre_loading_completed() ) {
			page_assembly.delay(global_delay,called_from);		
		}
		else {
			//alert(called_from)
			
		//	resize_middle_container();
			patientez.style.left = "455px";
			patientez.style.position = "absolute";
			patientez.style.top = "200px";
			post_assembly('page_assembly');//in initializer
		}
	}catch(e){"error in function page_assembly() in document_structure"+e}
		
}

function frame_assembly(target)
{
	container.innerHTML="<iframe id='cyclo_frame' src='"+target+"' style='display:block;width:100%;height:100%'"
	+" scrolling='no' frameborder=0></iframe>";
	post_assembly('frame_assembly');//in initializer
}

function resize_middle_container()
{
	
	if(current_window!="index")
			{
				if ($("middle_container").getHeight() < available_height-header.getHeight()-footer.getHeight()) {
					container.style.height = available_height-header.getHeight()-footer.getHeight();
					main_container.style.height = available_height-footer.getHeight();
					$("sub_main_container").style.height = available_height-footer.getHeight();
					the_scroll = 0;
					if($("inner_middle")!=null)
						$("inner_middle").style.height = parseInt(container.style.height)-30;
				}
				else {				
				
					container.style.height = $("middle_container").getHeight();
					main_container.style.height = $("middle_container").getHeight()+header.getHeight();
					$("sub_main_container").style.height = $("middle_container").getHeight()+header.getHeight();
					the_scroll = document.body.scrollHeight-document.viewport.getHeight()-33;
				}
			}
}

function min_size(min_height, the_window)
{
	if(the_window==null)
		the_window = $("middle_container");

	if(the_window.getHeight()<min_height)
		the_window.style.height = min_height;
}

