tinyMCE.init({
	mode : "specific_textareas",
	editor_selector : "editor",
	theme : "advanced",
	theme_advanced_toolbar_location : "top",
	relative_urls : false,
	width: '600px',
	height: '300px',
	plugins : "table, paste, advimage",
	theme_advanced_buttons1 : "bold,italic,underline,html,justifyleft,justifycenter,justifyright,justifyfull,bullist,numlist,outdent,indent,undo,redo,link,unlink,pastetext",
    theme_advanced_buttons2 : "tablecontrols",
    theme_advanced_resizing : true,
	theme_advanced_statusbar_location : "bottom",
	theme_advanced_buttons3 : ""
});

// jquery starts
$(function() {
		
	$(".nojs").hide();
	$("#spam").val(2);
	
	$("a.delete").click(function(){
		return confirm('Are you sure you want to permanently delete this item?');							 
	});
	
	var box = 'enquiries';
	var domain = 'rhandassociates.co.uk ';
	$("#email").html('<a href="mailto:' + box + '@' + domain + '">' + box + '@' + domain + '</a>');
	
	$(".zoom").fancybox();
	
	$("#nojs").hide();

	$("#feedback_form").submit(function(){
		   var message = $("textarea#message").val();
		   var ip = $("input#ip").val();
		   var stamp = $("input#stamp").val();
		   
		   if(message != '' ){
				//alert('ok');
				$("#feedback").fadeTo('slow', 0, function (){
					
				  	 $.post('/send/feedback/', { message: message, ip: ip, stamp: stamp }, function(data){
					 		$("#feedback").html(data).fadeTo('slow', 1);
					 });
				});
			}
		   
		   return false;
	  });
	
	
});

