/*

Developed by:

      ___           ___                 
     /__/|         /__/\        ___     
    |  |:|         \  \:\      /  /\    
    |  |:|          \  \:\    /  /:/    
  __|  |:|      _____\__\:\  /__/::\    
 /__/\_|:|____ /__/::::::::\ \__\/\:\__ 
 \  \:\/:::::/ \  \:\~~\~~\/    \  \:\/\
  \  \::/~~~~   \  \:\  ~~~      \__\::/
   \  \:\        \  \:\          /__/:/ 
    \  \:\        \  \:\         \__\/  
     \__\/         \__\/               

*/

/*******************************
  Debug & Console
*******************************/
// Allow for console.log to not break IE
if (typeof console == "undefined" || typeof console.log == "undefined") {
	var console = { 
		log: function() {}
	};
}
/*******************************
  Configuration Settings
*******************************/

// Declare Global Namespace
if(typeof(chester) == 'undefined') {
	var chester = {};	
}


/* Account Configuration */
chester.settings = {
	// min flash version
	minimumFlashVersion: '8.0.0',
	
	// language
	language: 'en-us',
	
	// chromeframe required
	chromeFrameRequired: true,
	
	// Width of one column
	columnWidth: 250,
	
	// Crossfade duration for panels
	crossfadeDuration: 300,
	
	// number of dust templates
	dustQuantity: 4,
	
	// dust template used for small flickr photo only
	dustSmall: 5,
	
	// Dimmer opacity
	dimmerOpacity: 0.83,
	
	// Settings for dropdown
	dropdownSettings: {
		// yOffset of toolbar
		shadowOffset: -5,
		// Opacity of dimming
		opacity: 0.5
	},
	
	// error message text
	errors: {
		technical: {
			generic: "Internet malfunction. Looks like you have to try again.",
			service: "It looks like our site submissions are closed. <br/> <br/> Check back later."
		},
		form: {
			category: "Make sure to choose a category for your submission",
			pageLink: "Make sure to enter a page link for your submission"
		}
	},	
	
	// configuration object for fancybox modal
	fancyConfig: { 
		zoomSpeedIn: 0, 
		zoomSpeedOut: 0, 
		overlayColor: '#000000',
		overlayOpacity: 0.83,
		callbackOnShow: function() {
			chester.bindPhotoShare();
		}
	},
	
	// configuration for card flip
	flip: {
		// conversion multiple for card's aspect ratio in card flip
		ratio: 4.15,
		// duration of flip
		duration: 400,
		// easing
		easing: {
			scale: 'easeInOutQuad',
			rotate: 'easeInOutQuad',
			fadeIn: 'easeInQuad'
		}
	},
	
	lazyLoad: {
		threshold: 200, 
		effect: 'fadeIn',
		loadDelay: 40,
		placeholder: 'media/images/__utm.gif'
	},
	
	// configuration for post like/unlike
	like: {
		// url for service
		service: {
			addLike: 'api/rest/?method=current.likeItem&id=$id&format=json',
			addUnlike: 'api/rest/?method=current.unlikeItem&id=$id&format=json'
		},
		// phrasing of verbose like output ('$num' = #)
		verbose: '$num People Like This!',
		// phrasing for call-to-action
		text: {
			like: 'I Like This!',
			unlike: 'Unlike This'
		}
	},
	
	// total post count
	post: {
		// duration of fadeout
		fadeDuration: 200	
	},
	
	// service to track item popularity
	postCount: {
		service: 'api/rest/?method=current.clickItem&id=$id'	
	},
	
	// files to precache on load
	precacheable: ['media/images/form-dropdown-choice-bg.png', 'media/images/submit-chester.png', 'media/images/submit-bg.png', 'media/images/loader.gif'],
	
	// Resize timer delay in ms
	resizeDelay: 30,
	
	// extra padding around content for use in calculating number of columns
	resizePadding: 20,
	
	// head tag code for adding safari-only stylesheet
	safariStyleSheet: '<link rel="stylesheet" type="text/css" charset="utf-8" href="style/safari.css" />',
	
	// static chesterspick image to replace swf after animation finishes
	staticBadge: ['media/images/chesters-picks-badge.png'],
	
	// chestersfeed submission service
	submit: {
		service: 'api/rest/?method=incoming.saveSubmission&cat=$cat&link=$link&format=json'
	},
	
	// tooltip text
	tooltip: {
		link: {
			text: "Copy this link to your clipboard to share this video with your friends",
			copied: "<b>Copied to your clipboard</b>"
		},
		embed: {
			text: "Copy this code to embed this video on your website or blog!",
			copied: "<b>Copied to your clipboard</b>"
		}
	}
	
};
jQuery.extend(chester, chester.settings);

// after attached to chester, unset temporary settings object 
delete chester.settings;
