function addRecipe(form)
{     
     var url='modules.php?mod=adminrecipes&req=add'+
      '&categoryID='+form.categoryID.value+
	  '&name='+form.name.value+
	  '&image='+form.image.value+
      '&description='+form.description.value+
      '&ingredients='+form.ingredients.value+
	  '&directions='+encodeURIComponent(form.directions.value)+
	  '&notes='+form.notes.value;
//alert(url);
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=adminrecipes');
     return false;

}

function addCategory(form)
{     
     var url='modules.php?mod=adminrecipes&req=addcategory'+
	  '&name='+form.name.value;
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=adminrecipes');
     return false;

}

function deleteRecipe(form)
{
     var norecs=form.del.length;
     var url='modules.php?mod=adminrecipes&req=delete'
     for (x=0, y=0; x < norecs; x++)
          {
          if (form.del[x].checked==true)
               {
               url+='&recno'+y+'='+form.recno[x].value;
               y++;
               }
          }
     url+='&norecs='+y;
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=adminrecipes');         
     return false;
}

function deleteCategory(form)
{
     var norecs=form.del.length;
     var url='modules.php?mod=adminrecipes&req=deletecategory'
     for (x=0, y=0; x < norecs; x++)
          {
          if (form.del[x].checked==true)
               {
               url+='&recno'+y+'='+form.recno[x].value;
               y++;
               }
          }
     url+='&norecs='+y;
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=adminrecipes');         
     return false;
}

function editRecipe(recipeid)
{
     displayText('maincontent','modules.php?mod=adminrecipes&req=edit&id='+recipeid);
     return false;
}

function updateRecipe(form)
{
     var url='modules.php?mod=adminrecipes&req=update'+
	  '&id='+form.id.value+
      '&categoryID='+form.categoryID.value+
	  '&name='+form.name.value+
	  '&image='+form.image.value+
      '&description='+form.description.value+
      '&ingredients='+form.ingredients.value+
	  '&directions='+encodeURIComponent(form.directions.value)+
	  '&notes='+form.notes.value;
     ret=serverFunction(url);
     displayText('maincontent','modules.php?mod=adminrecipes');        
     return false;
}