/**
* jquery.slottyContent - based on jquery.readmore
* http://rockycode.com/blog/upload/jtsnake/demo-readmore.html
*/
(function ($) {


	// -------------------------------------------------------------------
	// Define slottyContent
	// -------------------------------------------------------------------
	$.fn.slottyContent = function ( settings ) {

		// -------------------------------------------------------------------
		// Add custom options to global jQuery options
		// -------------------------------------------------------------------
		var opts = $.extend({}, $.fn.slottyContent.defaults, settings);


		// -------------------------------------------------------------------
		// Process the chain
		// -------------------------------------------------------------------
		this.each(function () {

			// Work it
			if ( opts.action == 'contentMain' ) {
				contentMain( $(this) );
			}



		});
		//eoThis.each()



		// -------------------------------------------------------------------
		// Helper functions used inside this.each
		// -------------------------------------------------------------------
		function contentMain( elem ) {


			// -------------------------------------------------------------------
			// Hide Content
			// -------------------------------------------------------------------
			$('#contentContainer').hide();	// Content ausblenden damit manipulationen vorgenommen werden koennen


			// -------------------------------------------------------------------
			// Set CONTENT BG IMAGE
			// -------------------------------------------------------------------
			// Set url for bgImage
			var url = opts.baseUrlContentBackgroundImage + opts.filenameContentBackgroundImage;
			//alert( 'url'+"\n"+url);

			$('#contentContainer').css('background-image', 'url("'+ url +'")');  // ContentBG: background-image url setzen


			// -------------------------------------------------------------------
			// Set CONTENT TEXT
			// -------------------------------------------------------------------
			//$('#sidebarContent').text('Text aus DIV '+ opts.filenameContentTextDivId +' hier einsetzen.');

			// Get content from the DIV
			var divContent = $( opts.filenameContentTextDivId ).html();

			// Set content in the sidebar
			$('#sidebarContent').html( divContent );



			// -------------------------------------------------------------------
			// Neuen Content anzeigen und Sidebar ggf. rausfahren
			// -------------------------------------------------------------------
			$('#contentContainer').fadeIn(1500);


		}//eoFunction contentMain()



		// -------------------------------------------------------------------
		// Wieso kommt der globale return fuer die chain erst hier?
		// -------------------------------------------------------------------
		return this;

	};
	//eo Declaration of $.fn.slottyContent




	// -------------------------------------------------------------------
	// Set default options
	// -------------------------------------------------------------------
	// Hint
	//   Has to be placed after method definition!
	// -------------------------------------------------------------------
	$.fn.slottyContent.defaults = {

		// action
		action: 'none',
		delay : 1000,

		// Dragged element css id - Set to "navMain" aka "box1" initially
		dragBoxName                    : 'box1',

		// Active Menu item no. - Set to "news" initially
		activeMenuItemId               :  3,

		// filename des bgImages
		filenameContentBackgroundImage : 'bg_404.jpg',

		// base url for bgImages
		baseUrlContentBackgroundImage  : 'fileadmin/mnt/pub/allgemein/content/',

		filenameContentTextDivId       : '#content404'

	};
	//eo Declaration of $.fn.slottyContent.defaults


})(jQuery);

