var datefields = new Array();

Ext.onReady(function(){
    createExtJsDateFields();
});

function createExtJsDateFields(){
    //loop the dates and create extjs date fields from them
    for(x=0;x<datefields.length;x++){
        var datefield = new Ext.form.DateField({
            applyTo : datefields[x],
            hideLabel:true,
            height: "5px",
            selectOnFocus:true,
            format : gDateFormat
        });
    }
}