                                                                                                                                                                                                                               
var PhotoForm = new Ext.FormPanel ({
		frame:true,
		method:'POST',
		layout:'column',
		items  : [{
					columnWidth: .5,
					layout: 'form',				
					items:[{ 
							xtype: 'box',
							style:'padding:10px 0px',
							autoEl: 
							{ tag: 'div',
							  html: '<div align="left">'+ webcam.get_html(220,220) +'</div>'
							}
						}]				
			   },
			      {
					columnWidth: .5,
					layout: 'form',				
					items:[{ 
							xtype: 'box',
							style:'padding:10px',
							autoEl: 
							{ tag: 'div',
							  html: '<div id="upload_results" style="float:left;"></div>'
							}
						}]			
			   },
			  
			   {
					columnWidth: .1,
					layout: 'form',				
					items:[{
							xtype: 'hidden', 
							id:'file',
							name:'file'
						},{ 
							xtype: 'hidden', 
							id:'actiontype',
							name:'actiontype'
						},{ 
							xtype: 'hidden', 
							id:'x1',
							name:'x1'
						},{ 
							xtype: 'hidden', 
							id:'y1',
							name:'y1'
						},{ 
							xtype: 'hidden', 
							id:'width',
							name:'width'
						},{ 
							xtype: 'hidden', 
							id:'height',
							name:'height'
						}]				
			   }]
 
	});
var PhotoWindow = new Ext.Window({
        title: 'Photo Capture',
		width:500,		
		height:320,		
		closeAction:'hide',
		closeable:false,
		collapsible:true,
		items: PhotoForm,
		buttonAlign:'center',
		buttons: [{
				text: 'Capture',
				iconCls:'icon-camera',
				width:60,
				handler: function(){
					take_snapshot();
					}
			},{
				text: 'Close',
				iconCls:'icon-close',
				width:60,
				handler: function(){
					PhotoWindow.hide();				
				/*var x1     		= Ext.getCmp('x1').getValue();
				var y1      	= Ext.getCmp('y1').getValue();
				var width   	= Ext.getCmp('width').getValue();
				var height  	= Ext.getCmp('height').getValue();
				var file    	= Ext.getCmp('file').getValue();
				var actiontype  = Ext.getCmp('actiontype').getValue();*/

				/*Ext.Ajax.request({
				url:'saveCrop.php',
				method:'POST',
				params: {x1:x1,y1:y1,width:width,height:height,file:file,actiontype:actiontype},
				waitMsg:'Loading',
				success: function(resp) {
					varduplicate=Ext.decode(resp.responseText).success;
					if(varduplicate == "true"){
						
						PhotoWindow.hide();
					}
				}				
			});*/
				
				}},
			  {
				text: 'Configure',
				iconCls:'icon-setting',
				tabIndex: 4,
				width:60,
				handler: function(){
					webcam.configure();
				}
			}]

	});
	
	PhotoWindow.on('hide',function(){
			PhotoWindow.hide();
			//location.href="addedit-student.php";
		
		
         });
		 
		 
		 
		 
		 