/* ---------------------------------- */

/* TFAL Core */

/*
 * AUTHOR
 * Ian Coyle
 * @link http://www.iancoyle.com
 * 
 * 
 *
 */

jQuery(
  
  function ($) {
  
    
    /* ---------------------------------- */
        
    /* INSTANTIATE BASE */
        
    new org.thinkingforaliving.Index();
    
    
    /* ---------------------------------- */
        
    /* IPHONE/ANDROID DETECTION */
    
    var __iPhoneAdroid = ((navigator.userAgent.match(/Android/i)) || (navigator.userAgent.match(/iPhone/i)) || (navigator.userAgent.match(/iPod/i)));

    if (__iPhoneAdroid) 
      new org.thinkingforaliving.iPhone();
      
      
    /* ---------------------------------- */
        
    /* IPAD */
    
    var __iPad = (navigator.userAgent.match(/iPad/i));

    if (__iPad) 
      new org.thinkingforaliving.iPad();
      
      
      
  } 
  
);


var org = 
{
  
  thinkingforaliving: {
  
    iPad: function() {
    
      setTimeout(scrollTo,0,0,1);
      
      $.TFALPost.tablet = true;
      
      $(window).OrientEnable();
      
      $(document).TouchEnable();
      
    
    }
    
    ,
    
    iPhone: function() {
        
        setTimeout(scrollTo,0,0,1);
        
        $.TFALPost.mobile = true;
        
        $(window).OrientEnable();
        
        $(document).TouchEnable();
        
        $('ul[scope=Nav]').iPhoneNav();
        
    }
    
    ,
  
    Index: function() {
        
        /* ---------------------------------- */
        
        /* ENABLE KEYBOARDS */

        $(document).TFALKeyboard();
        
        /* ---------------------------------- */
        
        /* NAV */
        
        $('ul[scope=Nav]').TFALNav();
        
        
        /* ---------------------------------- */
        
        /* POSTS */
        
        $('div[scope=PostContent]').TFALPostContent();
        
        $('div[scope=Post]').TFALPost({
           WRAPPER:$('#wrapper'),
           CONTENT:$('#content'),
           COLUMN_WIDTH:320,
           SPEED:800,
           EASE:'easeOutQuart'
        });
          

          
        $('div[scope=PhotoGallery]').TFALPhotoGallery();
        
        $('div#digest-delicious').TFALDelicious();
          
        
        /* ---------------------------------- */
        
        /* FILTERS */    
        
        $('div[scope=Filters]').TFALFilters({EVENT:'FILTER'});
        
        
        /* ---------------------------------- */
        
        /* COVERS */    

        $('div[scope=Covers]').TFALCovers();
                
        $('.cover-quote').TFALCoverQuote();
        
        
        /* ---------------------------------- */
        
        /* LINKS */
        
        $("a[rel^='prettyPhoto']").prettyPhoto({theme:'dark_square'});
        
        $("a._blank").TFALBlankLink();
        
        $("div[scope=SiteOverview]").TFALSiteOverview();
       
        
    } //Index
    
    

  } //thinkingforaliving

} //org
