	// ============
	// = TINY_MCE =
	// ============
// if(!navigator.userAgent.match(/iPhone/i)){

	tinyMCE.init({
		mode : "textareas",
		theme : "advanced",
	
		// Theme options
//		theme_advanced_buttons1 : "formatselect,|,bold,italic,underline,|,bullist,numlist,|,wired-link,wired-image,|,youtube,vimeo,mp3player",
		theme_advanced_buttons1 : "bold,italic,|,bullist,numlist,|,wired-link,|,pastetext,pasteword,removeformat,code",
		theme_advanced_buttons2 : "",
		theme_advanced_buttons3 : "",
		theme_advanced_toolbar_location : "top",
		theme_advanced_toolbar_align : "left",
		theme_advanced_blockformats : "p,h2,h3,blockquote",
		paste_auto_cleanup_on_paste : true,
		editor_selector : "mceEditor",
		editor_deselector : "mceNoEditor",
		content_css : "/stylesheets/tinymce.css",
		height : "180",
		extended_valid_elements : "object[class|type|data],param[name|value]",
		plugins : 'inlinepopups,safari,paste',
		paste_auto_cleanup_on_paste : true,
		paste_strip_class_attributes : 'all',
		paste_remove_spans : true,
		paste_preprocess : function(pl, o) {
		            // Content string containing the HTML from the clipboard
		            alert(o.content);
		        },
		paste_postprocess : function(pl, o) {
            // Content DOM node containing the DOM structure of the clipboard
            alert(o.node.innerHTML);
        },
		setup : function(ed) {
			// MP3 Button
			ed.addButton('mp3player', {
				title : 'MP3Player',
				image : '/javascripts/tinymce/pit/images/mp3player.gif',
				onclick : function() {
					var url = prompt("Wat is de URL van het MP3 bestand?\n\nvoorbeeld:\n\thttp://www.mijndomein.nl/media/audio/audiofile.mp3","");
					if(url!=="" && url!=="http://" && url!= null){
						var urlString = '<object type="application/x-shockwave-flash" data="/media/flash/mp3-player.swf" class="mp3player"><param name="movie" value="player.swf" /><param name="wmode" value="transparent" /><param name="FlashVars" value="soundFile='+ url +'" /></object>';
						ed.selection.setContent(urlString);
					}
				}
			});
			// YouTube Button
			ed.addButton('youtube', {
				title : 'YouTube',
				image : '/javascripts/tinymce/pit/images/youtube.gif',
				onclick : function() {
					var url = prompt("Wat is de URL van het YouTube filmpje?\nDeze URL is te vinden op de YouTube pagina, rechterkant, onder de info, boven de embed.\n\nvoorbeeld:\n\thttp://www.youtube.com/watch?v=zrpOid7F-pA","http://www.youtube.com/watch?v=");
					if(url!=="" && url!=="http://" && url!= null){
						var RegularExpression  = /http:\/\/www\.youtube\.com\/watch\?v=([a-zA-Z0-9_\.\-\+\s])/;
						var Output = url.replace(RegularExpression,'$1');
						var urlString = '<object class="youtube" type="application/x-shockwave-flash" data="http://www.youtube.com/v/'+Output+'&hl=en&fs=1&ap=%2526fmt%3D18"><param name="movie" value="http://www.youtube.com/v/'+Output+'&hl=en&fs=1&ap=%2526fmt%3D18" /><param name="wmode" value="transparent" /><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /></object>';
						ed.selection.setContent(urlString);
					}
				}
			});
			// Vimeo Button
			ed.addButton('vimeo', {
				title : 'Vimeo',
				image : '/javascripts/tinymce/pit/images/vimeo.gif',
				onclick : function() {
					var url = prompt("Wat is het nummer van het Vimeo filmpje?\nDit is te vinden op de Vimeo pagina.\n\nvoorbeeld:\n\thttp://www.vimeo.com/728664\n\tDan is het nummer 728664.","");
					if(url!=="" && url!=="http://" && url!= null){
						var RegularExpression  = /http:\/\/www\.vimeo\.com\/([a-zA-Z0-9_\.\-\+\s])/;
						var Output = url.replace(RegularExpression,'$1');
						var urlString = '<object class="vimeo" type="application/x-shockwave-flash" data="http://vimeo.com/moogaloop.swf?clip_id='+Output+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1"><param name="movie" value="http://vimeo.com/moogaloop.swf?clip_id='+Output+'&amp;server=vimeo.com&amp;show_title=1&amp;show_byline=1&amp;show_portrait=0&amp;color=00ADEF&amp;fullscreen=1" /><param name="wmode" value="transparent" /><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /></object>';
						ed.selection.setContent(urlString);
					}
				}
			});
			// Link Button
			ed.addButton('wired-link', {
				title : 'WiredLink',
				image : '/javascripts/tinymce/pit/images/link.gif',
				onclick : function() {
					var url = prompt("Wat is de URL van de link?\n\nvoorbeeld:\n\thttp://www.domein.nl/","http://");
					if(url!=="" && url!=="http://" && url!= null){
						if(ed.selection.getContent()!==""){
							var woord = ed.selection.getContent();
						}else{
							var woord = prompt("Welke woorden wil je gebruiken om de link aan te geven?", url);
						}
						var urlString = '<a href="' + url + '">' + woord + '</a>';
						ed.selection.setContent(urlString);
					}
				}
			});
			// Image Button
			ed.addButton('wired-image', {
				title : 'WiredImage',
				image : '/javascripts/tinymce/pit/images/image.gif',
				onclick : function() {
					var url = prompt("Wat is de URL van de afbeelding?\n\nvoorbeeld:\n\thttp://www.domein.nl/image.jpg","http://");
					if(url!=="" && url!=="http://" && url!= null){
						var urlString = '<img src="' + url + '" alt="" />';
						ed.selection.setContent(urlString);
					}
				}
			});
			
			// End of setup
		}
	});
//}
	// ===================
	// = END OF TINY_MCE =
	// ===================

