
// Automatically calls all functions in SITE.init
jQuery(document).ready(function() {
	SITE.global();
});

// Module pattern:
// http://yuiblog.com/blog/2007/06/12/module-pattern
var SITE = (function($) {
	return {
		// Start It
		global: function() {
			for (var i in SITE.init) {
				SITE.init[i]();
			}
		},



		init: {
		
		
			


			home_sliders: function()
			{
			

				$('#carousel ul').bgcar();


			
			
/*
 				$('#boxes').movingBoxes({
 					startPanel   : 2,
 					width        : 1800,	
 					panelWidth   : .445,
					reducedSize  : 0.62, 					
 					wrap         : true,
					buildNav     : false
 				}); 
*/
			},
			
			
			
			
			
			
		
		
		
			placeholder: function()
			{
				var placeholder = $('#enews').attr('placeholder');
				$('#enews').val(placeholder);
				
				$('#enews').focus(function(){
					$('#enews').val('');
				})
			},





			search: function() 
			{
				$('#search_box').hover(function(){
					
    				$(this).stop().animate({ backgroundColor: "#5a5a5a" }, "fast");
					$('.search_results').animate({ backgroundColor: "#5a5a5a" }, "fast");
				}, function(){
				
					$(this).stop().animate({ backgroundColor: "#777777" }, "fast");
					$('.search_results').animate({ backgroundColor: "#777777" }, "fast");
				
				});
			
			},




			
			home_scroll: function()
			{
				if ($('#coda-slider-5').length > 0)
				{
					$('#coda-slider-5').codaSlider({
						autoSlide: true,
						autoSlideInterval: 5000,
						autoSlideStopWhenClicked: true,
           				dynamicArrows: false,
           				dynamicTabs: false					
					});
				}
			
			},
			
			
			
			lightbox: function()
			{		
				$("ul.gallery a").fancybox({
				    'transitionIn'	:	'elastic',
				    'transitionOut'	:	'elastic',
				    'speedIn'		:	600, 
				    'speedOut'		:	200, 
				    'overlayShow'	:	true
				});               
			},
			
			
			
			
			
		},
		
		
		select_all: function() 
		{
			// Check all the checkboxes
			$('#vendors .radio').attr('checked','checked');
		},
		
		
		subscribe: function()
		{
				var email = $('#enews').val();
				
				$.post(
					"/ajax/subscribe", 
					{ email: email },
					
				   	function(data){
				   	  $('div.newsletter').fadeOut('Slow', function(){
				   	  		$('#news-response').html('<p>Thanks For Subscribing</p>');
				   	  		$('#news-response').fadeIn('Slow');
				   	  });
				   	}
				);		
   		}
		
		
		
		
		
		
	};
// Pass in jQuery ref.
})(jQuery, this);






