//jQuery.noConflict();

  jQuery(function(){   
     $('#sort').imagesLoaded(function(){
     $('#sort').masonry({
        itemSelector: '.box',
        columnWidth: 10
      });
    });
    
    $('#sort').infinitescroll({    
      navSelector  : '#nav-above',    // selector for the paged navigation 
      nextSelector : '#nav-above a',  // selector for the NEXT link (to page 2)
      itemSelector : '.box',     // selector for all items you'll retrieve
      loading: {
          finishedMsg: 'No more pages to load.',
          img: 'http://i.imgur.com/6RMhx.gif'
        }
      },
      // trigger Masonry as a callback
      function( newElements ) {
                jQuery(".the_content a").colorbox({scalePhotos:'true', maxWidth:'95%', maxHeight:'95%', rel:'nofollow'});
				jQuery(".Dribbble_icon").colorbox({width:"50%", inline:true, title:false, href:"#inline_dribbble"});
				jQuery(".Apple_icon").colorbox({width:"50%", inline:true, title:false, href:"#inline_apple"});
				$(".the_content p a img").css("background","url('http://ideaprison.com/wp-content/themes/masonry/images/loader.gif')");
      jQuery('.posttitleDIV').find('.posttitleText').show();
      jQuery('.posttitleDIV').find('.postDate').hide();
        // hide new items while they are loading
        var $newElems = $( newElements ).css({ opacity: 0 });
        // ensure that images load before adding to masonry layout
        $newElems.imagesLoaded(function(){
          // show elems now they're ready
          $newElems.animate({ opacity: 1 });
          $('#sort').masonry( 'appended', $newElems, true ); 
        });
      }
    );
  });



jQuery(document).ready(function(){
		jQuery(".the_content a").colorbox({scalePhotos:'true', maxWidth:'95%', maxHeight:'95%', rel:'nofollow'});
		jQuery(".Dribbble_icon").colorbox({width:"50%", inline:true, title:false, href:"#inline_dribbble"});
		jQuery(".Apple_icon").colorbox({width:"50%", inline:true, title:false, href:"#inline_apple"});   
    jQuery('.postDate').hide();
    
    jQuery('.thumbnail_zoom').live('click', function() {
    
      jQuery(this).parent().parent().find('.the_content').find('a:first').click();
      return false;
    });
      
    jQuery('.overlay').live('click', function() {
    
      jQuery(this).find('.the_content').find('a:first').click();
      alert('!!');
      
      return false;
    });    
    jQuery('.the_content').live('mouseover', function() {
    var title = jQuery(this).attr("id");
    if (title == 'Video') {jQuery(this).prev('.overlay').remove()} else {
     jQuery(this).prev('.overlay').height(jQuery(this).height()-32);
     jQuery(this).prev('.overlay').fadeIn();
    }
    });
    jQuery('.overlay').live('mouseout', function() {
     jQuery(this).fadeOut();
    });

    jQuery('.posttitleDIV').live('mouseover', function() {
      jQuery(this).find('.posttitleText').hide();
      jQuery(this).find('.postDate').show();
      }).live('mouseout', function() {
      jQuery(this).find('.posttitleText').show();
      jQuery(this).find('.postDate').hide();
    });
    

 $(".the_content p a img").css("background","url('http://ideaprison.com/wp-content/themes/masonry/images/loader.gif')");
 $(".the_content p a img").lazyload({
 placeholder : "",
 effect : "fadeIn"
});

});
