function show(id){

document.getElementById(id).style.display="block"; 
 

}
function unshow(id){

document.getElementById(id).style.display="none"; 

}
function add_cat_form(){

category = document.getElementById("add_cat").category.value;
child_of = document.getElementById("add_cat").child_of.value;

category = category.replace('&','e');

document.getElementById("add_cat").category.value = '';

eseguiRichiesta('admin/add_cat.php?','result_add_cat','category='+category+'&child_of='+child_of+'');

eseguiRichiesta('admin/del_cat.php?','result_del_cat','act=refresh');
eseguiRichiesta('admin/move_announce.php?','result_move_products','act=refresh');

}
function del_cat_form(){



id_cat = document.getElementById("del_cat").id_cat.value;

if(id_cat == ""){
alert("Cosa vorresti eliminare?")
return 
}

if(confirm('Sei sicuro di voler eliminare questa categoria ?') == "1"){



eseguiRichiesta('admin/del_cat.php?','result_del_cat','id_cat='+id_cat+'');

eseguiRichiesta('admin/move_announce.php?','result_move_products','act=refresh');

}

}
function del_products_form(){


id_products = document.getElementById("del_products").id_products.value;

if(id_products == ""){
alert("Cosa vorresti eliminare?")
return 
}

if(confirm('Sei sicuro di voler eliminare questo annuncio ?') == "1"){


eseguiRichiesta('admin/approve_announce.php?','result_del_products','id='+id_products+'&act=no&refresh=ok');

eseguiRichiesta('admin/move_announce.php?','result_move_products','act=refresh');
}


}
function move_products_form(){



id_products = document.getElementById("move_products").id_products.value;
id_cat = document.getElementById("move_products").id_cat.value;

if(id_products == ""){
alert("Cosa vorresti spostare?")
return 
}

eseguiRichiesta('admin/move_announce.php?','result_move_products','id='+id_products+'&id_cat='+id_cat);


}
function send_email(to,soggetto,id){

messaggio = document.getElementById("mail_"+to).msg_mail.value;


eseguiRichiesta('includes/send_email.php?','popup_content_'+id+'','to='+to+'&msg='+messaggio+'&subject='+soggetto+'');


}

