// JavaScript Document

function admin_overlay() {

	this.id;
	this.status;
	this.images_path;
	
	this.left_panel_id;
	this.left_panel_status;
	this.left_panel_open_image_scr;
	this.left_panel_close_image_scr;
	this.current_left_panel_id;
	
	this.right_panel_id;
	this.right_panel_status;
	this.right_panel_open_image_scr;
	this.right_panel_close_image_scr;
	this.current_right_panel_id;
	
	this.content_panel_id;
	this.content_panel_status;
	this.content_panel_open_image_scr;
	this.content_panel_close_image_scr;
	this.current_content_panel_id;
	
}


admin_overlay.prototype.openLeftPanel = function(){
	
	if ( this.left_panel_status == 'open' ) return;
	
	$( 'left_panel' ).morph('width:300px',{duration:0.5});
	$( 'admin_overlay' ).morph('left:300px',{duration:0.5});
	$( 'left_pfeil' ).src = this.images_path + this.left_panel_close_image_scr;
	this.left_panel_status = 'open';
	
} // end openLeftPanel


admin_overlay.prototype.closeLeftPanel = function(){
	
	if ( this.left_panel_status == 'closed' ) return;
	
	$( 'left_panel' ).morph('width:8px',{duration:0.5});
	$( 'admin_overlay' ).morph('left:8px',{duration:0.5});
	$( 'left_pfeil' ).src = this.images_path + this.left_panel_open_image_scr;
	this.left_panel_status = 'closed';
	
} // end closeLeftPanel


admin_overlay.prototype.openRightPanel = function(){
	
	if ( this.right_panel_status == 'open' ) return;
	
	$( 'right_panel' ).morph('width:300px',{duration:0.5});
	$( 'right_pfeil' ).src = this.images_path + this.right_panel_close_image_scr;
	this.right_panel_status = 'open';
	
} // end openRightPanel


admin_overlay.prototype.closeRightPanel = function(){
	
	if ( this.right_panel_status == 'closed' ) return;
	
	$( 'right_panel' ).morph('width:8px',{duration:0.5});
	$( 'right_pfeil' ).src = this.images_path + this.right_panel_open_image_scr;
	this.right_panel_status = 'closed';
	
} // end closeRightPanel


admin_overlay.prototype.mouseOverRightPanel = function(){
	
	if ( this.right_panel_status == 'open' ) return;
	else {
		this.openRightPanel();
		$( 'right_panel' ).onmouseover = '';
		$( 'right_panel' ).onmouseout = this.closeRightPanel;
	}
	
} // end mouseOverRightPanel


admin_overlay.prototype.mouseOutRightPanel = function(){
	
	if ( this.right_panel_status == 'closed' ) return;
	else this.closeRightPanel();
	
} // end mouseOverRightPanel


admin_overlay.prototype.openContentPanel = function(){
	
	if ( this.content_panel_status == 'open' ) return;
	
} // end openRightPanel


admin_overlay.prototype.closeContentPanel = function(){
	
	if ( this.content_panel_status == 'closed' ) return;
	
} // end closeRightPanel


admin_overlay.prototype.togglePanel = function( panel ){
	
	switch ( panel ) {

		case "left":
			if ( this.left_panel_status == 'open' ) this.closeLeftPanel();
			else this.openLeftPanel();
    		break;
  		case "right":
			if ( this.right_panel_status == 'open' ) this.closeRightPanel();
			else this.openRightPanel();
    		break;
  		case "content":
			if ( this.content_panel_status == 'open' ) this.closeContentPanel();
			else this.openContentPanel();
    		break;

	} // end switch

	
} // end closeRightPanel
