// private functions
function debug(o) {
	if(window.console && window.console.log) {
		window.console.log(o);
	}
}

if(typeof jQuery != 'undefined') {
	jQuery.noConflict();
	(function($) {

		// app functions
		var App = {

			/**
			* Options
			* @desc General App related options
			*/
			options: {
				className: {
					paused:		'paused',
					active:		'on',
					hover:		'hover'
				},
				cycle: {
					fx:				'fade',
					startingSlide:	0,
					timeout:		0,
					speed:			1000,
					pagerAnchorBuilder: function (idx, slide) {
						return '<li><a href="#">' + (idx + 1) + '</a></li>';
					}
				},
				kwicks: {
					isVertical:		false,
					sticky:			false,
					event:			'mouseover',
					defaultKwick:	0,
					duration:		500,
					spacing:		5
				}
			},

			/**
			* cycle
			* @desc
			* @uses cycle()
			*/
			cycle: function () {
				if ($.fn.cycle) {
					$('#mContentR div.miniBox.rotate ul').cycle($.extend({}, App.options.cycle, {
						timeout: 3500
					}));
					$('#flashBnr ul ul').cycle($.extend({}, App.options.cycle, {
						timeout: 5000,
						duration: 1500
					}));
				}

				return this;
			},

			kwicks: function () {
				if ($.fn.kwicks) {
					$('#flashBnr > ul').kwicks($.extend({}, App.options.kwicks, {
						min:		100,
						duration:	300,
						easing:		'swing'
					}));
				}

				return this;
			}
		};

		/**
		* READY!
		* @desc Document ready, load all the app functions
		*/
		jQuery(document).ready(function($) {
			var $body = $('body').addClass('has-jquery');

			App.cycle().kwicks();
		});

		
	// end of jQuery closure
	}(jQuery));
}

