////////////////////////////////////////////
//					  //
//	Requires: getPageAttributes       //
//                                        //
////////////////////////////////////////////

//window.onresize += function(){ frostingResize();};

function freeze(){
	var pageSize = getPageSize();
	var frosting = document.createElement('DIV');
	frosting.id = 'frosting';
	frosting.style.cssText = 'display:block; position:absolute; z-index:10; top:0px; left:0px; height:' + (pageSize.height + 20) + 'px; width:' + (pageSize.width + 20) + 'px; background-color:#484848; filter:alpha(opacity = 50); opacity:0.5; -moz-opacity:0.5;';
	document.body.appendChild(frosting);
	
	document.body.style.overflow = 'hidden';
    document.documentElement.style.overflow = 'hidden';
}

function unfreeze(){
	var frosting = document.getElementById('frosting');
	document.body.removeChild(frosting);
	document.body.style.overflow = 'visible';
	document.documentElement.style.overflow = 'auto';
}

function frostingResize(){
	var pageSize = getPageSize();
	
	var frosting = document.getElementById('frosting');
	if(frosting != null){ 
		frosting.style.height = (pageSize.height + 20) + 'px';
		frosting.style.width = (pageSize.width + 20) + 'px';	
	}
	
}