function domHTMLDefaultGetAttribut(){
		attr = {
		id:'',
		idParent : 'body',
		type : 'div',
		innerHTML :'',
		NodeParent : '',
		content : '',
		insertType : 'append',
		DataKey :'',
		pluginFilter :'none',
		popUp : '',
		autoCenter : '',
		width : '',
		height : '',
		cssClass : '',
		//top:0+'px',
		//left:0+'px',
		//position : '',
		value : '',
		PluginNode:'',
		visibility:'',
		typeForm:'',
		optionListe :'',
		checked :'',
		confcolums:''
 		}
		return attr;
}


	
tabEvent = new Object ;


movePlug = new Object ;
movePlug.Top = 0 ; 
movePlug.Left = 0 ;
movePlug.Action = 0 ;

 	JUSC_condIf = function(test , actionTrue  , actionFalse  , returnAction) {
	sortie = "";
	if ( test ) {
		if ( returnAction == true ){sortie = actionTrue ; }
		else{ actionTrue;} 
	}
	else {
		if ( returnAction == true ){sortie = actionFalse ; }
		else{ actionFalse;} 
	}
	return sortie;
	}

var eventOrder ={
	
	load : function (a , b , c){
	DomElt = new domHTML(); ;
	DomElt.order(a , b , c);
	},
	replace : function (a , b ){
	DomElt = new domHTML(); ;
	a.replaceWith(DomElt.createTable ( b ) );
	}
	
}
	
function domHTML(attribut) {
		
this.test = "eee";
 
	domHTML.prototype.getAttribut = function(attribut) {
		o = JUSC_condIf(typeof(attribut)=='object',$.extend(new domHTMLDefaultGetAttribut(), attribut), attribut , true ) ;
		return o ; 	
	}
	domHTML.prototype.destruct = function(id) {
		JUSC_condIf($("#"+id)  , $("#"+id).remove() , '', '' ) ;
	}
	
	
  	domHTML.prototype.move = function(layout, container ,  attribut) {
 		o = attribut ;
		if (o['move'] && o['move'] == 'true' )
		{
	   	icons = this.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 });
			});
 		}
	}
	
	
 	domHTML.prototype.close = function(layout, container ,  attribut) {
		o = attribut ;
		if (o['close'] && o['close'] == 'true' )
		{
		//$(elt).css('position' , 'absolute' ) ;
 	   	icons = this.create({insertType : 'append', NodeParent : container  ,id : 'closeIcons'   ,display : 'inline' ,   float : 'right'});    
			$(icons).mousedown(function(e){
			$(layout).remove();
			});
		}
	}
	
 	domHTML.prototype.align = function(elt , attribut) {
 	}

	domHTML.prototype.createNode = function( NodeName , typeNode ) {
		
		elt= document.createElement(NodeName);
		 if(typeNode!='null' ){
			 $(elt).attr('type' , typeNode )
		 }
	
		return elt;
	}
	
	domHTML.prototype.createInexitNode = function(attribut) {

		JUSC_BALISE =[];
		JUSC_BALISE['Text']  = Array( 'input' , 'text' ) ;
		JUSC_BALISE['Checkbox'] = Array( 'input' , 'checkbox' );
		JUSC_BALISE['Password'] =   Array( 'input' , 'password' );
		
		o = this.getAttribut ( attribut );		
 		sortie =  JUSC_BALISE[o.type] ? Array(JUSC_BALISE[o.type][0] ,JUSC_BALISE[o.type][1] ) : Array (o.type , 'null' )  ;
		return sortie ; 	

	}
	
	domHTML.prototype.insert = function(elt , attribut  ) {
		o =  attribut ;
		if ($(o.NodeParent) && o.NodeParent!= ''){
			 $(o.NodeParent)[o.insertType]( elt ) 
		}
		else if($("#"+o.idParent)){
			 $("#"+o.idParent)[o.insertType]( elt ) 
		}
	
 	}
	
	domHTML.prototype.create = function(attribut) {
	
		o   = this.getAttribut ( attribut );
		h   = this.createInexitNode ( o ) ;
		elt = this.createNode( h[0] , h[1] ) ; 
		if ( o.value && o.value!="" &&  !o.innerHTML ) { o.innerHTML = o.value } ; 
 		this.setAttribute (  elt, o );
		this.insert( elt , o);
		return elt;
	
	}

	
	
	domHTML.prototype.setAttribute = function( elt ,attribut ) {

		attr = new Object ;
		o = attribut;
		
		attr.style=Array('width','minHeight','height','position','display','cursor','overflow','color','background','float','padding','margin','vertical-align','font-size','outline','opacity','zIndex','top','left','alpha');
		attr.div = Array('cssClass','id','name','style','contenteditable','innerHTML','value','click','move','position','zIndex');	
		attr.a = Array('cssClass','id','name','style','contenteditable','innerHTML','value','click','move');	
		attr.option = Array('cssClass','id','name','style','selected','innerHTML','value','click' );	
		attr.select = Array('cssClass','id','name','style', 'value','click' );	
		attr.textarea = Array('cssClass','id','name','style', 'value' );	

		attr.p= Array('cssClass','id','name','style','contenteditable','style','innerHTML','value','click','move');	
		attr.table = Array('cssClass','id','name','style','cellspacing','cellpadding','border','align');
		attr.tr = Array('cssClass','id','name','style','align','valign' ,'width','height');
		attr.td = Array('cssClass','id','name','style','align','valign' ,'width','height');
		attr.Text = Array('cssClass','id','name','style','innerHTML','value','disabled','contenteditable');
		
		attr.text = function(elt, o){
				fo = new Form;
				$(elt).replaceWith(fo.text(o)) ;
		}
		
		attr.select = Array('cssClass','id','name','style','value','disabled');
		attr.option = Array('cssClass','id','name','style','value','disabled');
		attr.Checkbox = Array('cssClass','id','name','style','value','disabled','checked');
		attr.button = Array('cssClass','id','name','innerHTML','value','style','disabled','click');

		
		if (  attr[o.type]  ){
			for ( nbs = 0 ; nbs < attr[o.type].length ; nbs ++ ) {
	
				ch = attr[o.type][nbs];
			
				if (o[ch] && ch == 'click' )
				{
					tabEvent[o.id] = new Object ;
					
					tabEvent[o.id].click = o[ch] ;
						$(elt).click(function(e){
							
					tabEvent[$(this).attr('id')].click ( e, $(this) );
					}) ;
										
				}
				 
				else if (o[ch] && ch == 'cssClass' )
				{
					$(elt).addClass(o[ch]);
				}
				else if (o[ch] &&  ( ch == 'innerHTML'  )  )
				{
					$(elt).html(o[ch]);
				}
				else if ( o[ch] && ch != "" && typeof(o[ch] == 'array')  )
				{
					elt.setAttribute(ch,o[ch]);
				}
				
		}
		for ( nbs = 0 ; nbs < attr.style.length ; nbs ++ ) {
	
				ch = attr.style[nbs];
	
				if (o[ch])
				{
					if (ch=="alpha"){
						elt.style.MozOpacity = o[ch]/100 ;
						elt.style.filter = "alpha(opacity= "+o[ch]+")"  ;
					}
					else{
						$(elt).css(ch,o[ch]);
					}
				}
		}
		
		if (  attr[o.PluginNode] && typeof( attr[o.PluginNode]) == 'function' ){		
		attr[o.PluginNode](elt , o);
		}

		}
	}
	
	 


domHTML.prototype.createVerticalTable = function(attribut) {

	attr  = attribut ; 
	u = this.getAttribut ( attr );
	form = new Form;
  	Pannel = this.create({idParent: u.idParent , id : u.id });
  	for ( b = 0 ;b < u.colums.length  ; b ++ ){
		confcolumsSortie = u.colums[b];
		confcolums = $.extend(new domHTMLDefaultGetAttribut(),u.colums[b])  ;
		confcolumsSortie.value = confcolums.type!='button' ? u.DataStore[0][confcolums.id] : confcolums.name ;
		type  = confcolums.type !='div' ? confcolums.type : 'textNoEditable';
		//div = form[type]({disabled :  confcolums.disabled, labelFor : confcolums.labelFor,  id : confcolums.id  , cssClass:confcolums.cssClass , click:confcolums.click,  NodeParent : Pannel ,value : value ,width: confcolums.width });
		if( type == 'button'){
				 
		div = form.button({disabled :  confcolums.disabled, labelFor : confcolums.labelFor,  id : confcolums.id  , cssClass:confcolums.cssClass , click:confcolums.click,  NodeParent : Pannel ,name : confcolums.name ,width: confcolums.width });;
		}
		else{
		div = form[type](Pannel,confcolumsSortie);
		}
	 	
		if ( confcolums.visibility == "hidden" ){
		$(div).css('display','none' );
		}
	}
	
/*		
	attr  = attribut ; 
	u = this.getAttribut ( attr );
	
  	Pannel = this.create({idParent: u.idParent , id : u.id });
  	cont = this.create({NodeParent:Pannel });
	
	
	table = this.create({type:'table', NodeParent :cont ,  cellspacing : "0" , cellpadding : "0" , border : "0" , id : 'TableLayout' , valign : 'top' });    
	
	for ( b = 0 ;b < u.colums.length  ; b ++ ){
		tr = this.create({type:'tr' , NodeParent : table    });
		confcolums = $.extend(new domHTMLDefaultGetAttribut(),u.colums[b])  ;
		td = this.create({type:'td' , NodeParent : tr ,width: confcolums.width , valign : 'top'  });
		div = this.create({ NodeParent :td  , display : 'inline' });
		labelFor = this.create({ insertType : 'after' ,  NodeParent : div  ,value : "&nbsp;"+confcolums.labelFor , padding : '0 0 0 0'});		
		if ( confcolums.visibility == "hidden" ){
		$(tr).addClass('hidden' );
		}
		td = this.create({type:'td' ,cssClass:'TabFormNFTextCenter', NodeParent : tr ,width: confcolums.width, valign : 'top'  });
		value = confcolums.type!='button' ? u.DataStore[0][confcolums.id] : confcolums.name ;
		 
		div = this.create({ PluginNode :confcolums.PluginNode   ,  type : confcolums.type   , id : confcolums.id  , cssClass:confcolums.cssClass , click:confcolums.click,  NodeParent : td ,value : value ,width: confcolums.width });

	}
*/	
return Pannel;

}




	
}






