Ext.onReady(function(){
    
	
	var frmNewEntry = new Ext.form.FormPanel({
		id			: 'frmNewEntry',
	    labelWidth	: 120,
	    border		: false,
	    itemCls		: 'sl-label-icon',
	    height		: 154,
	    items: [{
	     	xtype		: 'textfield',
	        fieldLabel	: 'Name',
	        name		: 'gueAutor',
	        id			: 'gueAutor',
	        width		: 225
	    },{
	     	xtype		: 'textarea',
	        fieldLabel	: 'Ihre Meinung',
	        name		: 'gueText',
	        id			: 'gueText',
	        height		: 90,
	        width		: 225
	    }]
	});
	
	mvGuestbookInsert = new Ext.Window({
        title       : 'Neuer Eintrag ins Gaestebuch!',
        width       : 400,
        height      : 210,
        modal		: true,
        defaults:{
			bodyStyle:"padding:5px 5px 5px 5px;"
		},
        items: [frmNewEntry],
        buttons: [{
            text     : 'Eintragen',
            handler  : function(){
        		
        		if(Ext.getCmp('gueAutor').getValue()==""){
        			alert("Es konnte keine Eintrag im Feld 'Name' ermittelt werden!");
        			return;
        		}
        		if(Ext.getCmp('gueText').getValue()==""){
        			alert("Es konnte keine Eintrag im Feld 'Ihre Meinung' ermittelt werden!");
        			return;
        		}
 
                Ext.Ajax.request({
                	url: './includes/HandleData.php',
    			    params:{
    			            DataHandle	: 'SetGuestbookEntry',
    			            gueAutor	: Ext.getCmp('gueAutor').getValue(),
    			            gueText		: Ext.getCmp('gueText').getValue()
    			    },
    			    success: function(resp){
    			    	try{
    					    var respArr = Ext.decode(resp.responseText);
    				    }catch(e){}
        					
    				    if(respArr){
    					    if(respArr.success){
        							
    					    	SuccessTrue = true;
    					    }
    				    }
    				    dsMvGuestbook.load();
    				    mvGuestbookInsert.hide();
    			    }
                });
            }
        },{
            text     : 'Schliessen',
            handler  : function(){
        		mvGuestbookInsert.hide();
            }
        }]
    });

	
 });
