Number.prototype.formatMoney = function(c, d, t)
{
  var n = this, c = isNaN(c = Math.abs(c)) ? 2 : c, d = d == undefined ? "," : d, t = t == undefined ? "." : t, s = n < 0 ? "-" : "", i = parseInt(n = Math.abs(+n || 0).toFixed(c)) + "", j = (j = i.length) > 3 ? j % 3 : 0;
  return s + (j ? i.substr(0, j) + t : "") + i.substr(j).replace(/(\d{3})(?=\d)/g, "$1" + t) + (c ? d + Math.abs(n - i).toFixed(c).slice(2) : "");
};

var colors = new Array();

colors[92] = '';

colors[93] = '';

colors[94] = '';

var prices = new Array();

prices[92] = new Array();

prices[92][92] = new Array();

prices[92][92][127] = new Array();

prices[92][92][128] = new Array();

prices[92][92][129] = new Array();

prices[92][92][130] = new Array();

prices[92][92][131] = new Array();

prices[92][92][132] = new Array();

prices[92][92][133] = new Array();

prices[92][92][134] = new Array();

prices[92][93] = new Array();

prices[92][93][127] = new Array();

prices[92][93][128] = new Array();

prices[92][93][129] = new Array();

prices[92][93][130] = new Array();

prices[92][93][131] = new Array();

prices[92][93][132] = new Array();

prices[92][93][133] = new Array();

prices[92][93][134] = new Array();

prices[92][94] = new Array();

prices[92][94][127] = new Array();

prices[92][94][128] = new Array();

prices[92][94][129] = new Array();

prices[92][94][130] = new Array();

prices[92][94][131] = new Array();

prices[92][94][132] = new Array();

prices[92][94][133] = new Array();

prices[92][94][134] = new Array();
prices[92][92][127] = {
  price: 57.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][127] = {
  price: 45.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][127] = {
  price: 42.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][128] = {
  price: 86.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][128] = {
  price: 69.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][128] = {
  price: 64.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][129] = {
  price: 109.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][129] = {
  price: 89.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][129] = {
  price: 84.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][130] = {
  price: 157.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][130] = {
  price: 134.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][130] = {
  price: 129.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][131] = {
  price: 226.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][131] = {
  price: 203.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][131] = {
  price: 184.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][132] = {
  price: 295.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][132] = {
  price: 268.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][132] = {
  price: 239.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][133] = {
  price: 364.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][133] = {
  price: 333.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][133] = {
  price: 294.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][92][134] = {
  price: 433.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][93][134] = {
  price: 402.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[92][94][134] = {
  price: 349.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};


prices[94] = new Array();

prices[94][92] = new Array();

prices[94][92][127] = new Array();

prices[94][92][128] = new Array();

prices[94][92][129] = new Array();

prices[94][92][130] = new Array();

prices[94][92][131] = new Array();

prices[94][92][132] = new Array();

prices[94][92][133] = new Array();

prices[94][92][134] = new Array();

prices[94][93] = new Array();

prices[94][93][127] = new Array();

prices[94][93][128] = new Array();

prices[94][93][129] = new Array();

prices[94][93][130] = new Array();

prices[94][93][131] = new Array();

prices[94][93][132] = new Array();

prices[94][93][133] = new Array();

prices[94][93][134] = new Array();

prices[94][94] = new Array();

prices[94][94][127] = new Array();

prices[94][94][128] = new Array();

prices[94][94][129] = new Array();

prices[94][94][130] = new Array();

prices[94][94][131] = new Array();

prices[94][94][132] = new Array();

prices[94][94][133] = new Array();

prices[94][94][134] = new Array();
prices[94][92][127] = {
  price: 109.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][127] = {
  price: 105.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][127] = {
  price: 98.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][128] = {
  price: 154.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][128] = {
  price: 145.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][128] = {
  price: 136.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][129] = {
  price: 229.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][129] = {
  price: 215.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][129] = {
  price: 197.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][130] = {
  price: 445.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][130] = {
  price: 419.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][130] = {
  price: 328.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][131] = {
  price: 549.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][131] = {
  price: 517.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][131] = {
  price: 420.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][132] = {
  price: 653.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][132] = {
  price: 615.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][132] = {
  price: 512.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][133] = {
  price: 758.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][133] = {
  price: 713.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][133] = {
  price: 604.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][92][134] = {
  price: 862.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][93][134] = {
  price: 811.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[94][94][134] = {
  price: 696.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};


prices[96] = new Array();

prices[96][92] = new Array();

prices[96][92][127] = new Array();

prices[96][92][128] = new Array();

prices[96][92][129] = new Array();

prices[96][92][130] = new Array();

prices[96][92][131] = new Array();

prices[96][92][132] = new Array();

prices[96][92][133] = new Array();

prices[96][92][134] = new Array();

prices[96][93] = new Array();

prices[96][93][127] = new Array();

prices[96][93][128] = new Array();

prices[96][93][129] = new Array();

prices[96][93][130] = new Array();

prices[96][93][131] = new Array();

prices[96][93][132] = new Array();

prices[96][93][133] = new Array();

prices[96][93][134] = new Array();

prices[96][94] = new Array();

prices[96][94][127] = new Array();

prices[96][94][128] = new Array();

prices[96][94][129] = new Array();

prices[96][94][130] = new Array();

prices[96][94][131] = new Array();

prices[96][94][132] = new Array();

prices[96][94][133] = new Array();

prices[96][94][134] = new Array();
prices[96][92][127] = {
  price: 115.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][127] = {
  price: 111.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][127] = {
  price: 104.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][128] = {
  price: 170.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][128] = {
  price: 164.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][128] = {
  price: 158.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][129] = {
  price: 256.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][129] = {
  price: 244.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][129] = {
  price: 232.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][130] = {
  price: 461.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][130] = {
  price: 432.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][130] = {
  price: 341.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][131] = {
  price: 571.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][131] = {
  price: 537.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][131] = {
  price: 439.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][132] = {
  price: 681.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][132] = {
  price: 643.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][132] = {
  price: 537.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][133] = {
  price: 791.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][133] = {
  price: 748.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][133] = {
  price: 635.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][92][134] = {
  price: 899.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][93][134] = {
  price: 853.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[96][94][134] = {
  price: 733.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};


prices[98] = new Array();

prices[98][92] = new Array();

prices[98][92][127] = new Array();

prices[98][92][128] = new Array();

prices[98][92][129] = new Array();

prices[98][92][130] = new Array();

prices[98][92][131] = new Array();

prices[98][92][132] = new Array();

prices[98][92][133] = new Array();

prices[98][92][134] = new Array();

prices[98][93] = new Array();

prices[98][93][127] = new Array();

prices[98][93][128] = new Array();

prices[98][93][129] = new Array();

prices[98][93][130] = new Array();

prices[98][93][131] = new Array();

prices[98][93][132] = new Array();

prices[98][93][133] = new Array();

prices[98][93][134] = new Array();

prices[98][94] = new Array();

prices[98][94][127] = new Array();

prices[98][94][128] = new Array();

prices[98][94][129] = new Array();

prices[98][94][130] = new Array();

prices[98][94][131] = new Array();

prices[98][94][132] = new Array();

prices[98][94][133] = new Array();

prices[98][94][134] = new Array();
prices[98][92][127] = {
  price: 128.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][127] = {
  price: 122.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][127] = {
  price: 115.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][128] = {
  price: 181.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][128] = {
  price: 176.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][128] = {
  price: 169.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][129] = {
  price: 269.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][129] = {
  price: 263.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][129] = {
  price: 255.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][130] = {
  price: 509.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][130] = {
  price: 465.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][130] = {
  price: 449.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][131] = {
  price: 644.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][131] = {
  price: 597.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][131] = {
  price: 570.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][132] = {
  price: 779.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][132] = {
  price: 729.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][132] = {
  price: 691.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][133] = {
  price: 914.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][133] = {
  price: 861.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][133] = {
  price: 812.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][92][134] = {
  price: 1049.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][93][134] = {
  price: 993.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};
prices[98][94][134] = {
  price: 933.00,
  page_count_min_price: 0.00,
  page_count_max_price: 0.00,
  page_count_enabled: false,
  page_count_min: 0,
  page_count_max: 0,
  page_count_step: 0
};


var quantities = new Array();

quantities[127] = 100;

quantities[128] = 250;

quantities[129] = 500;

quantities[130] = 1000;

quantities[131] = 2000;

quantities[132] = 3000;

quantities[133] = 4000;

quantities[134] = 5000;

var discount_factor = 1.0;
var tax_rate        = 0.0;
var shipping_cost   = 0.0;
var tax             = 0.0;
var subtotal        = 0;

function displayPrice( target, value )
{
  $(target).innerHTML = '$' + value.formatMoney(2, ".", ",");
}

function updateGrandTotal()
{ displayPrice( 'grand_total', tax + subtotal + shipping_cost ); }

function updateTax()
{
  if ( tax_rate == 0.0 )
    {
	  tax = 0.0;
      $('tax_group').hide();
	}
  else
    {
	  tax = subtotal * tax_rate;
	  displayPrice( 'sales_tax', tax );
	  $('tax_group').show();
	}
}

function updateSubtotal()
{
  price = prices[$('project_product_size_id').getValue()][$('project_product_color_id').getValue()][$('project_product_quantity_id').getValue()];

  if (price.page_count_enabled)
  {
    $('page_count_view').style.display = "block";
    page_count = parseInt($('project_page_count').value);
    if (page_count > price.page_count_max || isNaN(page_count))
    {
      page_count = price.page_count_max;
      subtotal = price.page_count_max_price;
    }
    else if (page_count < price.page_count_min)
    {
      page_count = price.page_count_min;
      subtotal = price.page_count_min_price;
    }
    else
    {
      for (var i = price.page_count_min; i <= price.page_count_max; i += price.page_count_step)
      {
        if ( page_count <= i )
        {
          page_count = i;
          break;
        }
      }
      price_per_step = (price.page_count_max_price - price.page_count_min_price) / ((price.page_count_max - price.page_count_min) / price.page_count_step);
      subtotal = price.page_count_min_price + (price_per_step * (page_count - price.page_count_min) / price.page_count_step);
    }

    if ( !isNaN(page_count) )
      $('project_page_count').value = page_count;
  }
  else
  {
    $('page_count_view').style.display = "none";
    subtotal = price.price;
  }

  subtotal  = ProductCustoms.addProductCustoms(subtotal);
  subtotal *= discount_factor;
/*
  $('subtotal').innerHTML = subtotal.formatMoney(2, ".", ",");
*/
  displayPrice( 'subtotal', subtotal );
  updateTax();
  updateGrandTotal();
}

var ProductCustoms = new Object();
ProductCustoms["addProductCustoms"] = function(price)
{
    return price;
}

function updateColorImage()
{
  element = $('project_product_color_id');
  if (colors[element.getValue()] != "")
    $('product_color_image').innerHTML = '<div class="form-box"><div class="form-img"><img src="' + colors[element.getValue()] + '"></div></div>';
  else
    $('product_color_image').innerHTML = '';
}

function updateCustomItemImage(custom_id)
{
  element = $('product_custom_' + custom_id);
  if (customs[custom_id][element.getValue()].image != "")
    $('product_custom_' + custom_id + '_image').innerHTML = '<div class="form-box"><div class="form-img"><img src="' + customs[custom_id][element.getValue()].image + '"></div></div>';
  else
    $('product_custom_' + custom_id + '_image').innerHTML = '';
}

calculationDisable = function() {
  $$('a.calculate').invoke('hide');
  $$('img.calculate').invoke('show');
}

calculationEnable = function() {
  $$('a.calculate').invoke('show');
  $$('img.calculate').invoke('hide');
}

shippingSelect = function(url) {
  calculationDisable();
  new Ajax.Request(url, {
    method:'put',
    asynchronous:true,
    evalScripts:true,
    parameters:Form.serialize($('calculate_form'))}
  );
}

onShippingSelect = function(cost) {
  calculationEnable();
  $('cost').innerHTML = "$0.00";
  if (isNaN(cost)) return;
  $('cost').innerHTML = "$" + cost.toFixed(2);

  shipping_cost = cost;

  updateTax();
  updateGrandTotal();
}


uploadDisable = function() {
  $$('input[type=submit]').invoke('hide');
  $$('img.upload').invoke('show');
}

uploadEnable = function() {
  $$('input[type=submit]').invoke('show');
  $$('img.upload').invoke('hide');
}


document.observe('dom:loaded', function() {
  $('project_product_color_id').observe('change', function() {
    updateColorImage();
    updateSubtotal();
  });
  $('project_product_quantity_id').observe('change', updateSubtotal );

  updateSubtotal();
  updateColorImage();

  
    new Ajax.Request('/product_sizes/update_customs_dropdowns?id=92', {asynchronous:true, evalScripts:true, method:'get', parameters:'authenticity_token=' + encodeURIComponent('5PHaZfgAuvix0W0wL62SnU7xtcrLU2ddDOrRSE95rd8=')})
  

  /* $('tab1').setStyle('display:block'); */
  $$('a.calculate').invoke('toggle');
});
