/*
 * Vroomtrap
 * Copyright(c) 2008, Nubesoft, LLC.
 */
Ext.namespace('Ext.detailswindow');
Ext.detailswindow.detailswindow = function(){
  var detailsWin;
  return {
     openDetailsWindow: function(trapID) {
       detailsWin = new Ext.Window({
         title    : 'Details of ' + trapID,
         closable : true,
         closeAction: 'close',
         draggable: false,
         resizable: false,
         width    : 744,
         height   : 520,
         plain    : true,
         layout   : 'border',
         items    : [
         new Ext.Panel({
           region      : 'center',
           collapsible : false,
           bodyStyle   :'padding:0px 0px 0px 0px',
           id          : 'detailPanel',
           html  : '<iframe width="728" height="500" align="left" scrolling="no" frameborder="0" src="/details?tpid=x"/>',
       
           buttons: [{
             text    : 'Close',
             handler : function(){
               detailsWin.close();
             }
           }]
         }),
         new Ext.Panel({
           region      : 'south',
           closeAction: 'hide',
           split       : false,
           width       : 728,
           height      : 90,
           collapsible : false,
           margins     : '0 0 0 0',
           cmargins    : '0 0 0 0',
           bodyStyle   :'padding:0px 0px 0px 0px',
           html        : '<iframe width="728px" height="90px" align="left" scrolling="no" frameborder="0" src="/ads/adblock728.html"/>'
         })
         ]
       });
       gmtOffset = (new Date().getTimezoneOffset()/-60);
       Ext.getCmp("detailPanel").html = '<iframe width="728" height="500" align="left" scrolling="no" frameborder="0" src="/details?tpid='+trapID+'&gmto='+gmtOffset+'"/>';

       detailsWin.show();
       detailsWin.center();
     },
     init : function() {}
  }
}();

Ext.onReady(Ext.detailswindow.detailswindow.init, Ext.detailswindow.detailswindow);
