function doStuff(html){
if(document.all){
var c=document.editFrame.document;
c.focus();
c.execCommand(html,false, '');
c.focus();
}
else{
var c=document.getElementById('fred').contentWindow;
var cd=document.getElementById('fred').contentWindow.document;
c.focus();
cd.execCommand(html,false, '');
c.focus();
}

}


function creatRequestObject(){
	var ro;

	if(window.ActiveXObject){
		ro=new ActiveXObject("Microsoft.XMLHTTP");
	}
	else{
		ro=new XMLHttpRequest();
	}
	return ro;
}

var http=creatRequestObject();


function addNote(){
var url="addrecipe.php?timestamp="+new Date().getTime();
if(document.all){
var comment=document.editFrame.document.body.innerHTML;
}
else{
var comment=document.getElementById('fred').contentWindow.document.body.innerHTML;
}

queryString="comment="+comment;
http.open("POST", url, true);
http.onreadystatechange=handleAddnote;
http.setRequestHeader("Content-Type","application/x-www-form-urlencoded;");
http.send(queryString);
}

function handleAddnote(){
	if(http.readyState==4){

		var stuff=http.responseText;

		alert("Your note has been added");




	}

}

function showfluff(){
document.getElementById('fluff').style.display='inline';
document.getElementById('fred').contentWindow.document.designMode='On';
}

function closeDiv(){
document.getElementById('fluff').style.display='none';
}

