	$(document).ready( function(){

		$('#edit-fileInput').uploadify({
			'uploader'  : '/scripts/uploadify.swf',
			'script'    : '/scripts/uploadify.php',
			'cancelImg' : '/images/s_exit_m.png',
			'auto'      : false,
			'multi'		: true,
			'queueSizeLimit' : 10,
			'folder'    : 'uploads',
			'queueID'	: 'fileQueue',
			onComplete : function(event, queueID, fileObj, response, data) {

				oldValue = document.getElementById('photoTargets').value;
				document.getElementById('photoTargets').value = oldValue+','+response; 
				
				return false;
			},
			onAllComplete : function(event, data) {
				
				$('#admin').submit();
				
			},
			onSelectOnce : function(event,data) {
				$('#no-images').hide();
				$('#got-images').show();
			},
			onError : function(event, queueID, fileObj, errorObj) {
				alert('test');
			}		
			
		});	
	
		$('#fileInput').uploadify({
			'uploader'  : '/scripts/uploadify.swf',
			'script'    : '/scripts/uploadify.php',
			'cancelImg' : '/images/s_exit_m.png',
			'auto'      : false,
			'multi'		: true,
			'queueSizeLimit' : 10,
			'folder'    : 'uploads',
			'queueID'	: 'fileQueue',
			onComplete : function(event, queueID, fileObj, response, data) {

				oldValue = document.getElementById('photoTargets').value;
				document.getElementById('photoTargets').value = oldValue+','+response; 
				
				return false;
			},
			onAllComplete : function(event, data) {
				
				$('#admin').submit();
				
			},
			onError : function(event, queueID, fileObj, errorObj) {
				alert('test');
			}		
			
		});	
		
		$('textarea.tinymce').tinymce({
			// Location of TinyMCE script
			script_url : '/js/tiny_mce/tiny_mce.js',

			// General options
			theme : "advanced",
			plugins : "safari,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",

			// Theme options
			theme_advanced_buttons1 : "bold,italic,underline,strikethrough,|,image,|,link,|,justifyleft,justifycenter,justifyright,justifyfull,|,bullist,numlist,|,outdent,indent, code",
			theme_advanced_buttons2 : "",
			theme_advanced_buttons4 : "",
			theme_advanced_toolbar_location : "top",
			theme_advanced_toolbar_align : "center",
			theme_advanced_statusbar_location : "",
			theme_advanced_resizing : false,
			
			forced_root_block: '',
			force_br_newlines: true,
			force_p_newlines: false,
			dialog_type: 'window',
			cleanup_on_startup: true,
			relative_urls: false,
			verify_css_classes: false,
			verify_html: true,
			media_strict : false,
			paste_auto_cleanup_on_paste: true,
			paste_convert_middot_lists: false,
			entity_encoding: 'raw',
			invalid_elements: 'font',


			// Example content CSS (should be your site CSS)
			content_css : "css/content.css",

			// Drop lists for link/image/media/template dialogs
			template_external_list_url : "lists/template_list.js",
			external_link_list_url : "lists/link_list.js",
			external_image_list_url : "lists/image_list.js",
			media_external_list_url : "lists/media_list.js",

			// Replace values for the template plugin
			template_replace_values : {
				username : "Some User",
				staffid : "991234"
			}
		});
		
	

		
	});	
