function iceCapCloseBreakout(session, logoff) {
  var l = (typeof logoff == 'undefined') ? true : logoff;
  if (l) {
    Ext.Ajax.request({
      method:'POST'
      ,url:'/menu/logoff.aspx'
    })
    return;
  }

  try {
    var portfolio = iceCapGetPortfolio();
    if (portfolio != null) {
      portfolio.fireEvent('removeTab'); 
    } else if (window.parent.Ext) {
      var oExt = window.parent.Ext;                            
      var centerPanel = oExt.getCmp('center-region');          
      centerPanel.remove(centerPanel.activeTab,true);          
    } else {
      Ext.Ajax.request({
        method:'POST'
        ,url:session.href + '&close=on'
      })
    }
	} catch (err) {
    Ext.Ajax.request({
      method:'POST'
      ,url:session.href + '&close=on'
    })
    window.location = 'about:blank';
  }
}
function krakBreakout(item) {
  switch(item.id) {
    case 'krak':
      name = IceCap.inputData[0].c2.replace(/ /,"+");
      name = name.replace(/ /,"+");
      name = name.replace(/ /,"+");
      zipcode = IceCap.inputData[0].c4;
      url = 'http://krak.dk/query?what=cs&customer_type=&search_word='+name+'&geo_area='+zipcode;
      window.open(url,'_new');
      break;
  }
}

Ext.ns('IceCap.sample');

IceCap.sample.extraColumn = function(title, record) {
  alert(title + ': ' + record.data.c2); // c2 = data in the second column in the grid.
}

Ext.ns('IceCap.breakout');

IceCap.breakout.googleMap = function(title, data) {
  if (title.toLowerCase() == 'work with customers') {
    var url = 'http://www.icebreak.org/geoCoding.html?address=' 
            + 'dk,'                          
            + data.c5 + ','                          
            + data.c4;      
    var portfolio = iceCapGetPortfolio();
    if (portfolio != null) {
      portfolio.fireEvent('addTab','Google Map','',url); 
    }                                   
  }
}
IceCap.breakout.googleMap.description = 'Open new tab and show google map';

IceCap.breakout.krak = function(title, data) {  
  if (title.toLowerCase() == 'work with customers') {
    var url = 'http://www.krak.dk/'
            + data.c3.replace(' ','+')
            + '/'
            + data.c4.replace(' ','+')
            + '+'
            + data.c5
            + '/søg.cs';
    var portfolio = iceCapGetPortfolio();
    if (portfolio != null) {
      portfolio.fireEvent('addTab','Krak','',url); 
    }                                   
  }
}
IceCap.breakout.krak.description = 'Open new tab and show krak (danish site) information';

IceCap.breakout.emailSplf = function(title, data) {  
  if (title.toLowerCase() == 'work with customers') {
  }
}
IceCap.breakout.emailSplf.description = 'Send as email';