// JavaScript Document

function callAjax(path, datastring){
	$.ajax({
	   type: "POST",
	   url: path,
	   data: datastring,
	   success: function(msg){
		 getMsg(msg);
	   }
	});
}

function getMsg(msg){
	var myjson = msg;
	var obj = eval(myjson);
	var test = parseInt(obj.code);
	switch(test) {
		case 100:			
			insertList(obj);
		break;
		default:
			setError(obj);
			alert("Error 101");
	}
}
function setError(obj){	
	//$("#"+error_alert).fadeIn(10);
	//$("#error_alert div.msg_alert").empty();//svuoto il messaggio corrente
	//setObjVisible(error_alert);
	//$("#error_alert div.msg_alert").append(obj.msg);
	if(obj.msg){
		prepareDisplayErrors(obj);
		//alert("set error "+obj.msg);
	}
	//window.setTimeout("superTimer.resetError()", 10000);
}
function supertimer(){
	this.resetComment = function(){
		callVoices();
	}
	this.startComment = function(){
		if(comment_bl==false){
			showComment("#commento_box");
			displayComment();
		}
	}
}
function openPanel(el){
	$(el).show('slow');
}
