var label=Array();label.checkin="Arrivée";label.checkout="Départ";label.Code="Code client / Code offre spéciale";label.CodeEmpty="Entrez votre code";label.URL="../codes.php";Ext.onReady(function(){Ext.QuickTips.init();var c=new Date();var d=1000*60*60*24;var b=new Ext.form.ComboBox({store:new Ext.data.JsonStore({url:label.URL,root:"data",fields:[{name:"Legende"},{name:"Code"},{name:"id"}]}),hiddenName:"code",displayField:"Legende",valueField:"Code",mode:"remote",triggerAction:"all",emptyText:label.CodeEmpty,fieldLabel:label.Code,});var a=new Ext.FormPanel({xtype:"form",labelAlign:"top",renderTo:"formreservation",header:false,bodyStyle:"padding:0;margin:0;background:none;border:none;",width:200,hideBorders:true,buttons:[{text:"GO",handler:function(){if(a.getForm().isValid()){var f=a.getForm().getValues();var e="http://www.choicehotels.ca/rooms/CN688?checkin="+f.checkin+"&checkout="+f.checkout;if(f.code){e+="&srp="+f.code}window.open(e)}}}],items:[{xtype:"fieldset",autoHeight:true,items:[{xtype:"datefield",format:"d-m-Y",fieldLabel:label.checkin,ctCls:"TextesNoPad",id:"checkin",width:150,value:c,name:"checkin",anchor:"0%",listeners:{select:function(g,h){var e=new Date(h.getTime()+d);Ext.getCmp("checkout").setRawValue(e.getDate()+"-"+e.getMonth()+"-"+e.getFullYear())}}},{xtype:"datefield",fieldLabel:label.checkout,value:new Date(c.getTime()+d),format:"d-m-Y",width:150,id:"checkout",name:"checkout"},b]}]})});