//Cart Functions

function initialisecartonpage()
{
  //if qty and/or currency cookies don't exist then initialise
  if (readCookie('cartqty') === null) {createCookie('cartqty',0,0);}
  if (readCookie('cartcurrency') === null) {createCookie('cartcurrency','none',0);}

  //create buy-now pulldowns on page
  if (document.getElementById('buynow1') !== null) {  document.getElementById('buynow1').innerHTML = createform(productnumberfromname('buynow1')); }
  if (document.getElementById('buynow2') !== null) {  document.getElementById('buynow2').innerHTML = createform(productnumberfromname('buynow2')); }
  if (document.getElementById('buynow3') !== null) {  document.getElementById('buynow3').innerHTML = createform(productnumberfromname('buynow3')); }
  if (document.getElementById('buynow4') !== null) {  document.getElementById('buynow4').innerHTML = createform(productnumberfromname('buynow4')); }
  if (document.getElementById('buynow5') !== null) {  document.getElementById('buynow5').innerHTML = createform(productnumberfromname('buynow5')); }
  if (document.getElementById('buynow6') !== null) {  document.getElementById('buynow6').innerHTML = createform(productnumberfromname('buynow6')); }
  if (document.getElementById('buynow7') !== null) {  document.getElementById('buynow7').innerHTML = createform(productnumberfromname('buynow7')); }
  if (document.getElementById('buynow8') !== null) {  document.getElementById('buynow8').innerHTML = createform(productnumberfromname('buynow8')); }
  if (document.getElementById('buynow9') !== null) {  document.getElementById('buynow9').innerHTML = createform(productnumberfromname('buynow9')); }
  if (document.getElementById('buynow10') !== null) {  document.getElementById('buynow10').innerHTML = createform(productnumberfromname('buynow10')); }
  if (document.getElementById('buynow11') !== null) {  document.getElementById('buynow11').innerHTML = createform(productnumberfromname('buynow11')); }
  if (document.getElementById('buynow12') !== null) {  document.getElementById('buynow12').innerHTML = createform(productnumberfromname('buynow12')); }
  if (document.getElementById('buynow13') !== null) {  document.getElementById('buynow13').innerHTML = createform(productnumberfromname('buynow13')); }
  if (document.getElementById('buynow14') !== null) {  document.getElementById('buynow14').innerHTML = createform(productnumberfromname('buynow14')); }
  if (document.getElementById('buynow15') !== null) {  document.getElementById('buynow15').innerHTML = createform(productnumberfromname('buynow15')); }
  if (document.getElementById('buynow16') !== null) {  document.getElementById('buynow16').innerHTML = createform(productnumberfromname('buynow16')); }
  
  //if something in cart then make 'view carts' visible
  if (document.getElementById('viewcartalwaysvisible') !== null) {
		  document.getElementById('viewcartalwaysvisible').style.display = 'block';
		  document.getElementById('viewcartalwaysvisible').innerHTML = carttext(readCookie('cartqty'));
	  }
  if (readCookie('cartcurrency') != 'none' && readCookie('cartcurrency') !== null)
  {   
	  if (document.getElementById('viewcart1') !== null) {
		  document.getElementById('viewcart1').style.display = 'block';
		  document.getElementById('viewcart1').innerHTML = carttext(readCookie('cartqty'));
	  }
	  if (document.getElementById('viewcart2') !== null) {
		  document.getElementById('viewcart2').style.display = 'block';
		  document.getElementById('viewcart2').innerHTML = carttext(readCookie('cartqty'));
	  }
	  if (document.getElementById('viewcart3') !== null) {
		  document.getElementById('viewcart3').style.display = 'block';
		  document.getElementById('viewcart3').innerHTML = carttext(readCookie('cartqty'));
	  }
	  if (document.getElementById('viewcart4') !== null) {
		  document.getElementById('viewcart4').style.display = 'block';
		  document.getElementById('viewcart4').innerHTML = carttext(readCookie('cartqty'));
	  }	  
  }
}

function selectpriceandsubmit(sel,productcode)
{
  var currencycode = sel.options[sel.selectedIndex].value;
  //if cookie currency is empty or equal to selected currency then process
  if (readCookie('cartcurrency') == 'none' || readCookie('cartcurrency') == filtercurrency(currencycode))
  { //in the event of customer using back button from cart page, the most likely scenario is they haven't changed the cart qtys, so increment the cookie qty. If they return with proper button cookie qty will be updated anyway.
	createCookie('cartqty',parseInt(readCookie('cartqty'),10)+1,0);
	//in case cart currency is none, set it:
	createCookie('cartcurrency',filtercurrency(currencycode),0);
	//reset forms
	resetforms();
	//add selected product to cart
	//scode of 100 means multibuy discount allowed
	window.location = 'http://ww12.aitsafe.com/cf/add.cfm?userid=E3240837&product='+productname(productcode,currencycode)+'&units='+productshipping(productcode,filtercurrency(currencycode))+'&price='+productprice(productcode,filtercurrency(currencycode))+'&currency='+filtercurrency(currencycode)+'&return=www.swimsmooth.com/cartpassback.html' + '&scode=100' + languagepairterm(document.URL);
  }
  else
  { //make sure view carts are visible.
	if (document.getElementById('viewcart1') !== null) { document.getElementById('viewcart1').style.display='block'; }
	if (document.getElementById('viewcart2') !== null) { document.getElementById('viewcart2').style.display='block'; }
	if (document.getElementById('viewcart3') !== null) { document.getElementById('viewcart3').style.display='block'; }
	if (document.getElementById('viewcart4') !== null) { document.getElementById('viewcart4').style.display='block'; }
	//give warning - partially translated	
    alert('The current basket currency is '+currencycodetotext(readCookie('cartcurrency'))+'.\n\nYou are attempting to add an item in '+ currencycodetotext(currencycode)+'.\n\n'+document.getElementById('currencywarning').alt);
	//reset forms back to 'buy now'
	resetforms();
  }
}

function selectpriceandsubmitproconsole(sel,productcode)
{
   //order is processed by dlguard, not mals so do nothing with cookies
   var currencycode = sel.options[sel.selectedIndex].value;
	resetforms();
	window.location = 'http://www.swimsmooth.com/dlg/sell.php?prodData=' + productname(productcode,currencycode);
}

function selectpriceandsubmitclinics(sel,productcode)
{
  var currencycode = 0;
  var clinicloc = sel.options[sel.selectedIndex].value;
  //if cookie currency is empty or equal to selected currency then process
  if (readCookie('cartcurrency') == 'none' || readCookie('cartcurrency') == filtercurrency(currencycode))
  { //in the event of customer using back button from cart page, the most likely scenario is they haven't changed the cart qtys, so increment the cookie qty. If they return with proper button cookie qty will be updated anyway.
	createCookie('cartqty',parseInt(readCookie('cartqty'),10)+1,0);
	//in case cart currency is none, set it:
	createCookie('cartcurrency',filtercurrency(currencycode),0);
	//reset forms
	resetforms();
	//add selected product to cart
	//scode of 200 means no multibuy discount (has to be 100 for that)
	window.location = 'http://ww12.aitsafe.com/cf/add.cfm?userid=E3240837&product='+cliniclocation(clinicloc)+'&units=0&price='+productprice(productcode,filtercurrency(currencycode))+'&currency='+filtercurrency(currencycode)+'&return=www.swimsmooth.com/cartpassback.html' + '&scode=200' + languagepairterm(document.URL);
  }
  else
  { //make sure view carts are visible
	if (document.getElementById('viewcart1') !== null) { document.getElementById('viewcart1').style.display='block'; }
	if (document.getElementById('viewcart2') !== null) { document.getElementById('viewcart2').style.display='block'; }
	if (document.getElementById('viewcart3') !== null) { document.getElementById('viewcart3').style.display='block'; }
	if (document.getElementById('viewcart4') !== null) { document.getElementById('viewcart4').style.display='block'; }
	//give warning - partially translated	
    alert('The current basket currency is '+currencycodetotext(readCookie('cartcurrency'))+'.\n\nYou are attempting to add an item in '+ currencycodetotext(currencycode)+'.\n\n'+document.getElementById('currencywarning').alt);
	//reset forms back to 'buy now'
	resetforms();
  }
}

function cliniclocation(clinicloc)
{
if (clinicloc == 0) {return ('SS Clinic Birmingham, Tues 6th March 2012');}
if (clinicloc == 1) {return ('SS Clinic Stirling, Sun 11th March 2012');}
if (clinicloc == 2) {return ('SS Clinic Loughborough, Sun 18th March 2012');}
if (clinicloc == 3) {return ('SS Clinic Corby, Tues 20th March 2012');}
if (clinicloc == 4) {return ('SS Clinic Corby, Wed 21st March 2012');}
if (clinicloc == 5) {return ('SS Clinic Location6 Day Date Year');}
if (clinicloc == 6) {return ('SS Clinic Location7 Day Date Year');}
if (clinicloc == 7) {return ('SS Clinic Location8 Day Date Year');}
if (clinicloc == 8) {return ('SS Clinic Location9 Day Date Year');}
}

function selectpriceandsubmitmp3(sel,productcode)
{
  //order is processed by dlguard, not mals so do nothing with cookies
  var currencycode = sel.options[sel.selectedIndex].value;
  window.location = 'http://www.swimsmooth.com/dlg/sell.php?prodData=' + productname(productcode,currencycode);
}

function languagepairterm(passedurl)
{
  pairlocation = passedurl.indexOf('langpair=en%7C');
  if (pairlocation == -1) { return(''); }
  else { return('&sd='+passedurl.substring(pairlocation+9, passedurl.length).split("&")[0]); }
}

function carttext(qty)
{
  //basket words won't be translated
  if (qty != 1) {plural="s";} else {plural="";}
  if ( isNaN(qty) | qty === 0 ) {//for always visible cart links
	  return ('<a href="http://ww12.aitsafe.com/cf/review.cfm?userid=E3240837&return=www.swimsmooth.com/cartpassback.html' + languagepairterm(document.URL) + '"><img src="images/cart2mini.png" width="25" height="25" border="0">View Basket</a>');
  }
  else {//for cart links showing qty
	  return ('<a href="http://ww12.aitsafe.com/cf/review.cfm?userid=E3240837&return=www.swimsmooth.com/cartpassback.html' + languagepairterm(document.URL) + '"><img src="images/cart2mini.png" width="25" height="25" border="0">View ' + qty + ' Item'+plural+' in Basket</a>');
  }
}

function resetforms()
{
  if (document.getElementById('buynow1') !== null) {document.getElementById('buynow1').reset();}
  if (document.getElementById('buynow2') !== null) {document.getElementById('buynow2').reset();}
  if (document.getElementById('buynow3') !== null) {document.getElementById('buynow3').reset();}
  if (document.getElementById('buynow4') !== null) {document.getElementById('buynow4').reset();}
  if (document.getElementById('buynow5') !== null) {document.getElementById('buynow5').reset();}
  if (document.getElementById('buynow6') !== null) {document.getElementById('buynow6').reset();}
  if (document.getElementById('buynow7') !== null) {document.getElementById('buynow7').reset();}
  if (document.getElementById('buynow8') !== null) {document.getElementById('buynow8').reset();}
  if (document.getElementById('buynow9') !== null) {document.getElementById('buynow9').reset();}
  if (document.getElementById('buynow10') !== null) {document.getElementById('buynow10').reset();}
  if (document.getElementById('buynow11') !== null) {document.getElementById('buynow11').reset();}
  if (document.getElementById('buynow12') !== null) {document.getElementById('buynow12').reset();}
  if (document.getElementById('buynow13') !== null) {document.getElementById('buynow13').reset();}
  if (document.getElementById('buynow14') !== null) {document.getElementById('buynow14').reset();}
}

function productpriceandsymbol(productnumber, currencycode)
  {  // dvd boxset
	if (productnumber == '1') {
	if (currencycode == 0) {return ('GB &pound;' + productprice(productnumber, currencycode) + ' (PAL Format)');}
	if (currencycode == 1) {return ('US $' + productprice(productnumber, currencycode) + ' (NTSC Format)');}
	if (currencycode == 2) {return ('AUS $' + productprice(productnumber, currencycode) + ' (PAL Format)');}
	if (currencycode == 3) {return ('Euro &euro;' + productprice(productnumber, currencycode) + ' (PAL Format)');}
	if (currencycode == 4) {return ('Yen &yen;' + productprice(productnumber, currencycode) + ' (NTSC Format)');}
	if (currencycode == 5) {return ('CAD $' + productprice(productnumber, currencycode) + ' (NTSC Format)');}
  }
  // learn to swim
  else if (productnumber == '2') {
	if (currencycode == 0) {return ('GB &pound;' + productprice(productnumber, currencycode) + ' (PAL Format)');}
	if (currencycode == 1) {return ('US $' + productprice(productnumber, currencycode) + ' (NTSC Format)');}
	if (currencycode == 2) {return ('AUS $' + productprice(productnumber, currencycode) + ' (PAL Format)');}
	if (currencycode == 3) {return ('Euro &euro;' + productprice(productnumber, currencycode) + ' (PAL Format)');}
	if (currencycode == 4) {return ('Yen &yen;' + productprice(productnumber, currencycode) + ' (NTSC Format)');}
	if (currencycode == 5) {return ('CAD $' + productprice(productnumber, currencycode) + ' (NTSC Format)');}
  }  //training plans
  else if (productnumber == '3' || productnumber == '4') {
	if (currencycode == 0) {return ('GB &pound;' + productprice(productnumber, currencycode) + ' (Level 1)');}
	if (currencycode == 1) {return ('US $' + productprice(productnumber, currencycode) + ' (Level 1)');}
	if (currencycode == 2) {return ('AUS $' + productprice(productnumber, currencycode) + ' (Level 1)');}
	if (currencycode == 3) {return ('Euro &euro;' + productprice(productnumber, currencycode) + ' (Level 1)');}
	if (currencycode == 4) {return ('Yen &yen;' + productprice(productnumber, currencycode) + ' (Level 1)');}
	if (currencycode == 5) {return ('CAD $' + productprice(productnumber, currencycode) + ' (Level 1)');}
	if (currencycode == 6) {return ('GB &pound;' + productprice(productnumber, currencycode-6) + ' (Level 2)');}
	if (currencycode == 7) {return ('US $' + productprice(productnumber, currencycode-6) + ' (Level 2)');}
	if (currencycode == 8) {return ('AUS $' + productprice(productnumber, currencycode-6) + ' (Level 2)');}
	if (currencycode == 9) {return ('Euro &euro;' + productprice(productnumber, currencycode-6) + ' (Level 2)');}
	if (currencycode == 10) {return ('Yen &yen;' + productprice(productnumber, currencycode-6) + ' (Level 2)');}
	if (currencycode == 11) {return ('CAD $' + productprice(productnumber, currencycode-6) + ' (Level 2)');}
	if (currencycode == 12) {return ('GB &pound;' + productprice(productnumber, currencycode-12) + ' (Level 3)');}
	if (currencycode == 13) {return ('US $' + productprice(productnumber, currencycode-12) + ' (Level 3)');}
	if (currencycode == 14) {return ('AUS $' + productprice(productnumber, currencycode-12) + ' (Level 3)');}
	if (currencycode == 15) {return ('Euro &euro;' + productprice(productnumber, currencycode-12) + ' (Level 3)');}
	if (currencycode == 16) {return ('Yen &yen;' + productprice(productnumber, currencycode-12) + ' (Level 3)');}
	if (currencycode == 17) {return ('CAD $' + productprice(productnumber, currencycode-12) + ' (Level 3)');}
  }
  //pro consoles
  else if (productnumber == '9' || productnumber == '10') {
	if (currencycode == 0) {return ('GB &pound;' + productprice(productnumber, currencycode));}
	if (currencycode == 1) {return ('US $' + productprice(productnumber, currencycode));}
	if (currencycode == 2) {return ('AUS $' + productprice(productnumber, currencycode));}
	if (currencycode == 3) {return ('Euro &euro;' + productprice(productnumber, currencycode));}
	if (currencycode == 4) {return ('Yen &yen;' + productprice(productnumber, currencycode));}
	if (currencycode == 5) {return ('CAD $' + productprice(productnumber, currencycode));}
  }
  //swim caps
  else if (productnumber == '19') {
	if (currencycode == 0) {return ('GB &pound;' + productprice(productnumber, currencycode)) + ' (Blue Cap)';}
	if (currencycode == 1) {return ('US $' + productprice(productnumber, currencycode)) + ' (Blue Cap)';}
	if (currencycode == 2) {return ('AUS $' + productprice(productnumber, currencycode) + ' (Blue Cap)');}
	if (currencycode == 3) {return ('Euro &euro;' + productprice(productnumber, currencycode)) + ' (Blue Cap)';}
	if (currencycode == 4) {return ('Yen &yen;' + productprice(productnumber, currencycode)) + ' (Blue Cap)';}
	if (currencycode == 5) {return ('CAD $' + productprice(productnumber, currencycode)) + ' (Blue Cap)';}
	if (currencycode == 6) {return ('GB &pound;' + productprice(productnumber, currencycode-6) + ' (Pink Cap)');}
	if (currencycode == 7) {return ('US $' + productprice(productnumber, currencycode-6) + ' (Pink Cap)');}
	if (currencycode == 8) {return ('AUS $' + productprice(productnumber, currencycode-6) + ' (Pink Cap)');}
	if (currencycode == 9) {return ('Euro &euro;' + productprice(productnumber, currencycode-6) + ' (Pink Cap)');}
	if (currencycode == 10) {return ('Yen &yen;' + productprice(productnumber, currencycode-6) + ' (Pink Cap)');}
	if (currencycode == 11) {return ('CAD $' + productprice(productnumber, currencycode-6) + ' (Pink Cap)');}
  }
  //all other products, normal format
  else {
	if (currencycode == 0) {return ('GB &pound;' + productprice(productnumber, currencycode));}
	if (currencycode == 1) {return ('US $' + productprice(productnumber, currencycode));}
	if (currencycode == 2) {return ('AUS $' + productprice(productnumber, currencycode));}
	if (currencycode == 3) {return ('Euro &euro;' + productprice(productnumber, currencycode));}
	if (currencycode == 4) {return ('Yen &yen;' + productprice(productnumber, currencycode));}
	if (currencycode == 5) {return ('CAD $' + productprice(productnumber, currencycode));}
  }
return null;
}

function productname(productnumber, currencycode)
{	
	if (productnumber == '1') { return ('Swim Smooth DVD Boxset (English Language) ') + disktype(currencycode) + boxsetshippingdelay(currencycode); }
	if (productnumber == '2') { return ('Learn To Swim Freestyle Program (English Language) ') + disktype(currencycode); }
	if (productnumber == '3' || productnumber == '4') { 
	  if (productnumber == '3') { productnamebuild = 'Ironman Training Plan (English Language)';}
	  if (productnumber == '4') { productnamebuild = 'Oly/Half-IM Training Plan (English Language)';}
	  if (currencycode == '0' || currencycode == '1' || currencycode == '2' || currencycode == '3' || currencycode == '4' || currencycode == '5') {productnamebuild = productnamebuild + ' Level 1';} 
	  if (currencycode == '6' || currencycode == '7' || currencycode == '8' || currencycode == '9' || currencycode == '10' || currencycode == '11') {productnamebuild = productnamebuild + ' Level 2';}
	  if (currencycode == '12' || currencycode == '13' || currencycode == '14' || currencycode == '15' || currencycode == '16' || currencycode == '17') {productnamebuild = productnamebuild + ' Level 3';}
	  return (productnamebuild);
	}
	//return ('Ironman Training Plan (English Language) -- Shipping Date 27th August --'); }
	//return ('Oly/Half-IM Training Plan (English Language) -- Shipping Date 27th August --'); }
	if (productnumber == '5') { return ('Swim Smooth Stroke Correction Clinic'); }
	if (productnumber == '6') { return ('No Product'); }
	if (productnumber == '7') { return ('Wetronome Mk 2'); }
	if (productnumber == '8') { return ('PT Paddles'); }
	//for pro consoles, passback DL Guard code
	if (productnumber == '9') {
		if (currencycode == '0') { return ('pp%2C1%2C9'); } 
		if (currencycode == '1') { return ('pp%2C1%2C13'); }
		if (currencycode == '2') { return ('pp%2C1%2C14'); }
		if (currencycode == '3') { return ('pp%2C1%2C15'); }
		if (currencycode == '4') { return ('pp%2C1%2C16'); }
		if (currencycode == '5') { return ('pp%2C1%2C85'); }
		}
	if (productnumber == '10')  {
		if (currencycode == '0') { return ('pp%2C1%2C26'); } 
		if (currencycode == '1') { return ('pp%2C1%2C27'); }
		if (currencycode == '2') { return ('pp%2C1%2C28'); }
		if (currencycode == '3') { return ('pp%2C1%2C29'); }
		if (currencycode == '4') { return ('pp%2C1%2C30'); }
		if (currencycode == '5') { return ('pp%2C1%2C86'); }
		}
	//for mp3 tracks, passback DL Guard code
	if (productnumber == '11')  {
		if (currencycode == '0') { return ('pp%2C1%2C39'); } 
		if (currencycode == '1') { return ('pp%2C1%2C40'); }
		if (currencycode == '2') { return ('pp%2C1%2C41'); }
		if (currencycode == '3') { return ('pp%2C1%2C42'); }
		if (currencycode == '4') { return ('pp%2C1%2C43'); }
		if (currencycode == '5') { return ('pp%2C1%2C87'); }
		}
	if (productnumber == '12') { return ('Freestyler Paddles'); }
	if (productnumber == '13') { return ('Freestyler Paddles *Junior Version*'); }
	if (productnumber == '14') { return ('Finis Tech Toc'); }
	if (productnumber == '15') { return ('Finis Freestyle Snorkel'); }
	if (productnumber == '16') { return ('Finis Pull Buoy'); }
	if (productnumber == '17') { return ('Finis Fins'); }
	if (productnumber == '18') { return ('Finis SwiMP3.2G (2GB) Waterproof MP3 Player'); }
	if (productnumber == '19') { productnamebuild = 'Swim Smooth Silicon Swim Cap';
	if (currencycode == '0' || currencycode == '1' || currencycode == '2' || currencycode == '3' || currencycode == '4' || currencycode == '5') {productnamebuild = productnamebuild + ' (Blue)';} 
	if (currencycode == '6' || currencycode == '7' || currencycode == '8' || currencycode == '9' || currencycode == '10' || currencycode == '11') {productnamebuild = productnamebuild + ' (Pink)';}
	  return (productnamebuild);
	}
	if (productnumber == '20') { return ('Finis 3X-100M Stopwatch'); }
	if (productnumber == '21') { return ('Swim Smooth Catch Masterclass DVD (Region Free)'); }
	if (productnumber == '23') { return ('Swim Smooth Catch Masterclass DVD (Region Free) H2Open Free Shipping Offer'); }
	if (productnumber == '22') { return ('Finis SwimSense Performance Monitor'); }
	if (productnumber == '24') { return ('Finis Tempo Trainer Pro'); }
	alert('product not found in database ' +productnumber+'/'+currencycode);
return null;
}

function disktype(currencycode)
{
    if (currencycode == 0) {return ('(PAL Format)');}
	if (currencycode == 1) {return ('(NTSC Format)');}
	if (currencycode == 2) {return ('(PAL Format)');}
	if (currencycode == 3) {return ('(PAL Format)');}
	if (currencycode == 4) {return ('(NTSC Format)');}
	if (currencycode == 5) {return ('(NTSC Format)');}
	return null;
}

function boxsetshippingdelay(currencycode)
{
    if (currencycode == 0) {return ('');}
	if (currencycode == 1) {return ('');}
	if (currencycode == 2) {return ('');}
	if (currencycode == 3) {return ('');}
	if (currencycode == 4) {return ('');}
	if (currencycode == 5) {return ('');}
	return null;
}

function createform(productnumber)
{
//product 4 oly training plans, create 3 levels
if ( productnumber == 4 ) 
{
  return ('<SELECT name="currency" onChange="selectpriceandsubmit(this,' + productnumber + ')"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + productpriceandsymbol(productnumber,1) + '</OPTION><OPTION value="2">' + productpriceandsymbol(productnumber,2) + '</OPTION><OPTION value="3">' + productpriceandsymbol(productnumber,3) + '</OPTION><OPTION value="4">' + productpriceandsymbol(productnumber,4) + '</OPTION><OPTION value="5">' + productpriceandsymbol(productnumber,5) + '</OPTION><OPTION value="6">' + productpriceandsymbol(productnumber,6) + '</OPTION><OPTION value="7">' + productpriceandsymbol(productnumber,7) + '</OPTION><OPTION value="8">' + productpriceandsymbol(productnumber,8) + '</OPTION><OPTION value="9">' + productpriceandsymbol(productnumber,9) + '</OPTION><OPTION value="10">' + productpriceandsymbol(productnumber,10) + '</OPTION><OPTION value="11">' + productpriceandsymbol(productnumber,11) + '</OPTION><OPTION value="12">' + productpriceandsymbol(productnumber,12) + '</OPTION><OPTION value="13">' + productpriceandsymbol(productnumber,13) + '</OPTION><OPTION value="14">' + productpriceandsymbol(productnumber,14) + '</OPTION><OPTION value="15">' + productpriceandsymbol(productnumber,15) + '</OPTION><OPTION value="16">' + productpriceandsymbol(productnumber,16) + '</OPTION><OPTION value="17">' + productpriceandsymbol(productnumber,17) +'</OPTION></SELECT>');
}

//product 3 IM training plans, create 3 levels
if ( productnumber == 3 )
{
  return ('<SELECT name="currency" onChange="selectpriceandsubmit(this,' + productnumber + ')"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + productpriceandsymbol(productnumber,1) + '</OPTION><OPTION value="2">' + productpriceandsymbol(productnumber,2) + '</OPTION><OPTION value="3">' + productpriceandsymbol(productnumber,3) + '</OPTION><OPTION value="4">' + productpriceandsymbol(productnumber,4) + '</OPTION><OPTION value="5">' + productpriceandsymbol(productnumber,5) + '</OPTION><OPTION value="6">' + productpriceandsymbol(productnumber,6) + '</OPTION><OPTION value="7">' + productpriceandsymbol(productnumber,7) + '</OPTION><OPTION value="8">' + productpriceandsymbol(productnumber,8) + '</OPTION><OPTION value="9">' + productpriceandsymbol(productnumber,9) + '</OPTION><OPTION value="10">' + productpriceandsymbol(productnumber,10) + '</OPTION><OPTION value="11">' + productpriceandsymbol(productnumber,11) + '</OPTION><OPTION value="12">' + productpriceandsymbol(productnumber,12) + '</OPTION><OPTION value="13">' + productpriceandsymbol(productnumber,13) + '</OPTION><OPTION value="14">' + productpriceandsymbol(productnumber,14) + '</OPTION><OPTION value="15">' + productpriceandsymbol(productnumber,15) + '</OPTION><OPTION value="16">' + productpriceandsymbol(productnumber,16) + '</OPTION><OPTION value="17">' + productpriceandsymbol(productnumber,17) +'</OPTION></SELECT>');
}

//products 9 and 10 are the pro console digital downloads
else if ( ( productnumber == 9 ) | ( productnumber == 10 ) )
{
  return ('<SELECT name="currency" onChange="selectpriceandsubmitproconsole(this,' + productnumber + ')" style="margin:20px 0 20px 0"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + productpriceandsymbol(productnumber,1) + '</OPTION><OPTION value="2">' + productpriceandsymbol(productnumber,2) + '</OPTION><OPTION value="3">' + productpriceandsymbol(productnumber,3) + '</OPTION><OPTION value="4">' + productpriceandsymbol(productnumber,4) + '</OPTION><OPTION value="5">' + productpriceandsymbol(productnumber,5) + '</OPTION></SELECT>');
}
//product 19 is swim caps, create pink and blue versions
else if ( productnumber == 19 ) 
{
  return ('<SELECT name="currency" onChange="selectpriceandsubmit(this,' + productnumber + ')"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + productpriceandsymbol(productnumber,1) + '</OPTION><OPTION value="2">' + productpriceandsymbol(productnumber,2) + '</OPTION><OPTION value="3">' + productpriceandsymbol(productnumber,3) + '</OPTION><OPTION value="4">' + productpriceandsymbol(productnumber,4) + '</OPTION><OPTION value="5">' + productpriceandsymbol(productnumber,5) + '</OPTION></SELECT>');
//  <OPTION value="6">' + productpriceandsymbol(productnumber,6) + '</OPTION><OPTION value="7">' + productpriceandsymbol(productnumber,7) + '</OPTION><OPTION value="8">' + productpriceandsymbol(productnumber,8) + '</OPTION><OPTION value="9">' + productpriceandsymbol(productnumber,9) + '</OPTION><OPTION value="10">' + productpriceandsymbol(productnumber,10) + '</OPTION><OPTION value="11">' + productpriceandsymbol(productnumber,11) + '</OPTION>
}
//product 11 is mp3 tracks
else if ( productnumber == 11 )
{
  return ('<SELECT name="currency" onChange="selectpriceandsubmitmp3(this,' + productnumber + ')"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + productpriceandsymbol(productnumber,1) + '</OPTION><OPTION value="2">' + productpriceandsymbol(productnumber,2) + '</OPTION><OPTION value="3">' + productpriceandsymbol(productnumber,3) + '</OPTION><OPTION value="4">' + productpriceandsymbol(productnumber,4) + '</OPTION><OPTION value="5">' + productpriceandsymbol(productnumber,5) + '</OPTION></SELECT>');
}
//product number 5 is clinics - set this up for March 2012 UK clinics
else if ( productnumber == 5 )
{ 
  return ('<SELECT name="currency" onChange="selectpriceandsubmitclinics(this,' + productnumber + ')"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + 'Birmingham, Tues 6th March:  ' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + 'Stirling, Sun 11th March:  ' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="2">' + 'Loughborough, Sun 18th March:  ' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="3">' + 'Corby, Tues 20th March:  ' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="4">' + 'Corby, Wed 21st March:  ' + productpriceandsymbol(productnumber,0) + '</OPTION></SELECT>');
  
//  return ('<SELECT name="currency" onChange="selectpriceandsubmitclinics(this,' + productnumber + ')"><OPTION value="default">Sorry, all clinics are full.</OPTION></SELECT>');
}
else 
{
  return ('<SELECT name="currency" onChange="selectpriceandsubmit(this,' + productnumber + ')"><OPTION value="default">Buy Now: </OPTION><OPTION value="0">' + productpriceandsymbol(productnumber,0) + '</OPTION><OPTION value="1">' + productpriceandsymbol(productnumber,1) + '</OPTION><OPTION value="2">' + productpriceandsymbol(productnumber,2) + '</OPTION><OPTION value="3">' + productpriceandsymbol(productnumber,3) + '</OPTION><OPTION value="4">' + productpriceandsymbol(productnumber,4) + '</OPTION><OPTION value="5">' + productpriceandsymbol(productnumber,5) + '</OPTION></SELECT>');
}
}

function disktypes()
{
	alert(document.getElementById('dvdinfo').alt);
}

function planlevels()
{
	alert(document.getElementById('levelsinfo').alt);
}

function currencycodetotext(currencycode)
{
  currencycode = filtercurrency(currencycode);
  if (currencycode == "0") {return "GB Pounds";}
  else if (currencycode == "1") {return "US Dollars";}
  else if (currencycode == "2") {return "Australian Dollars";}
  else if (currencycode == "3") {return "Euros";}
  else if (currencycode == "4") {return "Yen";}
  else if (currencycode == "5") {return "Canadian Dollars";}
  else { currencycodetotext="unknown"; }
}

//filter down currency codes on training plans
function filtercurrency(currencycode)
{
	currencycode = parseInt(currencycode,10);
	if (currencycode >= 6) { currencycode = currencycode - 6;}
	if (currencycode >= 6) { currencycode = currencycode - 6;}
	return(currencycode);
}

//days is number of days cookie will live. If -1 then cookie immediately dies. If 0 then dies on browser closing.
function createCookie(name,value,days) {
	if (days) {
		var date = new Date();
		date.setTime(date.getTime()+(days*24*60*60*1000));
		expires = "; expires="+date.toGMTString();
	}
	else { expires = ""; }
	document.cookie = name+"="+value+expires+"; path=/";
}

function readCookie(name) {
	var nameEQ = name + "=";
	var ca = document.cookie.split(';');
	for(var i=0;i < ca.length;i++) {
		var c = ca[i];
		while (c.charAt(0)===' ') { c = c.substring(1,c.length); }
		if (c.indexOf(nameEQ) === 0) { return c.substring(nameEQ.length,c.length); }
	}
	return null;
}

function productnumberfromname(elementid) {
	fullname = document.getElementById(elementid).name;
	return fullname.substring(4,fullname.length);
}

//1.75 2.4 1.4 200

//return shipping price by currency
function productshipping(productnumber,currencycode) {
	  if (productnumber == 1 | productnumber == 2 | productnumber == 21 )	{
	  if (currencycode == 0) {return '1';} //Boxset or LTSF or CMC £        
	  if (currencycode == 1) {return '2';} //Boxset or LTSF or CMC US$
	  if (currencycode == 2) {return '3';} //Boxset or LTSF or CMC Aus$
	  if (currencycode == 3) {return '1.4';} //Boxset or LTSF or CMC Euros
	  if (currencycode == 4) {return '300';} //Boxset or LTSF or CMC Yen       
	  if (currencycode == 5) {return '2.1';} //Boxset or LTSF or CMC CAD$
  }
	  if (productnumber == 3 | productnumber == 4)	{
	  if (currencycode == 0) {return '1';} //Training Plan £
	  if (currencycode == 1) {return '2';} //Training Plan US$
	  if (currencycode == 2) {return '3';} //Training Plan Aus$
	  if (currencycode == 3) {return '1.4';} //Training Plan Euros
	  if (currencycode == 4) {return '300';} //Training Plan Yen
	  if (currencycode == 5) {return '2.1';} //Training Plan CAD$
  }
	  if (productnumber == 5) {
	  return '0'; //Clinic £
  }
	  if (productnumber == 6)	{
		  //no product 6
  }
	  if (productnumber == 7)	{
	  if (currencycode == 0) {return '0.847';} //Wetronome Mk 2 £
	  if (currencycode == 1) {return '1.9';} //Wetronome Mk 2 US$
	  if (currencycode == 2) {return '2.8';} //Wetronome Mk 2 Aus$
	  if (currencycode == 3) {return '1.187';} //Wetronome Mk 2 Euros
	  if (currencycode == 4) {return '254';} //Wetronome Mk 2 Yen
	  if (currencycode == 5) {return '2';} //Wetronome Mk 2 CAD$
  }
	  if (productnumber == 8)	{
	  if (currencycode == 0) {return '3.21';} //PT Paddles £
	  if (currencycode == 1) {return '3.54';} //PT Paddles US$
	  if (currencycode == 2) {return '4.4';} //PT Paddles Aus$
	  if (currencycode == 3) {return '2.57';} //PT Paddles Euros
	  if (currencycode == 4) {return '400';} //PT Paddles Yen
	  if (currencycode == 5) {return '3.7';} //PT Paddles CAD$
  }
	  if (productnumber == 9 | productnumber == 10 | productnumber == 11)	{
	  return '0'; //9 = Enth Console, 10 = Pro Console, 11 = MP3 tracks
  }
      if (productnumber == 12 | productnumber == 13)	{
	  if (currencycode == 0) {return '2.28';} //Freestyler +junior Pad £
	  if (currencycode == 1) {return '3.11';} //Freestyler +junior Pad US$
	  if (currencycode == 2) {return '4.64';} //Freestyler +junior Pad Aus$
	  if (currencycode == 3) {return '1.93';} //Freestyler +junior Pad Euros
	  if (currencycode == 4) {return '469';} //Freestyler +junior Pad Yen
	  if (currencycode == 5) {return '3.26';} //Freestyler +junior Pad CAD$
  }	  if (productnumber == 14)	{
	  if (currencycode == 0) {return '3.37';} //tec toc £
	  if (currencycode == 1) {return '5.90';} //tec toc US$
	  if (currencycode == 2) {return '8.46';} //tec toc Aus$
	  if (currencycode == 3) {return '3.24';} //tec toc Euros
	  if (currencycode == 4) {return '788';} //tec toc Yen
	  if (currencycode == 5) {return '6.20';} //tec toc CAD$
  }	  if (productnumber == 15)	{
	  if (currencycode == 0) {return '3.37';} //snorkel £ (guestimate, tbc)
	  if (currencycode == 1) {return '5.90';} //snorkel US$
	  if (currencycode == 2) {return '8.46';} //snorkel Aus$
	  if (currencycode == 3) {return '3.24';} //snorkel Euros
	  if (currencycode == 4) {return '788';} //snorkel Yen
	  if (currencycode == 5) {return '6.2';} //snorkel CAD$
  }	  if (productnumber == 16)	{
	  if (currencycode == 0) {return '2.28';} //Pull Buoy £
	  if (currencycode == 1) {return '2.52';} //Pull Buoy US$
	  if (currencycode == 2) {return '3.82';} //Pull Buoy Aus$
	  if (currencycode == 3) {return '1.64';} //Pull Buoy Euros
	  if (currencycode == 4) {return '401';} //Pull Buoy Yen
	  if (currencycode == 5) {return '2.64';} //Pull Buoy CAD$
  }	  if (productnumber == 17)	{
	  if (currencycode == 0) {return '4';} //fins £ (guestimate, tbc)
	  if (currencycode == 1) {return '8';} //fins US$
	  if (currencycode == 2) {return '12';} //fins Aus$
	  if (currencycode == 3) {return '5.6';} //fins Euros
	  if (currencycode == 4) {return '1200';} //fins Yen
	  if (currencycode == 5) {return '8.4';} //fins CAD$
  }	  if (productnumber == 18)	{
	  if (currencycode == 0) {return '2.83';} //swimp3 £
	  if (currencycode == 1) {return '4.50';} //swimp3 US$
	  if (currencycode == 2) {return '6.54';} //swimp3 Aus$
	  if (currencycode == 3) {return '2.61';} //swimp3 Euros
	  if (currencycode == 4) {return '628';} //swimp3 Yen
	  if (currencycode == 5) {return '4.72';} //swimp3 CAD$
  }	  if (productnumber == 19)	{
	  if (currencycode == 0) {return '0.847';} //swim cap £
	  if (currencycode == 1) {return '1.9';} //swim cap US$
	  if (currencycode == 2) {return '2.8';} //swim cap Aus$
	  if (currencycode == 3) {return '1.187';} //swim cap Euros
	  if (currencycode == 4) {return '254';} //swim cap Yen
	  if (currencycode == 5) {return '1.95';} //swim cap CAD$
  }	  if (productnumber == 20)	{
	  if (currencycode == 0) {return '1';} //swim cap £
	  if (currencycode == 1) {return '2';} //swim cap US$
	  if (currencycode == 2) {return '3';} //swim cap Aus$
	  if (currencycode == 3) {return '1.4';} //swim cap Euros
	  if (currencycode == 4) {return '300';} //swim cap Yen
	  if (currencycode == 5) {return '2.1';} //swim cap CAD$
  }	  if (productnumber == 22)	{
	  if (currencycode == 0) {return '0';} //swimsense £
	  if (currencycode == 1) {return '0';} //swimsense US$
	  if (currencycode == 2) {return '0';} //swimsense Aus$
	  if (currencycode == 3) {return '0';} //swimsense Euros
	  if (currencycode == 4) {return '0';} //swimsense Yen
	  if (currencycode == 5) {return '0';} //swimsense CAD$
  }	  if (productnumber == 23)	{
	  return '0'; // CMC free shipping
  }
	  if (productnumber == 24)	{
	  if (currencycode == 0) {return '2.3';} //tempo trainer pro £
	  if (currencycode == 1) {return '2';} //tempo trainer pro US$
	  if (currencycode == 2) {return '2';} //tempo trainer pro Aus$
	  if (currencycode == 3) {return '1.3';} //tempo trainer pro Euros
	  if (currencycode == 4) {return '500';} //tempo trainer pro Yen
	  if (currencycode == 5) {return '2';} //tempo trainer pro CAD$
  }
return null;
}

//return price by currency
function productprice(productnumber, currencycode) {
  if (productnumber == 1)	{
	  if (currencycode == 0) {return '39';} //Boxset £ 
	  if (currencycode == 1) {return '60';} //Boxset US$
	  if (currencycode == 2) {return '60';} //Boxset Aus$
	  if (currencycode == 3) {return '50';} //Boxset Euros
	  if (currencycode == 4) {return '5500';} //Boxset Yen
	  if (currencycode == 5) {return '63';} //Boxset CAD$
  }
	  if (productnumber == 2)	{
	  if (currencycode == 0) {return '30';} //LTSF £
	  if (currencycode == 1) {return '50';} //LTSF US$
	  if (currencycode == 2) {return '50';} //LTSF Aus$
	  if (currencycode == 3) {return '40';} //LTSF Euros
	  if (currencycode == 4) {return '4500';} //LTSF Yen
	  if (currencycode == 5) {return '53';} //LTSF CAD$
  }
	  if (productnumber == 3 | productnumber == 4 )	{
	  if (currencycode == 0) {return '30';} //Training Plan £
	  if (currencycode == 1) {return '50';} //Training Plan US$
	  if (currencycode == 2) {return '50';} //Training Plan Aus$
	  if (currencycode == 3) {return '40';} //Training Plan Euros
	  if (currencycode == 4) {return '4000';} //Training Plan Yen
	  if (currencycode == 5) {return '50';} //Training Plan CAD$
  }
	  if (productnumber == 5) {
	  if (currencycode == 0) {return '175';} //Clinic £
	  if (currencycode == 1) {return '300';} //Clinic US$
	  if (currencycode == 2) {return '300';} //Clinic Aus$
	  if (currencycode == 3) {return '250';} //Clinic Euros
	  if (currencycode == 4) {return '50000';} //Clinic Yen
	  if (currencycode == 5) {return '325';} //Clinic CAD$
  }
	  if (productnumber == 6)	{
//no product 6
  }
	  if (productnumber == 7)	{
	  if (currencycode == 0) {return '49';} //Wetronome Mk 2 £
	  if (currencycode == 1) {return '85';} //Wetronome Mk 2 US$
	  if (currencycode == 2) {return '85';} //Wetronome Mk 2 Aus$
	  if (currencycode == 3) {return '55';} //Wetronome Mk 2 Euros
	  if (currencycode == 4) {return '8000';} //Wetronome Mk 2 Yen
	  if (currencycode == 5) {return '88';} //Wetronome Mk 2 CAD$
  }
	  if (productnumber == 8)	{
	  if (currencycode == 0) {return '23';} //PT Paddles £
	  if (currencycode == 1) {return '32';} //PT Paddles US$
	  if (currencycode == 2) {return '32';} //PT Paddles Aus$
	  if (currencycode == 3) {return '30';} //PT Paddles Euros
	  if (currencycode == 4) {return '4000';} //PT Paddles Yen
	  if (currencycode == 5) {return '35';} //PT Paddles CAD$
  }
  //these prices are just labels, transaction prices are set within our secure download software.
	  if (productnumber == 9)	{
	  if (currencycode == 0) {return '15';} //Mr Smooth Pro Enthusiasts Console £
	  if (currencycode == 1) {return '23';} //Mr Smooth Pro Enthusiasts Console US$
	  if (currencycode == 2) {return '23';} //Mr Smooth Pro Enthusiasts Console Aus$
	  if (currencycode == 3) {return '19';} //Mr Smooth Pro Enthusiasts Console Euros
	  if (currencycode == 4) {return '2000';} //Mr Smooth Pro Enthusiasts Console Yen
	  if (currencycode == 5) {return '24';} //Mr Smooth Pro Enthusiasts Console CAD$
  }
	  if (productnumber == 10)	{
	  if (currencycode == 0) {return '100';} //Mr Smooth Pro Com Console £
	  if (currencycode == 1) {return '150';} //Mr Smooth Pro Com Console US$
	  if (currencycode == 2) {return '150';} //Mr Smooth Pro Com Console Aus$
	  if (currencycode == 3) {return '125';} //Mr Smooth Pro Com Console Euros
	  if (currencycode == 4) {return '14000';} //Mr Smooth Pro Com Console Yen
	  if (currencycode == 5) {return '160';} //Mr Smooth Pro Com Console CAD$
  }
	  if (productnumber == 11)	{
	  if (currencycode == 0) {return '10';} //MP3 Tracks £
	  if (currencycode == 1) {return '17';} //MP3 Tracks US$
	  if (currencycode == 2) {return '17';} //MP3 Tracks Aus$
	  if (currencycode == 3) {return '14';} //MP3 Tracks Euros
	  if (currencycode == 4) {return '2000';} //MP3 Tracks Yen
	  if (currencycode == 5) {return '19';} //MP3 Tracks CAD$
  }	  if (productnumber == 12)	{
	  if (currencycode == 0) {return '14';} //Freestyler Pad £
	  if (currencycode == 1) {return '19';} //Freestyler Pad US$
	  if (currencycode == 2) {return '19';} //Freestyler Pad Aus$
	  if (currencycode == 3) {return '16';} //Freestyler Pad Euros
	  if (currencycode == 4) {return '1800';} //Freestyler Pad Yen
	  if (currencycode == 5) {return '21';} //Freestyler Pad CAD$
  }	  if (productnumber == 13)	{
	  if (currencycode == 0) {return '12';} //Freestyler Pad Junior £
	  if (currencycode == 1) {return '17';} //Freestyler Pad Junior US$
	  if (currencycode == 2) {return '17';} //Freestyler Pad Junior Aus$
	  if (currencycode == 3) {return '14';} //Freestyler Pad Junior Euros
	  if (currencycode == 4) {return '1600';} //Freestyler Pad Junior Yen
	  if (currencycode == 5) {return '19';} //Freestyler Pad Junior CAD$
  }	  if (productnumber == 14)	{
	  if (currencycode == 0) {return '38';} //tec toc £
	  if (currencycode == 1) {return '50';} //tec toc US$
	  if (currencycode == 2) {return '50';} //tec toc Aus$
	  if (currencycode == 3) {return '45';} //tec toc Euros
	  if (currencycode == 4) {return '4500';} //tec toc Yen
	  if (currencycode == 5) {return '55';} //tec toc CAD$
  }	  if (productnumber == 15)	{
	  if (currencycode == 0) {return '22';} //snorkel price £
	  if (currencycode == 1) {return '35';} //snorkel US$
	  if (currencycode == 2) {return '35';} //snorkel Aus$
	  if (currencycode == 3) {return '29';} //snorkel Euros
	  if (currencycode == 4) {return '3300';} //snorkel Yen
	  if (currencycode == 5) {return '38';} //snorkel CAD$
  }	  if (productnumber == 16)	{
	  if (currencycode == 0) {return '9';} //Pull Buoy price £
	  if (currencycode == 1) {return '14';} //Pull Buoy US$
	  if (currencycode == 2) {return '14';} //Pull Buoy Aus$
	  if (currencycode == 3) {return '12';} //Pull Buoy Euros
	  if (currencycode == 4) {return '1440';} //Pull Buoy Yen
	  if (currencycode == 5) {return '14';} //Pull Buoy CAD$
  }	  if (productnumber == 17)	{
	  if (currencycode == 0) {return '10';} //fins price £
	  if (currencycode == 1) {return '17';} //fins US$
	  if (currencycode == 2) {return '17';} //fins Aus$
	  if (currencycode == 3) {return '14';} //fins Euros
	  if (currencycode == 4) {return '2000';} //fins Yen
	  if (currencycode == 5) {return '19';} //fins CAD$
  }	  if (productnumber == 18)	{
	  if (currencycode == 0) {return '110';} //swimp3 £
	  if (currencycode == 1) {return '150';} //swimp3 US$
	  if (currencycode == 2) {return '150';} //swimp3 Aus$
	  if (currencycode == 3) {return '149';} //swimp3 Euros
	  if (currencycode == 4) {return '14000';} //swimp3 Yen
	  if (currencycode == 5) {return '165';} //swimp3 CAD$
  }	  if (productnumber == 19)	{
	  if (currencycode == 0) {return '5';} //swim cap £
	  if (currencycode == 1) {return '8';} //swim cap US$
	  if (currencycode == 2) {return '8';} //swim cap Aus$
	  if (currencycode == 3) {return '7';} //swim cap Euros
	  if (currencycode == 4) {return '1000';} //swim cap Yen
	  if (currencycode == 5) {return '9';} //swim cap CAD$
  }	  if (productnumber == 20)	{
	  if (currencycode == 0) {return '30';} //3x-100m £
	  if (currencycode == 1) {return '45';} //3x-100m US$
	  if (currencycode == 2) {return '45';} //3x-100m Aus$
	  if (currencycode == 3) {return '35';} //3x-100m Euros
	  if (currencycode == 4) {return '4500';} //3x-100m Yen
	  if (currencycode == 5) {return '48';} //3x-100m CAD$
  }	  if (productnumber == 21 | productnumber == 23 )	{
	  if (currencycode == 0) {return '30';} //CMC £
	  if (currencycode == 1) {return '50';} //CMC US$
	  if (currencycode == 2) {return '50';} //CMC Aus$
	  if (currencycode == 3) {return '40';} //CMC Euros
	  if (currencycode == 4) {return '4500';} //CMC Yen
	  if (currencycode == 5) {return '53';} //CMC CAD$
  }  if (productnumber == 22)	{
	  if (currencycode == 0) {return '150';} //swimsense £
	  if (currencycode == 1) {return '220';} //swimsense US$
	  if (currencycode == 2) {return '210';} //swimsense Aus$
	  if (currencycode == 3) {return '195';} //swimsense Euros
	  if (currencycode == 4) {return '20000';} //swimsense Yen
	  if (currencycode == 5) {return '220';} //swimsense CAD$
  }  if (productnumber == 24)	{
	  if (currencycode == 0) {return '32';} //tempo trainer pro £
	  if (currencycode == 1) {return '50';} //tempo trainer pro US$
	  if (currencycode == 2) {return '50';} //tempo trainer pro Aus$
	  if (currencycode == 3) {return '40';} //tempo trainer pro Euros
	  if (currencycode == 4) {return '4000';} //tempo trainer pro Yen
	  if (currencycode == 5) {return '50';} //tempo trainer pro CAD$
  }
  
return null;
}
