$(function() {
	/*$('#bx-panel').css({'display': 'block'});*/
	var bpw = $('#bx-panel').outerHeight();
	$('#bx-panel-back').css({'display' : 'block', 'height' : bpw + 'px'});
	$('#header_cont').css({'top' : bpw + 'px'});
	$('.butheart').css({'top' : bpw + 'px'});
	$('.bx-core-window').css({'top' : bpw + 'px'});
	$('.bx-core-dialog').css({'top' : bpw + 'px'});
	var smb = $('#side_main_back').position().top;
	$('#side_main_back').css({'top' : smb + bpw + 'px'});
	
	$('#bx-panel-hider').bind('click', function(){
		bpw1 = $('#bx-panel').outerHeight();
		$('#bx-panel-back').css({'display' : 'block', 'height' : bpw1 + 'px'});
		$('#header_cont').css({'top' : bpw1 + 'px'});
		$('.butheart').css({'top' : bpw1 + 'px'});
		$('.bx-core-window').css({'top' : bpw1 + 'px'});
		$('.bx-core-dialog').css({'top' : bpw1 + 'px'});
		var smb = $('#side_main_back').position().top;
		$('#side_main_back').css({'top' : smb - bpw +  bpw1 + 'px'});
	});
	
	$('#bx-panel-expander').bind('click', function(){
		bpw2 = $('#bx-panel').outerHeight();
		$('#bx-panel-back').css({'display' : 'block', 'height' : bpw2 + 'px'});
		$('#header_cont').css({'top' : bpw2 + 'px'});
		$('.butheart').css({'top' : bpw2 + 'px'});
		$('.bx-core-window').css({'top' : bpw2 + 'px'});
		$('.bx-core-dialog').css({'top' : bpw2 + 'px'});
		var smb = $('#side_main_back').position().top;
		$('#side_main_back').css({'top' : smb - bpw1 + bpw2 + 'px'});
	});
	
	$('#bx-panel-pin').bind('click', function(){
		bpw1 = $('#bx-panel').outerHeight();
		$('#bx-panel-back').css({'display' : 'block', 'height' : bpw1 + 'px'});
		$('#header_cont').css({'top' : bpw1 + 'px'});
		$('.butheart').css({'top' : bpw1 + 'px'});
		$('.bx-core-window').css({'top' : bpw1 + 'px'});
		$('.bx-core-dialog').css({'top' : bpw1 + 'px'});
	});
	
	$('#bx-panel-pin.bx-panel-fixed').bind('click', function(){
		bpw2 = $('#bx-panel').outerHeight();
		$('#bx-panel-back').css({'display' : 'block', 'height' : bpw2 + 'px'});
		$('#header_cont').css({'top' : bpw2 + 'px'});
		$('.butheart').css({'top' : bpw2 + 'px'});
		$('.bx-core-window').css({'top' : bpw2 + 'px'});
		$('.bx-core-dialog').css({'top' : bpw2 + 'px'});
	});
	
	/*$('#bx-panel-pin').bind('click', function(){
	if (flag == 1) {
		var smb = $('#side_main_back').position().top;
		$('#side_main_back').css({'top' : smb + 'px'});
	} else (flag ==0) {
		var smb = $('#side_main_back').position().top;
		$('#side_main_back').css({'top' : smb - bpw +  bpw1 + 'px'});
	}
	});*/
});

