function cleartext(){
  document.getElementById("term").value = "";
}

function swap(div_id){
  switch(div_id){
    case 1:
      document.getElementById("div_1").style.background = "#679fc2";
      document.getElementById("div_2").style.background = "#e8f7fe";
      break;
    case 2:
      document.getElementById("div_1").style.background = "#e8f7fe";
      document.getElementById("div_2").style.background = "#679fc2";
      break;
  }
}

function do_options(){
  var font_size =  document.form.font_size.options[document.form.font_size.options.selectedIndex].value;
  var font_color =  document.form.font_color.options[document.form.font_color.options.selectedIndex].value;
  var bg_color =  document.form.bg_color.options[document.form.bg_color.options.selectedIndex].value;

  document.getElementById("preview").style.fontSize = font_size+"%";
  document.getElementById("preview").style.color = "#"+font_color;
  document.getElementById("preview").style.background = "#"+bg_color;
}

function do_calc(price){
  var font_size = document.getElementById("font_size").selectedIndex;
  var bg_color = document.form.bg_color.value;
  var total_price = 0;

  switch(font_size){
    case 0:
      var font_size_cost = parseInt(0);
      break;
    case 1:
      var font_size_cost = parseInt(2);
      break;
    case 2:
      var font_size_cost = parseInt(3);
      break;
    case 3:
      var font_size_cost = parseInt(4);
      break;
    case 4:
      var font_size_cost = parseInt(5);
      break;
  }
  if(bg_color == "ffffff"){
    var bg_color_cost = parseInt(0);
  }else{
    var bg_color_cost = parseInt(4);
  }  
  option_price = font_size_cost + bg_color_cost;
  total_price = option_price + price;
  document.getElementById("options").innerHTML = option_price;
  document.getElementById("total_price").innerHTML = total_price;
}