function chk_txt(txtID)  {
  var txt = document.getElementById('text_' + txtID).value
  if (txt.length == 1 || document.getElementById('font_' + txtID).value == 14)  {
    document.getElementById('outline_' + txtID).disabled = false;
  } else {
    document.getElementById('outline_' + txtID).disabled = true;
  }
}

function set_bckgrnd_color()  {
  http.abort();
  http.open('POST','set_bg.html');
  http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
  http.onreadystatechange = processReq; 
  http.send('bckgrnd=' + document.getElementById('bckgrnd').value);
}

function set_gph_color(atID)  {
  http.abort();
  http.open('POST','set_gph_color.html');
  http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
  http.onreadystatechange = processReq; 
  http.send('atID=' + atID + '&color=' + document.getElementById('at' + atID).value);
}

function reset_gph_colors()  {
  http.abort();
  http.open('get','reset_gph_colors.html');
  http.onreadystatechange = processReq; 
  http.send(null);
}

function set_gph_alignment()  {
  http.abort();
  http.open('POST','set_gph_alignment.html');
  http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
  http.onreadystatechange = processReq; 
  http.send('alignment=' + document.getElementById('gph_alignment').value);
}

function set_txt(txtID)  {
  http.abort();
  http.open('POST','set_txt.html');
  http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
  http.onreadystatechange = processReq; 
  http.send('txtID=' + txtID + '&text=' + escape(document.getElementById('text_' + txtID).value) + '&shape=' + document.getElementById('shape_' + txtID).value + '&font=' + document.getElementById('font_' + txtID).value + '&size=' + document.getElementById('size_' + txtID).value + '&color=' + document.getElementById('color_' + txtID).value + '&outline=' + document.getElementById('outline_' + txtID).value);
}

function set_product()  {
  http.abort();
  http.open('POST','set_product.html');
  http.setRequestHeader('Content-Type','application/x-www-form-urlencoded'); 
  http.onreadystatechange = processReq; 
  http.send('pid=' + document.getElementById('product').value);
}
