 /* in no conflict mode */
jQuery(document).ready(function () {  



/* infinitescroll */
// usage:
// $(elem).infinitescroll(options,[callback]);
 
// infinitescroll() is called on the element that surrounds 
// the items you will be loading more of
jQuery('#infiniteScrollHolder').infinitescroll({
 
    navSelector  : "div.paginationNavigation",            
                   // selector for the paged navigation (it will be hidden)
    nextSelector : "div.paginationNavigation div.alignright a",    
                   // selector for the NEXT link (to page 2)
    itemSelector : ".thumbnailHolder",       
                   // selector for all items you'll retrieve
 
  debug        : false,                        
                 // enable debug messaging ( to console.log )
 
  loadingImg   : "http://rgbdesignstudio.com/wp-content/themes/rgbTheme/i/ajax-loader.gif",          
                 // loading image.
                 // default: "http://www.infinite-scroll.com/loading.gif"
 
  loadingText  : "...more on the way...",      
                 // text accompanying loading image
                 // default: "<em>Loading the next set of posts...</em>"
 
  animate      : false,      
                 // boolean, if the page will do an animated scroll when new content loads
                 // default: false
 
  extraScrollPx: 150,      
                 // number of additonal pixels that the page will scroll 
                 // (in addition to the height of the loading div)
                 // animate must be true for this to matter
                 // default: 150
 
  donetext     : "...that is all for now..." ,
                 // text displayed when all items have been retrieved
                 // default: "<em>Congratulations, you've reached the end of the internet.</em>"
 
  bufferPx     : 50,
                 // increase this number if you want infscroll to fire quicker
                 // (a high number means a user will not see the loading message)
                 // new in 1.2
                 // default: 40
 
  errorCallback: function(){},
                 // called when a requested page 404's or when there is no more content
                 // new in 1.2                   
 
  localMode    : false
                 // enable an overflow:auto box to have the same functionality
                 // demo: http://paulirish.com/demo/infscr
                 // instead of watching the entire window scrolling the element this plugin
                 //   was called on will be watched
                 // new in 1.2
                 // default: false
 
 
    },function(arrayOfNewElems){
 
     // optional callback when new content is successfully loaded in.
 
     // keyword `this` will refer to the new DOM content that was just added.
     // as of 1.5, `this` matches the element you called the plugin on (e.g. #content)
     //                   all the new elements that were found are passed in as an array
 
 

jQuery(".thumbnailHolder").hover(
	  function () {
	   jQuery(this).addClass("hoverWorkBacking");
	  },
 	 function () {
  	  jQuery(this).removeClass("hoverWorkBacking");
	  }
);

		
	
});





/* Fade images on rollover */
	jQuery(".fadeImage").hover(function(){
	    jQuery(this).stop().animate({"opacity": .4},100);
	},function(){
	    jQuery(this).stop().animate({"opacity": 1},300);
	});


/* home page image rotation */
	jQuery('#homeRotatingImages').cycle({ 
		timeout: 4000,
		delay:-2000, 
		speed:  1000,
		random: 1,
		pause: 1,
		fastOnEvent: 1 ,
		startingSlide: 0});



jQuery(".thumbnailHolder").hover(
	  function () {
	   jQuery(this).addClass("hoverWorkBacking");
	  },
 	 function () {
  	  jQuery(this).removeClass("hoverWorkBacking");
	  }
);




/* code to clear input box of label when clicked in */
	jQuery('.default-value').each(function() {
	       var default_value = this.value;
	       jQuery(this).focus(function(){
	               if(this.value == default_value) {
	                       this.value = '';
	               }
	       });
	
	       jQuery(this).blur(function(){
	               if(this.value == '') {
	                       this.value = default_value;
	               }
	       });
	});

/* colorbox */
	jQuery('.additionalWorkBlock a').colorbox({maxWidth:"95%",maxHeight:"95%"});
	jQuery("a[rel='colorbox']").colorbox({maxWidth:"95%",maxHeight:"95%"});
	jQuery('.colorbox').colorbox({maxWidth:"95%",maxHeight:"95%"});
	jQuery('.mailChimpcolorbox').colorbox({iframe:true,innerWidth:650, innerHeight:650,title:false});

/* IMAGE SWAPS  example of usage: give img the .buttonswap class and make sure to get the on (mouse on) and off (mouse off) */
	jQuery(".buttonSwap").hover(
	function()
	 {this.src = this.src.replace("_up","_down");},
	 function()
	 {this.src = this.src.replace("_down","_up");}
	);

	
});
