var bp = 0.0
var up = 0.0

function popup(mylink, windowname)
{
  if (! window.focus) return true;
  var href;
  if (typeof(mylink) == 'string')
     href=mylink;
  else
    href=mylink.href;
    window.open(href, windowname, 'width=500,height=500,scrollbars=yes top=100,left=100,resizable');
  return false;
}

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 5000;
// Duration of crossfade (seconds)
var crossFadeDuration = 3;
// Specify the image files
var Pic = new Array();
// to add more images, just continue
// the pattern, adding to the array below
//009a, 003a, 004a, 005a
Pic[0] = 'images/003a.jpg'
Pic[1] = 'images/004a.jpg'
Pic[2] = 'images/005a.jpg'
Pic[3] = 'images/009a.jpg'

// do not edit anything below this line
var t;
var j = 0;
var p = Pic.length;
var preLoad = new Array();
for (i = 0; i < p; i++) {
  preLoad[i] = new Image();
  preLoad[i].src = Pic[i];
}

function activateSlideShow() 
{
  if (document.all) {
    document.images.SlideShow.style.filter="blendTrans(duration=2)";
    document.images.SlideShow.style.filter="blendTrans(duration=crossFadeDuration)";
    document.images.SlideShow.filters.blendTrans.Apply();
  }
  document.images.SlideShow.src = preLoad[j].src;
  if (document.all) {
    document.images.SlideShow.filters.blendTrans.Play();
  }
  j = j + 1;
  if (j > (p - 1)) j = 0;
   t = setTimeout('activateSlideShow()', slideShowSpeed);
}

function getprice(name)
{
  var myFoo = document.getElementById(name);

  pricearray = new Array(62)
  pricearray[0] = new Array(2)
  pricearray[0][0] = 'SP1C12W'
  pricearray[0][1] = 3.13 * 1.2

  pricearray[1] = new Array(2)
  pricearray[1][0] = 'SP1C24W'
  pricearray[1][1] = 1.82 * 1.15

  pricearray[2] = new Array(2)
  pricearray[2][0] = 'SP1C36W'
  pricearray[2][1] = 1.21 * 1.15

  pricearray[3] = new Array(2)
  pricearray[3][0] = 'SP1C48W'
  pricearray[3][1] = .91 * 1.15

  pricearray[4] = new Array(2)
  pricearray[4][0] = 'SP1C144W'
  pricearray[4][1] = .67 * 1.1

  pricearray[5] = new Array(2)
  pricearray[5][0] = 'SP2C24W'
  pricearray[5][1] = 3.44 * 1.2

  pricearray[6] = new Array(2)
  pricearray[6][0] = 'SP2C36W'
  pricearray[6][1] = 2.29 * 1.15

  pricearray[7] = new Array(2)
  pricearray[7][0] = 'SP2C48W'
  pricearray[7][1] = 1.72 * 1.15

  pricearray[8] = new Array(2)
  pricearray[8][0] = 'SP2C144W'
  pricearray[8][1] = 1.10 * 1.1
  
  pricearray[9] = new Array(2)
  pricearray[9][0] = 'SP3C24W'
  pricearray[9][1] = 4.25 * 1.15

  pricearray[10] = new Array(2)
  pricearray[10][0] = 'SP3C36W'
  pricearray[10][1] = 2.84 * 1.15

  pricearray[11] = new Array(2)
  pricearray[11][0] = 'SP3C48W'
  pricearray[11][1] = 2.13 * 1.15

  pricearray[12] = new Array(2)
  pricearray[12][0] = 'SP3C144W'
  pricearray[12][1] = 1.36 * 1.1

  pricearray[13] = new Array(2)
  pricearray[13][0] = 'SP4C36W'
  pricearray[13][1]= 3.38 * 1.15

  pricearray[14] = new Array(2)
  pricearray[14][0] = 'SP4C48W'
  pricearray[14][1] = 2.54 * 1.15
  
  pricearray[15] = new Array(2)
  pricearray[15][0] = 'SP4C144W'
  pricearray[15][1] = 1.66 * 1.1

  pricearray[16] = new Array(2)
  pricearray[16][0] = 'SP1C12C'
  pricearray[16][1]= 6.03

  pricearray[17] = new Array(2)
  pricearray[17][0] = 'SP1C24C'
  pricearray[17][1] = 3.01
  
  pricearray[18] = new Array(2)
  pricearray[18][0] = 'SP1C36C'
  pricearray[18][1] = 2.01

  pricearray[19] = new Array(2)
  pricearray[19][0] = 'SP1C48C'
  pricearray[19][1] = 1.51

  pricearray[20] = new Array(2)
  pricearray[20][0] = 'SP1C144C'
  pricearray[20][1] = 1.02

  pricearray[21] = new Array(2)
  pricearray[21][0] = 'SP2C24C'
  pricearray[21][1] = 3.84

  pricearray[22] = new Array(2)
  pricearray[22][0] = 'SP2C36C'
  pricearray[22][1] = 2.56

  pricearray[23] = new Array(2)
  pricearray[23][0] = 'SP2C48C' 
  pricearray[23][1] = 1.92

  pricearray[24] = new Array(2)
  pricearray[24][0] = 'SP2C144C'
  pricearray[24][1] = 1.30

  pricearray[25] = new Array(2)
  pricearray[25][0] = 'SP3C24C'
  pricearray[25][1] = 4.65

  pricearray[26] = new Array(2)
  pricearray[26][0] = 'SP3C36C'
  pricearray[26][1] = 3.10

  pricearray[27] = new Array(2)
  pricearray[27][0] = 'SP3C48C'
  pricearray[27][1] = 2.33

  pricearray[28] = new Array(2)
  pricearray[28][0] = 'SP3C144C'
  pricearray[28][1] = 1.60

  pricearray[29] = new Array(2)
  pricearray[29][0] = 'SP4C36C'
  pricearray[29][1] = 3.12

  pricearray[30] = new Array(2)
  pricearray[30][0] = 'SP4C48C'
  pricearray[30][1] = 2.34
  
  pricearray[31] = new Array(2)
  pricearray[31][0] = 'SP4C144C'
  pricearray[31][1] = 1.90
  
  pricearray[32] = new Array(2)
  pricearray[32][0] = 'EM3KS12'
  pricearray[32][1] = 4.00

  pricearray[33] = new Array(2)
  pricearray[33][0] = 'EM3KS24'
  pricearray[33][1] = 2.50

  pricearray[34] = new Array(2)
  pricearray[34][0] = 'EM3KS36'
  pricearray[34][1] = 2.15

  pricearray[35] = new Array(2)
  pricearray[35][0] = 'EM3KS48'
  pricearray[35][1] = 2.00

  pricearray[36] = new Array(2)
  pricearray[36][0] = 'EM3KS144'
  pricearray[36][1] = 1.60

  pricearray[37] = new Array(2)
  pricearray[37][0] = 'EM5KS12'
  pricearray[37][1] = 4.10

  pricearray[38] = new Array(2)
  pricearray[38][0] = 'EM5KS24'
  pricearray[38][1] = 2.90

  pricearray[39] = new Array(2)
  pricearray[39][0] = 'EM5KS36'
  pricearray[39][1] = 2.55

  pricearray[40] = new Array(2)
  pricearray[40][0] = 'EM5KS48'
  pricearray[40][1] = 2.40
  
  pricearray[41] = new Array(2)
  pricearray[41][0] = 'EM5KS144'
  pricearray[41][1] = 1.90

  pricearray[42] = new Array(2)
  pricearray[42][0] = 'EM7KS12'
  pricearray[42][1] = 4.60

  pricearray[43] = new Array(2)
  pricearray[43][0] = 'EM7KS24'
  pricearray[43][1] = 3.40

  pricearray[44] = new Array(2)
  pricearray[44][0] = 'EM7KS36'
  pricearray[44][1] = 3.05

  pricearray[45] = new Array(2)
  pricearray[45][0] = 'EM7KS48'
  pricearray[45][1] = 2.80

  pricearray[46] = new Array(2)
  pricearray[46][0] = 'EM7KS144'
  pricearray[46][1] = 2.30

  pricearray[47] = new Array(2)
  pricearray[47][0] = 'EM9KS12'
  pricearray[47][1] = 5.20

  pricearray[48] = new Array(2)
  pricearray[48][0] = 'EM9KS24'
  pricearray[48][1] = 4.00

  pricearray[49] = new Array(2)
  pricearray[49][0] = 'EM9KS36'
  pricearray[49][1] = 3.65

  pricearray[50] = new Array(2)
  pricearray[50][0] = 'EM9KS48'
  pricearray[50][1] = 3.40

  pricearray[51] = new Array(2)
  pricearray[51][0] = 'EM9KS144'
  pricearray[51][1] = 3.00

  pricearray[52] = new Array(2)
  pricearray[52][0] = 'EM11KS12'
  pricearray[52][1] = 6.00

  pricearray[53] = new Array(2)
  pricearray[53][0] = 'EM11KS24'
  pricearray[53][1] = 4.80
  
  pricearray[54] = new Array(2)
  pricearray[54][0] = 'EM11KS36'
  pricearray[54][1] = 4.45

  pricearray[55] = new Array(2)
  pricearray[55][0] = 'EM11KS48'
  pricearray[55][1] = 4.10

  pricearray[56] = new Array(2)
  pricearray[56][0] = 'EM11KS144'
  pricearray[56][1] = 3.70

  pricearray[57] = new Array(2)
  pricearray[57][0] = 'EM13KS12'
  pricearray[57][1] = 6.80

  pricearray[58] = new Array(2)
  pricearray[58][0] = 'EM13KS24'
  pricearray[58][1] = 5.50
  
  pricearray[59] = new Array(2)
  pricearray[59][0] = 'EM13KS36'
  pricearray[59][1] = 5.15

  pricearray[60] = new Array(2)
  pricearray[60][0] = 'EM13KS48'
  pricearray[60][1] = 4.80

  pricearray[61] = new Array(2)
  pricearray[61][0] = 'EM13KS144'
  pricearray[61][1] = 4.30

  myFoo.innerHTML = pricearray.length;
  
  var dfound = 0;
  var i = 0;
  while (i < pricearray.length)
  {
    if (pricearray[i][0] == name)
    {
      up=pricearray[i][1];
      dfound = 1;
      break;
    }
    i++;
  }

  var num3=((bp*109)+(up*150))/100
  num3=Math.round(num3*100)/100
  num3=num3.toFixed(2)
  if (dfound == 1) myFoo.innerHTML = '$' + num3;
  else myFoo.innerHTML = 'not found';
  return FALSE;
}

function setbaseprice(baseprice)
{
  bp = baseprice
}