


Ext.onReady(function (){
					  
					  
	Ext.QuickTips.init();
	Ext.form.Field.prototype.msgTarget = 'side';
	//"qtip","title","under","side",
	
	Ext.BLANK_IMAGE_URL = "../../../multimedia/ext/resources/images/default/s.gif"  ;
    
////form1
    var fp = new Ext.FormPanel({
        frame: true,
       // title:'安装方式',
        labelWidth: 70,
		width: 200,

       	renderTo:'basicset',
        bodyStyle: 'padding:0 10px 0;',
        layout : "fit",		
		items: [{
            	//baseCls: 'x-plain',
				xtype:'fieldset',
				title: '基础设置',
				autoHeight: true,
				//checkboxToggle:true,
				collapsible: true,
				//collapsed: true,
				
				items: [
					{
					  fieldLabel:"宽　　度",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"w",
					  id:"boxw",
					  minValue : rule.boxSize.w.Rmin,
					  maxValue : rule.boxSize.w.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.w.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.w.Rmax,
					  allowBlank: false,
				      allowDecimals: false, // 允许小数点
  					  allowNegative: false // 允许负数
					},{
					  fieldLabel:"高　　度",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"h",
					  id:"boxh",
					  labelSeparator: ':',
					  minValue : rule.boxSize.h.Rmin,
					  maxValue : rule.boxSize.h.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.h.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.h.Rmax,
					  allowBlank: false,
				      allowDecimals: false, // 允许小数点
  					  allowNegative: false // 允许负数
					},{
					  fieldLabel:"深　　度",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"d",
					  id:"boxd",
					  labelSeparator: ':',
					  minValue : rule.boxSize.d.Rmin,
					  maxValue : rule.boxSize.d.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.d.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.d.Rmax,
					  allowBlank: false,
				      allowDecimals: false, // 允许小数点
  					  allowNegative: false // 允许负数
					}/*,{
					  fieldLabel:"顶部分割",//文本框标
					  name:"h2",
					  id:"Mpanel",
					  labelSeparator: ':',
					  xtype : "combo",
					  store: rule.boxSize.MPanel,
					  typeAhead: false,
					  mode: 'local',
					  triggerAction: 'all',
					  emptyText:'请选择...',
					  width:80,
					  minChars:4,
					  editable:false
					}*/
					/*,{xtype: 'radiogroup',
						  fieldLabel: '第七扇门',
						  items: [
							  {boxLabel: '前滑轨', name: 'hg7', inputValue: 1},
							  {boxLabel: '后滑轨', name: 'hg7', inputValue: 0}// checked: true
		  
						  ]
				   
					  }*/
				
				
					]
      		  },{
            	//baseCls: 'x-plain',
				xtype:'fieldset',
				title: '填缝设置',
				autoHeight: true,
				//checkboxToggle:true,
				collapsible: true,
				collapsed: true,
				items: [
					{
					  fieldLabel:"左填缝板",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"sfc",
					  id:"boxLfill",
					  labelSeparator: ':',
					  minValue : rule.boxSize.fill.Rmin,
					  maxValue : rule.boxSize.fill.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.fill.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.fill.Rmax,
					  //allowBlank: false,
				      allowDecimals: false, // 允许小数点
  					  allowNegative: false // 允许负数
					},{
					  fieldLabel:"右填缝板",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"sfc2",
					  id:"boxRfill",
					  labelSeparator: ':',
					  minValue : rule.boxSize.fill.Rmin,
					  maxValue : rule.boxSize.fill.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.fill.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.fill.Rmax,
					  //allowBlank: false,
				      allowDecimals: false, // 允许小数点
  					  allowNegative: false // 允许负数
					},{
					  fieldLabel:"顶填缝板",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"h3",
					  id:"boxTfill",
					  labelSeparator: ':',
					  minValue : rule.boxSize.Tfill.Rmin,
					  maxValue : rule.boxSize.Tfill.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.Tfill.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.Tfill.Rmax,
					  //allowBlank: false,
					  allowDecimals: false, // 允许小数点
					  allowNegative: false // 允许负数
		  
					}
				
				
				]
        		},{
            	//baseCls: 'x-plain',
				name:"ANMOD",
				id:"ANMOD",
				//itemId :"ANMOD",
				xtype:'fieldset',
				title: '碰撞保护',
				autoHeight: true,
				checkboxToggle:true,
				//collapsible: true,
				collapsed: true,
				items: [
					{
					  fieldLabel:"前部碰撞",//文本框标
					  xtype:"numberfield",//表单文本框
					  name:"ud1",
					  id:"Fclear",
					  labelSeparator: ':',
					  minValue : rule.boxSize.Fclear.Rmin,
					  maxValue : rule.boxSize.Fclear.Rmax,
					  //minText : '允许最小值为'+rule.boxSize.Fclear.Rmin,
					  //maxText : '允许最大值为'+rule.boxSize.Fclear.Rmax,
					  //allowBlank: false,
				      allowDecimals: false, // 允许小数点
  					  allowNegative: false // 允许负数
					}
				
				
				]
        }
		],
        
        buttons: [{
            text: '确定',
            handler: function(){
               if(fp.getForm().isValid()){
				   //var ANVar=fp.getForm().getValues(true).split(/&/g);
				   var ANVar=fp.getForm().getValues(true).replace(/&/g,';');
				   
				   setFormToPvar(fp.getForm().getValues() ,FormRelPvar)
				   updata(	 ANVar)
/*                    Ext.Msg.alert('Submitted Values', 'The following will be sent to the server: <br />'+ 
                        fp.getForm().getValues(true).replace(/&/g,', '));*/
                }
            }
        },{
            text: '取消',
            handler: function(){
				fp.getForm().setValues(getPvarToFrom(FormRelPvar))
                //fp.getForm().reset();
            }
        }]
    });


//////大窗体
  view=new Ext.Viewport({ 
         enableTabScroll:true, 
         layout:"border", 
         items:[ 
            { 
                 title:'',
				 region:'center',
				  layout : "fit",
				 //contentEl: 'CDiv',
				 items: [
						 {	xtype : "tabpanel",
							 activeTab:0,
						 	items : [
									 {	xtype : "panel",
									 	title : "基础设置",
										id:"az",
										layout : "fit",
										//contentEl:'anzhuang',
										items: [fp],
										//html:fp,
										autoScroll: true,
										listeners:{
											"activate":function() {   
								                                    
																	fp.getForm().setValues(getPvarToFrom(FormRelPvar))
																	//fp.setValues(tt[boxw.id]);   
																	//alert(11)
											}
										}
									 },/*
									 {	xtype : "panel",
									 	title : "区域设定",
										contentEl:'Section_she',
										autoScroll: true

									  },*/
									 {	xtype : "panel",
									 	title : "帮助",
										layout : "fit",
										//autoLoad :{ url: '帮助说明.htm'} ,
										//url:'帮助说明.htm',
										 html:' <iframe scrolling="auto" frameborder="0" width="100%" height="100%" src="移门录像/移门录像_demo.htm"> </iframe>',
										autoScroll: true
										
									 }
									 ]
						}
						]// ,bbar
				 
				/*bbar:[
					  {xtype:"tbtext",
					text:'注意：设计移门时请打开移门及抽屉检查碰撞情况。',
					style: 'color: #F00;',
					pressed : false
					
				  }
					  
					  ]*/
                
               
             } 
         ] 

		})
  
  
  
  	//////气球		
/*	var _tip = new Ext.slider.Tip({
        getText: function(thumb){
            return String.format('<b>{0} 宽</b>', thumb.value);
        }
    });*/
	

	//滚动条
/*   slider = new Ext.Slider({
        renderTo: 'multi-slider-horizontal',
        width   : 600,
        minValue: 0,
        maxValue: boxSize.Sw,
        values  : VSection.w.slide,
		decimalPrecision:0,
		keyIncrement:50, 
		clickToChange: false,
        plugins : _tip,
		listeners:{
					dragend :	function(s,e){
							
							_Sdata=s.getValues()
							_Cw=0
							
							for(i=0;i<maxncfg;i++){
								var _Unit=Ext.get("basic"+i)
								if(i<_Sdata.length){
									
									_Unit.setWidth((_Sdata[i]-_Cw)/boxSize._Wbi,true);
									_Unit.dom.innerHTML="宽"+(_Sdata[i]-_Cw)+"<BR>"+"高"+_UnitSize.Sh
									_Cw=_Sdata[i]
								
								}else if (i==_Sdata.length){
									
									_Unit.setWidth((boxSize.Sw-_Cw)/boxSize._Wbi,true);
									_Unit.dom.innerHTML="宽"+(boxSize.Sw-_Cw)+"<BR>"+"高"+_UnitSize.Sh
								}else {
									_Unit.setWidth(0,false);
									_Unit.dom.innerHTML=""	
								}
							}
							
							
						}
					}	
    });*/

	///弹出窗体


		  Sectionform = new Ext.form.FormPanel({
			  baseCls: 'x-plain',
			  layout:'absolute',
			  //url:'save-form.php',
			  
			  defaultType: 'textfield',
	  
			  items: [{
				  x: 0,
				  y: 5,
				  xtype:'label',
				  text: '宽度:'
			  },{
				  x: 60,
				  y: 0,
				  name: 'to',
				  anchor:'100%'  // anchor width by percentage
			  },{
				  x: 0,
				  y: 35,
				  xtype:'label',
				  text: 'test2:'
			  },{
				  x: 60,
				  y: 30,
				  name: 'subject',
				  anchor: '100%'  // anchor width by percentage
			  },{
				  x:0,
				  y: 60,
				  xtype: 'textarea',
				  name: 'msg',
				  anchor: '100% 100%'  // anchor width and height
			  }]
		  });
	  
		  Sectionwindow = new Ext.Window({
			  title: '区域设定',
			  width: 500,
			  height:300,
			  minWidth: 300,
			  minHeight: 200,
			  layout: 'fit',
			  plain:true,
			  closeAction : 'hide',
			  bodyStyle:'padding:5px;',
			  buttonAlign:'center',
			  items: Sectionform,
	  
			  buttons: [{
				  text: '确认'
			  },{
				  text: '取消'
			  }]
		  });
			
////////初始化

//sectionInit();



	//设置默认值
//var topcombo=view.items.items[0].topToolbar.findByType("combo");
//topcombo[0].setValue(Pvar.ncfg);
//aa
//slider.setValue([100,200,300,400,500,600],true)
//topcombo[1].setValue(dcn.num[0]);
//topcombo[1].fireEvent("select");
			
////////取消屏幕遮罩			
document.getElementById('loading-mask').style.display = 'none';
document.getElementById('loading').style.display = 'none';


})

