   $()
   .ready(
   		function() {
   			
   			new Ajax_upload('#banner', {
   				action: '/ajax/uploadbanner', 
   				name: 'banner',
   				data : {
   					'key1' : "This data won't",
   					'key2' : "be send because",
   					'key3' : "we will overwrite it"
   				},
   				onSubmit : function(file , ext){
   					
   				
   					//if (ext && new RegExp('^(' + allowed.join('|') + ')$').test(ext)){
   					if (ext && /^(jpg|png|jpeg|gif|swf)$/.test(ext)){
   						/* Setting data */
   						this.setData({
   							'key': 'This string will be send with the file'
   						});
   						
   						$("#addThumb").addClass('loading');
   						$("#addThumb img").remove();
   						
   						
   					} else {
   						// extension is not allowed
   						$('#example2 .text').text('Error: only images are allowed');
   						// cancel upload
   						return false;				
   					}
   			
   				},
   				onComplete : function(file, response){
   					var myObject = eval('(' + response + ')');
   					
   					if(myObject.thumb == 'thumb_flash.jpg') {
   						alert("U heeft een flash-banner geupload");
   						$('#addThumb')
							.removeClass('loading')
							.html("<img src='/assets/img/flash.jpg'>");
   					} else {
   						$('#addThumb')
   								.removeClass('loading')
   								.html("<img src='/assets/banners/tmp/" + myObject.thumb + "' >");
   					}
   				
   				}		
   			});

   		});
   			
