var model = 0;
var amodel = ["", "Twist", "Tango", "Swing", "Matrix", "Jazz"];
var basenums = [0,5110,5120,5100,5140,5160];
var cf = 1;
var cs = 0;
var pt = ["", "", "", "", "", ""];
var at = ["", "", "", "", "", ""]

var acolors = ["Yellow", "Red", "Teal", "Green", "Orange", "Pink", "Black", "White", "Silver", "Gold", "Red", "Green", "Pink", "Purple", "Aqua"];

function exec(x,y)
{ document.fm.m.value = x;
  document.fm.o.value = y;
  document.fm.submit(); return false; }

function clearer()
{ var o = document.fm.elements["cost"];
  for (i=0; i<o.length; i++) { o[i].checked=false; }
  var o = document.fm.elements["weight"];
  for (i=0; i<o.length; i++) { o[i].checked=false; }
  var o = document.fm.elements["size"];
  for (i=0; i<o.length; i++) { o[i].checked=false; }
  var o = document.fm.elements["style"];
  for (i=0; i<o.length; i++) { o[i].checked=false; } }

function carter(s, n, p, o, i)
{ document.fm.m.value = "add"; var xr = "[Sale: " + i + "]";
  document.fm.elements["pName[]"].value=n.replace("[Sale]", xr);
  document.fm.elements["pNum[]"].value=s;
  document.fm.elements["pPrice[]"].value=p;
  document.fm.elements["pOption[]"].value=o;
  document.fm.elements["pQty[]"].value="1";
  document.fm.elements["pID[]"].value=i;
  document.fm.submit(); return false; }

function fmtDetail(p, m, pc, t1, t2, t3, t4, t5, d, r, s)
{ var x = ' class="point" onclick="popsDetail(';
  x += p+', '+m+', '+pc+', \''+t1+'\', \''+t2+'\', \''+t3+'\', \''+t4+'\', \''+t5+'\', \''+d+'\', '+r+', '+s+')';
  x += ';" alt="" />';
  return x; }

function popsDetail(p, m, pc, t1, t2, t3, t4, t5, d, r, s)
{ var x='<div class="hoop">\n';
  var z=""; if (pc==2) {z="_8";}

  if (p==1)
  { if (m==4)
    { x += '<div class="tape1"><img src="swatch/1'+t1+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/2_'+t2+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape3"><img src="swatch/3Ac_'+t3+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape4"><img src="swatch/4CrA_'+t4+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape5"><img src="swatch/Conn_'+t5+'.png" alt="" width="497" height="497" /></div>\n';
      if (pc==2)
	{ x += '<div class="tape5"><img src="swatch/Conn_'+t5+'_8.png" alt="" width="497" height="497" /></div>\n'; } }
    else if (m==1)
    { x += '<div class="tape1"><img src="swatch/1'+t1+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/2_'+t2+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape4"><img src="swatch/Conn_'+t5+'.png" alt="" width="497" height="497" /></div>\n';
      if (pc==2)
	{ x += '<div class="tape5"><img src="swatch/Conn_'+t5+'_8.png" alt="" width="497" height="497" /></div>\n'; } }
    else if (m==2)
    { x += '<div class="tape1"><img src="swatch/1'+t1+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/2_'+t2+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape3"><img src="swatch/3Ac_'+t3+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape4"><img src="swatch/Conn_'+t5+'.png" alt="" width="497" height="497" /></div>\n';
      if (pc==2)
	{ x += '<div class="tape5"><img src="swatch/Conn_'+t5+'_8.png" alt="" width="497" height="497" /></div>\n'; } }
    else if (m==3)
    { x += '<div class="tape1"><img src="swatch/TubeBlack.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/1Q_'+t2+z+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/2Q_'+t3+z+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/3Q_'+t4+z+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/4Q_'+t5+z+'.png" alt="" width="497" height="497" /></div>\n'; }
    else if (m==5)
    { x += '<div class="tape1"><img src="swatch/1'+t1+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape2"><img src="swatch/2'+t2+'.png" alt="" width="497" height="497" /></div>\n';
	x += '<div class="tape3"><img src="swatch/Conn_Jazz'+t5+z+'.png" alt="" width="497" height="497" /></div>\n'; }
    x += '<div class="tapex"></div>';
  }
  x += '<div class="taped"><table><tr><td style="width:22px;">';

  var pp=p-1;
  if (p>1) {x += '<img src="images/BackArrow_btn.gif"';
	      x += fmtDetail(pp, m, pc, t1, t2, t3, t4, t5, d, r, s);} 
  x += '</td><td style="width:44px;">';

  x += p + " of 3" + '</td><td style="width:22px;">';
  var pp=0;
  if (p==1) { pp=2; }
  else if (p==2) {pp=3;}
  if (pp) {x += '<img src="images/ForwardArrow_btn.gif"';
	      x += fmtDetail(pp, m, pc, t1, t2, t3, t4, t5, d, r, s);} 
  x += '</td></tr></table></div>';
  x += '<table><tr><td style="height:22px;"></td></tr>';
  x += '<tr><td style="height:478px;">';

  var ix="";
  if (p==2)
  { ix='<img src="images/'+(pc*4)+'PieceDetail.jpg" alt="" />';}
  else if (p==3) {ix='<img src="images/ButtonDetail.jpg" alt="" />';}
  x += ix + '</td></tr><td style="height:36px;vertical-align:bottom">';
  var ix="";
  if (p==2) {ix='Hoops Come in '+(pc*4)+' Pieces';}
  else if (p==3) {ix='Snap Button Connects Hoop Pieces';}
  else
  { ix = d + '<br />Sale <strike>$' + r + '</strike> <span class="sprice">$' + s + '</span>'; }
  x += ix + '</td></tr></table>\n';
  x += '</div>\n';
  reb = true;
  document.getElementById("apop").style.backgroundColor = "#131145";
  return showapop(x); }

