function setpagina01(){
            that = this
            this.innerHTML = "aguarde..."
				var oEditor = FCKeditorAPI.GetInstance('p01_body');
            $.post(
                "../setpaginas.php",
                {
                	header:$("#p01 input.text").val(),
                	body:oEditor.GetHTML(true),
                	stat:$("#p01 input[@name='status']:checked").val(),
                	tag:"p01"
                },
                function(msg){
                				 switch(msg){
                				 		case "failure":
                				 			alert("Por favor, preencha todos os campos e tente novamente");
                				 		break;
                				 		
                				 		case "ok":
                				 			alert("Dados atualizados com sucesso !")
                				 		break;
                				 		
                				 		default:
                				 			alert(msg)
                            }
                            that.innerHTML="atualizar"
                }
        );
}

function setpagina02(){
            that = this
            this.innerHTML = "aguarde..."
				var oEditor = FCKeditorAPI.GetInstance('p02_body');
            $.post(
                "../setpaginas.php",
                {
                	header:$("#p02 input.text").val(),
                	body:oEditor.GetHTML(false),
                	stat:$("#p02 input[@name='status']:checked").val(),
                	tag:"p02"
                },
                function(msg){
                				 switch(msg){
                				 		case "failure":
                				 			alert("Por favor, preencha todos os campos e tente novamente");
                				 		break;
                				 		
                				 		case "ok":
                				 			alert("Dados atualizados com sucesso !")
                				 		break;
                				 		
                				 		default:
                				 			alert(msg)
                            }
                            that.innerHTML="atualizar"
                }
        );
}

function setpagina03(){
            that = this
            this.innerHTML = "aguarde..."
            var oEditor = FCKeditorAPI.GetInstance('p03_body');
            $.post(
                "../setpaginas.php",
                {
                	header:$("#p03 input.text").val(),
                	body:oEditor.GetHTML(false),
                	stat:$("#p03 input[@name='status']:checked").val(),
                	tag:"p03"
                },
                function(msg){
                				 switch(msg){
                				 		case "failure":
                				 			alert("Por favor, preencha todos os campos e tente novamente");
                				 		break;
                				 		
                				 		case "ok":
                				 			alert("Dados atualizados com sucesso !")
                				 		break;
                				 		
                				 		default:
                				 			alert(msg)
                            }
                            that.innerHTML="atualizar"
                }
        );
}

$(document).ready(function(){
    $("#page01").bind("click",setpagina01)
    $("#page02").bind("click",setpagina02)
    $("#page03").bind("click",setpagina03)
})