/*
---------------------by hhl   08-08-20 created--------------------------

parameters example of function:
------------------------------------------------------------------

-----------------------------------------------------------------
*/
Embraiz.NewWindow=function(config)
{      
   //-----------------------init---------------------------------------------------------------------------------
      
	 var _this=this;
      _this.win=null;
	 _this.contentPanel=null;
	  _this.contentWindow=null;
	 _this.id=config.id;
	 _this.autoScroll=config.autoScroll;
	 _this.resizable=config.resizable; 
     _this.height=config.height;
	 _this.width=config.width;
	 _this.title=config.title;
	 _this.url=config.url;
	 _this.scripts=config.scripts;
	 _this.y=config.y;
	var init = function()
    {   
	    if(_this.y==null)
	    openWindow(); 
		else
		 openWindow1(); 
    }
	init();
    //---------------------init end ----------------------------------------------------------------------------------------
     /*私有区域
	begin
	*/	
		 function openWindow()
		 {
			 
			    
				   var panel = new Ext.Panel({
						id:_this.id+"Panel",						  
						autoScroll:true,
						title       : '',
						region      : 'center',
						split       : true,
						width       : _this.width-25,
						margins     : '0 0 0 0',
						cmargins    : '0 0 0 0'
					}); 
					var  win = new Ext.Window({
								id:_this.id+"Window",
								title    :_this.title ,
								closable : true,
								width    : _this.width,
								height   : _this.height,
								resizable:_this.resizable,
								autoScroll:_this.autoScroll,								
								//border : false,
								plain    : true,
								layout   : 'border',
								modal:true,
								items    : [panel]
							});
					 win.show();
					 panel.load({
									url: _this.url,
									text: "Loading...",
									timeout: 30,
									scripts: _this.scripts
								 });
					 _this.contentPanel=panel;
				     _this.contentWindow=win;
					  
		 }

  function openWindow1()
		 {
			 
			     
				   var panel = new Ext.Panel({
						id:_this.id+"Panel",						  
						autoScroll:true,
						title       : '',
						region      : 'center',
						split       : true,
						width       : _this.width-25,
						margins     : '0 0 0 0',
						cmargins    : '0 0 0 0'
					}); 
					var  win = new Ext.Window({
								id:_this.id+"Window",
								title    :_this.title ,
								closable : true,
								y   : _this.y,
								width    : _this.width,
								height   : _this.height,
								resizable:_this.resizable,
								autoScroll:_this.autoScroll,								
								//border : false,
								plain    : true,
								layout   : 'border',
								modal:true,
								items    : [panel]
							});
					 win.show();
					 panel.load({
									url: _this.url,
									text: "Loading...",
									timeout: 30,
									scripts: _this.scripts
								 });
					 _this.contentPanel=panel;
				     _this.contentWindow=win;
					  
		 }
	//------------ end ---------------------------------------------------------------------------------  
 
 
 
 
 
 
    /*公有区域
	begin
	*/
	     
	 
 


     
	//------------ end ---------------------------------------------------------------------------------
	
 	
	
	

 
 
 
}
