
jQuery(document).ready(function($){

    $('#sidecart').css('display', 'none');
    if (show_sidecart) {
        $('#sidecart').load('/sidecart', function(response, status, xhr){
            //alert('Load was performed.' + response + " " + status + " " + xhr);
            $('#sidecart').show(350);
        });
    }
});


// :TODO: convert this to jQuery
// Fixup iphone phone number links, which want "tel:" instead of "callto:"
window.onload = function () {
  if (navigator.userAgent.match (/iPhone/i)) {
    var a = document.getElementsByTagName ("a");
    for (var i = 0; i < a.length; i++) {
      if (a[i].getAttribute ('href').search (/callto:/i) === 0) {
        a[i].setAttribute ('href', a[i].getAttribute ('href').replace (/^callto:/, "tel:"));
      }
    }
  }
};
