$(function(){  
  var iphone = xfade('#sl2');  
  var iphonePaused = $('#iphone');
  var close_btn = $('.pp_close');  
  var lightbox = $("a[rel^='prettyPhoto']");
  var body = $('body');
  var iphone_image = $('.device a');
  var play_btn = $('.play_button');
  var gal_image = $('.image_container a');
  
  $(window).load(function() {
      setInterval(function(){  
        if(!iphonePaused.hasClass('paused')) {
          iphone.next();
        }
      }, 5000);
  });
  
  $('#sl2 a').click(function(){
    // the conterpart to his is inside of "nicks code" in prettyPhoto.js
    iphonePaused.addClass('paused');
  });
  
  lightbox.prettyPhoto();
  
  return false; 
});


