function page_edit_form_window( pageid ) {
//function editPagePopUp( pageid ) {	
	var req = new XMLHttpRequest();

	if (window.XMLHttpRequest){
		// code for all new browsers
		req = new XMLHttpRequest();
	} else if (window.ActiveXObject){
		// code for IE5 and IE6
		req = new ActiveXObject("Microsoft.XMLHTTP");
	}
	
	req.open("POST", "includes/ajax-controller.php?do=mnum&sub=getcontent&con_id=" + pageid + "&rnd=" + Math.random(), false);
	req.send(null);
	var pagetext = req.responseText;
	
	req.open("POST", "includes/ajax-controller.php?do=mnum&sub=gettitle&con_id=" + pageid + "&rnd=" + Math.random(), false);
	req.send(null);
	var title = req.responseText;
	
	//alert ('Text :' + _con_fulltext );
	
	var window_form = new Ext.Window({
			id:'windowform',
			overflow: 'auto',
			autoScroll: true,
			title : 'EDIT PAGE CONTENT SAM',
			width: 750,
			height:520,
			border: false,
			bodyBorder: false,
			modal: true,
			items:[{
				xtype: 'form',
				id:'formAddFreeText',
				name: 'form_name',
				frame:true,
				border:false,
				items: [{
						xtype : 'textfield',
						fieldLabel : 'Title',
						labelSeparator: '',
						name: 'con_title',
						id: 'con_title',
						width: 560,
						value: title,
						allowBlank: false
					},{
						xtype: 'fckeditor',
						width: 560,
						Height : 400,
						Name: 'con_fulltext',
						id: 'con_fulltext',
						ToolbarSet: 'Default',
						BasePath: '/awareness_dev/fckeditor/', // If your fckeditor set up the root path,or fix it.
						Value: pagetext,
						fckConfig: {		//CustomConfigurationsPath: 'myconfig.js'
						}
					},{
						xtype:'hidden', 
						name:'con_id',
						id:'con_id', 
						value: pageid												
					}],
					buttons: [{
						text:'Save',
						type: 'submit',
						scope: this,
						handler: function(){
							if(Ext.ComponentMgr.get('formAddFreeText').getForm().isValid()) {
								
								var con_title = Ext.ComponentMgr.get('con_title');
								//alert('test ' + con_title.getValue());
								var con_fulltext = Ext.ComponentMgr.get('con_fulltext');
								//alert('test ' + con_fulltext.getValue());
								var con_id = Ext.ComponentMgr.get('con_id');
								//alert('test ' + con_id.getValue());
								
								Ext.Ajax.request({
									url: 'includes/ajax-controller.php?do=mnum&sub=savecontent',
									method: 'POST',
									success: function( result, request ){
										//alert(' Done '  + result.responseText);
										//Ext.Msg.alert('Success', result.responseText );
										window.location.reload();
										window_form.close();
									},
									failure: function( result, request ){
										alert('Fail', result.responseText );
									},
									params: { 
										con_title: con_title.getValue(),
										con_fulltext: con_fulltext.getValue(),
										con_id: con_id.getValue()
									}
								});									
								
							}
										
				}	
	},{
		text: 'Cancel',
		type: 'button',
		scope:this,
		handler:function() {
			window_form.close();
		}
	
	}]
	}]
	
	});

return window_form
}



