 
function JUSC_GetDefaultAttribut(attribut) {

	_default = {
		id:'container',
		idParent : 'content',
		NodeParent : '',
		type : 'div',
		innerHTML :'',
		content : '',
		type : 'div',
		insertType : 'append',
		DataKey :'',
		pluginFilter :'none',
		popUp : '',
		autoCenter : '',
		width : '',
		height : '',
		value : '',
		cellspacing : "0" ,
		cellpadding : "0" ,
		border : "0",
		align :'left',
		valign:'center',
		height : '100%',
		minHeight : '0px',
		width : '100%',
		title : '',
		closable : '',
		align :'',
		contenteditable:'',
		disabled : '',
		click : '',
		labelFor : '',
		layout : '',
		DataKey : '',
		cssClass  :'',
		checked :''
		
 		}
		return $.extend(_default,attribut);		
	}	


function Layout(attribut) {
	
	Layout.prototype.GetDefaultAttributLayout = function(attribut) {	
	}
	Layout.prototype.CreateBorderLayout = function(attribut) {
	
		L = this.BorderLayout(attribut);
		LAYOUT.o = $.extend(new JUSC_GetDefaultAttribut(), attribut );

		if ( LAYOUT.o.closable == 'true' ){
			this.InitIconsClose( L._layout , L._container );
		}
		if ( LAYOUT.o.dragable == 'true' ){
			this.InitIconsDrag( L._layout , L._container );
		}		
		if ( LAYOUT.o.title != '' ){
			LAYOUT.create({NodeParent:L._container, cssClass : 'title' , innerHTML : LAYOUT.o.title });    
		}
		if ( LAYOUT.o.align != '' ){
			
			if ( this[LAYOUT.o.align] ){
				this[LAYOUT.o.align](L._layout  , LAYOUT.o);
			}
		}
	
	return L._container;

	}

	Layout.prototype.CreatePannel = function(attribut){
		
	LAYOUT = $.extend(new domHTML(), this );
	PANEL =[];
	colProperty = [];
	PANEL.o = $.extend(new JUSC_GetDefaultAttribut(), attribut );
		if (PANEL.o.cols) {
			if ( PANEL.o.id!='' ){
		     div = LAYOUT.create({type:'div',idParent :  PANEL.o.idParent , id : PANEL.o.id});    
      		table = LAYOUT.create({type:'table',NodeParent :  div , width : PANEL.o.width ,  cellspacing : "0" , cellpadding : "0" , border : "0" });    
			}
		else{
		table = LAYOUT.create({type:'table',idParent :  PANEL.o.idParent , width : PANEL.o.width ,  cellspacing : "0" , cellpadding : "0" , border : "0" });    
			
		}
			tr = LAYOUT.create({type:'tr' , NodeParent : table });
			for ( p = 0 ; p < PANEL.o.cols.length ; p ++ ){
			colProperty   = $.extend(new JUSC_GetDefaultAttribut(),PANEL.o.cols[p]);
			td = LAYOUT.create({type:'td' , width : colProperty.width ,valign: 'top',align : 'left' , NodeParent : tr });
			if( colProperty.title){
			div = LAYOUT.create({ NodeParent : td , cssClass : 'titleForm' ,   innerHTML : colProperty.title });	
			}
			div = LAYOUT.create({ id :colProperty.id ,NodeParent : td , width : colProperty.width , cssClass : colProperty.cssClass , height:colProperty.height });	
			}
		}
		if (PANEL.o.lines) {
		table = LAYOUT.create({type:'table', idParent :  PANEL.o.idParent , width : PANEL.o.width ,  cellspacing : "0" , cellpadding : "0" , border : "0" });    
			for ( p = 0 ; p < PANEL.o.lines.length ; p ++ ){
			tr = LAYOUT.create({type:'tr' , NodeParent : table });
			colProperty   = $.extend(new JUSC_GetDefaultAttribut(),PANEL.o.lines[p]);
			td = LAYOUT.create({type:'td' , NodeParent : tr });
			if( colProperty.title){
			div = LAYOUT.create({ NodeParent : td ,  cssClass : 'titleForm' ,   innerHTML : colProperty.title });	
			}
			div = LAYOUT.create({ id :colProperty.id ,NodeParent : td  });	
			}
		}
	}
	
	Layout.prototype.AutoCenterAlign= function(_layout  , attribut) {

		
		_scroll = getPageScroll();
		LAYOUT.o = $.extend(new JUSC_GetDefaultAttribut(), attribut );
		H = String(LAYOUT.o.height) ;
		 
		H = Number( H.replace( "px" , ''));
		W=  String(LAYOUT.o.width) ;
		W = Number( W.replace( 'px' , ''));
		mH =  ( $(window).height() - H ) /2 ;
		mH = mH + _scroll[1] ; 
		mW =  ( $(window).width() - W ) /2 ;
		
		//alert(H);

		$(_layout).css('position' , 'absolute' ) ;
		$(_layout).css('top' , mH+'px' ) ;
		$(_layout).css('left' , mW+'px' ) ;
		
	
	}
	
	
	
		Layout.prototype.AbsoluteAlign= function(_layout  , attribut) {
		scroll = getPageScroll();
		LAYOUT.o = $.extend(new JUSC_GetDefaultAttribut(), attribut );

		$(_layout).css('height' , LAYOUT.o.height ) ;
		$(_layout).css('width' , LAYOUT.o.width ) ;
		$(_layout).css('position' , 'absolute' ) ;
		$(_layout).css('top' ,LAYOUT.o.top+"px" ) ;
		$(_layout).css('left' , LAYOUT.o.left+"px" ) ;
		
	
	}
	
	
	Layout.prototype.getTitle = function(attribut) {

	}
	Layout.prototype.InitIconsDrag = function( _layout , _container ) {
	   	icons = LAYOUT.create({insertType : 'append',NodeParent : _container  ,id : 'moveIcons'   ,display : 'inline' ,   float : 'right'});    
 			$(icons).mousedown(function(e){
			$( _layout ).draggable({ disabled: false });
 			});
			$(icons).mouseup(function(e){
			$( _layout ).draggable({ disabled: true });
			});
	}	
	Layout.prototype.InitIconsClose = function( _layout , _container ) {
	   	icons = LAYOUT.create({insertType : 'append', NodeParent : _container  ,id : 'closeIcons'   ,display : 'inline' ,   float : 'right'});    
			$(icons).mousedown(function(e){
			$(_layout).remove();
			
			});
	}
	Layout.prototype.BorderLayout = function(attribut) {
		
	LAYOUT = $.extend(new domHTML(), this );
	LAYOUT.o = $.extend(new JUSC_GetDefaultAttribut(), attribut );

		H = String(LAYOUT.o.height) ;
		W=  String(LAYOUT.o.width) ;
		
	var recherche = /(px)/g;
	if (recherche.exec(H)){
		H = Number( H.replace( 'px' , ''));
		H = H+"px";
	}
	if (recherche.exec(W)){
		W = Number( W.replace( 'px' , ''));
		W = W+"px";
	}
	
		
		
		
	if( $('#container_'+LAYOUT.o.id))  {$('#container_'+LAYOUT.o.id).remove();}
	
	_layout = LAYOUT.create({idParent : LAYOUT.o.idParent, id : 'container_'+LAYOUT.o.id , cssClass : 'borderLayout'  , width : W });    
	table = LAYOUT.create({type:'table', NodeParent : _layout ,  cellspacing : "0" , cellpadding : "0" , border : "0" });    
	tr = LAYOUT.create({type:'tr' , NodeParent : table });
	td = LAYOUT.create({type:'td' , NodeParent : tr });    
	div = LAYOUT.create({ NodeParent : td , cssClass : 'corner-top-left' });
	td = LAYOUT.create({type:'td' , NodeParent : tr , width : "100%"  });
	div = LAYOUT.create({ NodeParent : td , cssClass : 'plain-top' });
	td = LAYOUT.create({type:'td' , NodeParent : tr  });
	div = LAYOUT.create({ NodeParent : td , cssClass : 'corner-top-right' });
	tr = LAYOUT.create({type:'tr' , NodeParent : table , height : "100%"  });
	td = LAYOUT.create({type:'td' , NodeParent : tr  , height : "100%"  });    
	div = LAYOUT.create({ NodeParent : td , cssClass : 'border-left' });
	td = LAYOUT.create({type:'td' , NodeParent : tr , width : "100%" , height : "100%" , valign : "top"   });
	div = LAYOUT.create({ NodeParent : td , cssClass : 'plain-content' });
 	_container = LAYOUT.create({ NodeParent : div , height : H, overflow : LAYOUT.o.overflow , minHeight : LAYOUT.o.minHeight , id : LAYOUT.o.id });
	td = LAYOUT.create({type:'td' , NodeParent : tr , height : "100%" , cssClass : 'td'  });
	div = LAYOUT.create({ NodeParent : td , cssClass : 'border-right' });
	tr = LAYOUT.create({type:'tr' , NodeParent : table });
	td = LAYOUT.create({type:'td' , NodeParent : tr });    
	div = LAYOUT.create({ NodeParent : td , cssClass : 'corner-bottom-left' });
	td = LAYOUT.create({type:'td' , NodeParent : tr , width : "100%"  });
	div = LAYOUT.create({ NodeParent : td , cssClass : 'plain-bottom' });
	td = LAYOUT.create({type:'td' , NodeParent : tr  });
	div = LAYOUT.create({ NodeParent : td , cssClass : 'corner-bottom-right' });
	elts =[];
	elts._layout = _layout;
	elts._container = _container;

	return ( elts ) ;
	}
}


//alert(container.attr.type);




//maClass = $.extend(new Dispt(),new BorderLayout());

//maClass.plugin('t');
//maClass.test('t');

