/* show / hide layer */
 function sh(l) { $j('#'+l).css('display')=='none' ? $j('#'+l).css('display','block') : $j('#'+l).css('display','none'); }
 
/*
* fc_json.products[i].name,fc_json.products[i].code,fc_json.products[i].options,fc_json.products[i].quantity,fc_json.products[i].price_each,fc_json.products[i].price
*/
function fc_BuildFoxyCart() 
{
  fc_FoxyCart = '';
  fc_FoxyCart += '<p>You have <strong>'+fc_json.products.length+'</strong> items in your cart</p>';
  var plan_suffix = '';
  
  jQuery('#fc_cart_links #fc_view').attr('href','https://'+FoxyDomain+'/cart?cart=view');
  jQuery('#fc_cart_links #fc_checkout').attr('href','https://'+FoxyDomain+'/cart?cart=checkout');
  
  if( fc_json.products.length > 0 )
  {
    fc_FoxyCart += '<p class="products">';
    for( var i=0; i<fc_json.products.length;i++ )
    {
      
       if( fc_json.products[i].code.indexOf('_plan') > -1 ) { plan_suffix = '/month'; } else { plan_suffix = ''; }
       fc_FoxyCart += fc_json.products[i].name + ' <br/>........ <strong>' + fc_json.products[i].quantity + 'x$' + fc_json.products[i].price.toFixed(2) + plan_suffix + '</strong><br/>';
    }
    fc_FoxyCart += '</p>';
        // show links
        jQuery('#fc_cart_links').css('display','inline');
        jQuery('#fc_cart_default_text').css('display','none');
        /*
        $j("#fc_empty").css("display","inline");
        $j("#fc_checkout").css("display","inline");
      */    
  }
  else
  {
        // hide links
        jQuery('#fc_cart_links').css('display','none');
        jQuery('#fc_cart_default_text').css('display','inline');
        /*
        $j("#fc_empty").css("display","none");
        $j("#fc_checkout").css("display","none");
      */
  }
  
      jQuery("#fc_cart").html(fc_FoxyCart);
  
} // end fc_BuildFoxyCart


