/*
 *	Class: phone.middle
 *	Handles everything inside the mid-section of the phone
 */
phone.middle = {};


/*
 *	Function: setup
 *	Initilizes the mid-section of the phone. Sets vars, events, etc
 */
phone.middle.setup = function() {
	phone.middle.$container	= $("#phone_middle");
	phone.middle.$sections	= phone.middle.$container.find('section');
	phone.middle.container_height = phone.middle.$container.height();
};

/*
 *	Function: close
 *	Completely close the mid-section of the phone. 
 *
 *	See Also: 
 *		<phone.call.start>
 */
phone.middle.close = function() {
	phone.top.$container.animate({'height':41},200);
	phone.top.$container.find('nav .button, nav .active').fadeOut(200);
	phone.middle.$container.animate({'height':0},200);
};

/*
 *	Function: open
 *	Open the mid-section back up, when the call is done
 *
 *	See Also: 
 *		<phone.call.showEnd>
 */
phone.middle.open = function() {
	phone.top.$container.animate({'height':78},200);
	phone.top.$container.find('.active,.keypad,.contacts,.history').fadeIn(200);
	phone.middle.$container.animate({'height':phone.middle.container_height},200);
	if(CLIENT == 'hyves' || CLIENT == 'shell') phone.$container.animate({'margin-top':0, 'height':420},200);
};

