/* Static variables */

var avoidElements = new Array('head','foot');

/* End static variables */



/* Standard framework function to give mCCWrapper the remaining window height if avoidElements is defined */

function autosize_mCCWrapper(){
	try { 
		var offsetHeight = 0;
		var windowHeight = window.getSize().y;
		avoidElements.each(function(el,i){
			offsetHeight += $(el).getSize().y;
		});
		var totalElementHeight = offsetHeight + $('mCC').getSize().y;
		var newHeight = windowHeight - offsetHeight;
		$('mCCWrapper').setStyle('height', newHeight+'px');
	 	graphicHeight = (newHeight > $('mCC').getSize().y ? newHeight : $('mCC').getSize().y );
		$$('div.background').setStyle('height', graphicHeight+'px');
		$$('div.splash').setStyle('height', graphicHeight+'px');
	} 
	catch (e){ /* console.log(e);*/ }
}

/* Standard framework function to maximize mCCWrapper to full window height and centering mCC within it. */

function center_center(CC,C){
	try {
		if($chk($('head'))) $('head').setStyle('display','none');
		if($chk($('foot'))) $('foot').setStyle('display','none');
		if($chk(CC)&&$chk(C)){
			var windowHeight = window.getSize().y;
			var space = (windowHeight-C.getSize().y)/2;
			var newHeight = windowHeight - space;
			CC.setStyle('padding-top',space+'px');
			CC.setStyle('height',newHeight+'px');
		}
	} 
	catch (e){ }
}

