jQuery(document).ready(function(){
	/* example 1 */
	var button = jQuery('#button1'), interval;
	jQuery.ajax_upload(button,{
		action: './wp-content/plugins/file_upload/file_upload.php',
		name: 'images',
		onSubmit : function(file, ext){
			// change button text, when user selects file			
			button.text('Įkelkit nuotrauką');
			
			// If you want to allow uploading only 1 file at time,
			// you can disable upload button
			this.disable();
			
			// Uploding -> Uploading. -> Uploading...
			interval = window.setInterval(function(){
				var text = button.text();
				if (button.text().length < 13){
					button.text(button.text() + '.');					
				} else {
					button.text('Įkeliama');				
				}
			}, 200);
		},
		onComplete: function(file, response){
			button.text('Įkelta. Įkelkit dar vieną');
			
			// Although plugins emulates hover effect automatically,
			// it doens't work when button is disabled
			button.removeClass('hover');
			
			window.clearInterval(interval);
						
			// enable upload button
			this.enable();
			
			// add file to the list
			jQuery('<em></em><br />').appendTo('#example1 .files').text(file);						
		}
	});
	jQuery("#photo_what").click(function () {
      jQuery("#photo_about").slideToggle("slow");
    });
		
});