jQuery(document).ready(
		function(){
			var obj;
			$(".gallery a[rel^='prettyPhoto']").prettyPhoto({theme:'facebook'});
			$('.app span.collapsing').toggle(
					function(){
						var obj = $(this).parents('div.app');
						$(obj).find('.appWrapper').animate({'height':'0px'},1000,function(){});
					},
					function(){
						var obj = $(this).parents('div.app');
						$(obj).find('.appWrapper').animate({'height':'100px'},1000,function(){$(this).css({'height':'auto'});});
					}
			);
			
			$('#imagesInserter img').live("click", function() {
				var text = $('#paragraph').text(); 
                $('#paragraph').text('<img align="left" width="200px" src="' + $(this).attr('src') + '" />' + text);
            });
			$.ajax({
				   url: 'modules/uploader/getFilesAlias.php',
				   success: function(data) {
					 $("#imagesInserter ul.gallery").empty();
					 $("#imagesInserter ul.gallery").append(data);
				   }
				 });

		   $('#imagesInserter .refresh').click(
					function(){
						$.ajax({
							   url: 'modules/uploader/getFilesAlias.php',
							   success: function(data) {
									$('#imagesInserter ul.gallery').empty();
									$('#imagesInserter ul.gallery').append(data);
							   }
							 });
				}
			);
		   
		   $('#livePreview .refresh').click(
				   function(){
					   $('#livePreview .appContent').html($('#paragraph').text());
				   }
		   );
		   
			if($("#number_slideshow").size()!=0){
				$("#number_slideshow").number_slideshow({
	                slideshow_autoplay: 'enable',//enable disable
	                slideshow_time_interval: '15000',
	                slideshow_window_background_color: "#ccc",
	                slideshow_window_padding: '1',
	                slideshow_window_width: '670',
	                slideshow_window_height: '220',
	                slideshow_border_size: '0',
	                slideshow_border_color: 'black',
	                slideshow_show_button: 'enable',//enable disable
	                slideshow_button_text_color: '#CCC',
	                slideshow_button_background_color: '#333',
	                slideshow_button_current_background_color: '#666',
	                slideshow_button_border_color: '#000',
	                slideshow_button_border_size: '1'
				});
			}
		}
);


