//=================== COLOR ANIMATION ==========================
/* Initiate the color animator module */
PBUtil.module.colorAnimator = new colorAnimator({duration: 1200 });


//Set the initial roll-over for the navigation menus using the rollover feature from the colorAnimator
PBUtil.module.colorAnimator.setRollover({ 
	items: 'a.nav_item',
	exclude: 'a.nav_selected',
	onStyles: {'background-color': '#141414' },
	offStyles: {'background-color': 'transparent' }
 });

 

PBUtil.colorManager = {};

//Attach event to the sample button on the page for changing color
PBUtil.colorManager.executeColorChange = function(primaryColor){

	if (primaryColor != "") {
		// Calculates custom colors
		
			
			
		
			
				set4Color = PBUtil.module.colorAnimator.getColor(primaryColor, '#000000', 30);
			
			
		
			
				set6Color = PBUtil.module.colorAnimator.getColor(primaryColor, '#000000', 30);
			
			
				
				set6RolloverOnColor = PBUtil.module.colorAnimator.getColor(primaryColor, '#FFFFFF', 5);
				
				
				set6RolloverOffColor = PBUtil.module.colorAnimator.getColor(primaryColor, '#000000', 30);
								
			
		
			
				set7Color = PBUtil.module.colorAnimator.getColor(primaryColor, '#000000', 20);
			
			
				
				set7RolloverOnColor = PBUtil.module.colorAnimator.getColor(primaryColor, '#000000', 20);
				
								
			
		
		
		// Start the color changes
		PBUtil.module.colorAnimator.animate([ 
			// Render color sets
			
				{ // Background color
				items: '.backgroundColor',
				styles: { 'background-color': primaryColor }
				
				},
			
				{ // Border colors for dropdown menu and image thumbnails
				items: 'div.dropmenu .theme_2 .wrapper, #paging_thumb_container .thumbNormal',
				styles: { 'border-top-color': set4Color, 'border-bottom-color': set4Color, 'border-left-color': set4Color, 'border-right-color': set4Color }
				
				},
			
				{ // Background colors for individual drop down menu
				items: 'div.dropmenu a.dropmenu',
				styles: { 'background-color': set6Color }
				,
					//handle roll-over items
					onEffectStart: function(){
						// Roll over of the dropdown menus
						PBUtil.module.colorAnimator.setRollover({
							items: 'div.dropmenu a.dropmenu',
							
							onStyles: { 'background-color': set6RolloverOnColor },
							offStyles: { 'background-color': set6RolloverOffColor }
						});
					}						
				
				},
			
				{ // Selected menu item
				items: '.nav_selected',
				styles: { 'color': set7Color }
				,
					//handle roll-over items
					onEffectStart: function(){
						// Roll over of the main navigation menus
						PBUtil.module.colorAnimator.setRollover({
							items: 'a.nav_item',
							
							exclude: 'a.nav_selected',
							
							onStyles: { 'background-color': set7RolloverOnColor },
							offStyles: { "background-color": "transparent" }
						});
					}						
				
				}
			 
		 ]);
	}
}
