function sendRequest(postie) {
  new Ajax.Request("lib/main.php", { 
    method: 'post', 
    postBody: postie,
    onComplete: showResponse 
  });
}

function showResponse(req) {
  $('ajax').innerHTML = req.responseText;
}


/* page, sort_type, sort_by, re, flower_page, in_cart, ... */


function bDown(x) { x.src = "pix/" + x.id + "-button-down.png"; }
function bUp(x) { x.src = "pix/" + x.id + "-button-up.png"; }

function cartToggle(x) {
  if(x.alt == "out") {
    x.alt = "in";
  } else {
    x.alt = "out";
  }
  x.src = "pix/" + x.alt + "-toggle.png";
}

function getEntryPage(pagenum) {
  sendRequest("current_page="+pagenum);
}

function menuButton(x) { sendRequest("page="+x.id); }

function infoHover() { $('info').src = "pix/info-hover.png" }
function infoOff() { $('info').src = "pix/info.png" }

