function SelectSubCat(){
	
canexp1 = 50;
canexp2 = 30;
sliexp1 = 50;
sliexp2 = 30;
bwexp1 = 50;
bwexp2 = 30;
cpexp1 = 55;
cpexp2 = 40;
spkexp1 = 45;
spkexp2 = 30;

removeAllOptions(document.dlpromo2.board2);
addOption(document.dlpromo2.board2, "2e Board", "...2e Board...", "");

if(document.dlpromo.board1.value == 'Can Opener' || document.dlpromo.board1.value == 'Slider' || document.dlpromo.board1.value == 'Brainwash' || document.dlpromo.board1.value == '5 pieds' || document.dlpromo.board1.value == 'Speed Karrot'){
addOption(document.dlpromo2.board2, "Can Opener", "Can Opener", "");
addOption(document.dlpromo2.board2, "Slider", "Slider", "");
addOption(document.dlpromo2.board2, "Brainwash", "Brainwash", "");
addOption(document.dlpromo2.board2, "5 pieds", "5 pieds", "");
addOption(document.dlpromo2.board2, "Speed Karrot", "Speed Karrot", "");
}

if(document.dlpromo.board1.value == '1er Board'){
I1 = 0; E1 = 0;
I2 = 0; E2 = 0;}
if(document.dlpromo.board1.value == 'Can Opener'){
I1 = 99; E1 = canexp1;
I2 = 0; E2 = 0;}
if(document.dlpromo.board1.value == 'Slider'){
I1 = 119; E1 = sliexp1;
I2 = 0; E2 = 0;}
if(document.dlpromo.board1.value == 'Brainwash'){
I1 = 165; E1 = bwexp1;
I2 = 0; E2 = 0;}
if(document.dlpromo.board1.value == '5 pieds'){
I1 = 179; E1 = cpexp1;
I2 = 0; E2 = 0;}
if(document.dlpromo.board1.value == 'Speed Karrot'){
I1 = 209; E1 = spkexp1;
I2 = 0; E2 = 0;}

document.getElementById('int1').innerHTML = I1;
document.getElementById('exp1').innerHTML = E1;
document.getElementById('int2').innerHTML = I2;
document.getElementById('exp2').innerHTML = E2;
document.getElementById('subtotal1').innerHTML = E1 + I1;
document.getElementById('subtotal2').innerHTML = E2 + I2;
document.getElementById('gtotal').innerHTML = E1 + I1 + E2 + I2;
}

function Promo2pour1(){

canexp1 = 50;
canexp2 = 30;
sliexp1 = 50;
sliexp2 = 30;
bwexp1 = 50;
bwexp2 = 30;
cpexp1 = 55;
cpexp2 = 40;
spkexp1 = 45;
spkexp2 = 30;

if(document.dlpromo.board1.value == '1er Board'){
I1 = 0; E1 = 0;}
if(document.dlpromo.board1.value == 'Can Opener'){
I1 = 99; E1 = canexp2;}
if(document.dlpromo.board1.value == 'Slider'){
I1 = 119; E1 = sliexp2;}
if(document.dlpromo.board1.value == 'Brainwash'){
I1 = 165; E1 = bwexp2;}
if(document.dlpromo.board1.value == '5 pieds'){
I1 = 179; E1 = cpexp2;}
if(document.dlpromo.board1.value == 'Speed Karrot'){
I1 = 209; E1 = spkexp2;}

if(document.dlpromo2.board2.value == '2e Board'){
I2 = 0; E2 = 0;}
if(document.dlpromo2.board2.value == 'Can Opener'){
I2 = 99; E2 = canexp2;}
if(document.dlpromo2.board2.value == 'Slider'){
I2 = 119; E2 = sliexp2;}
if(document.dlpromo2.board2.value == 'Brainwash'){
I2 = 165; E2 = bwexp2;}
if(document.dlpromo2.board2.value == '5 pieds'){
I2 = 179; E2 = cpexp2;}
if(document.dlpromo2.board2.value == 'Speed Karrot'){
I2 = 209; E2 = spkexp2;}

document.getElementById('int1').innerHTML = I1;
document.getElementById('exp1').innerHTML = E1;
document.getElementById('int2').innerHTML = I2;
document.getElementById('exp2').innerHTML = E2;
document.getElementById('subtotal1').innerHTML = E1 + I1;
document.getElementById('subtotal2').innerHTML = E2 + I2;
document.getElementById('gtotal').innerHTML = E1 + I1 + E2 + I2;
}
////////////////// 


function removeAllOptions(selectbox)
{
	var i;
	for(i=selectbox.options.length-1;i>=0;i--)
	{
		//selectbox.options.remove(i);
		selectbox.remove(i);
	}
}


function addOption(selectbox, value, text )
{
	var optn = document.createElement("OPTION");
	optn.text = text;
	optn.value = value;

	selectbox.options.add(optn);
}

function createDOMForm2b(targetId, actionURL) {

 	// Where the form will be placed into the page
 	parentElement = document.getElementById(targetId);
 	parentElement.innerHTML = "";
 	
 	// Create a form
 	myForm = document.createElement('FORM');
 	myForm.method = 'post';
 	myForm.action = 'https://www.paypal.com/cgi-bin/webscr';
 	myForm.setAttribute('Name', 'myForm');
 	myForm.setAttribute('Target', 'paypal');
 	myForm.id = 'myForm';
  

  
  ajout = document.createElement('IMG');
  ajout.setAttribute('src', 'ajouter.jpg');
  ajout.setAttribute('border', '0');
  ajout.setAttribute('name', 'ajout2b');
  ajout.setAttribute('alt', 'PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !');
  ajout.setAttribute('onmouseover', "createDOMForm22b('formGoesHere2b')");
  ajout.setAttribute('width', '165');
  ajout.setAttribute('height', '28');
  myForm.appendChild(ajout);
 	
 	// Place the form into the page
 	parentElement.appendChild(myForm);
 	
 	// Bit o IE bug fixin'
 	if(navigator.appVersion.indexOf("MSIE") != -1) {

    // Fixes the name issue, event handling, and rendering bugs!
 		 parentElement.innerHTML = parentElement.innerHTML

 		 // Bug fix for multi selects with more than one selection in IE6
 		 if(navigator.appVersion.indexOf("MSIE 6.0") != -1) {
 			  multiOptions = document.getElementById('myDropDownMulti').options
 			  for(i=0; i<multiOptions.length; i++) {
 				   if(i==1 || i==3) { multiOptions[i].setAttribute('selected', 'true') }
 			  }
 		 }
 	}
}

function createDOMForm22b(targetId, actionURL) {

if(document.dlpromo.board1.value == '1er Board'){

	// Where the form will be placed into the page
 	parentElement = document.getElementById(targetId);
 	parentElement.innerHTML = "";
 	
 	// Create a form
 	myForm = document.createElement('DIV');
 	myForm.setAttribute('Name', 'myForm');
 	myForm.id = 'myForm';


  ajout = document.createElement('INPUT');
  ajout.type = 'image';
  ajout.setAttribute('src', 'ajouter_NB.jpg');
  ajout.setAttribute('border', '0');
  ajout.setAttribute('name', 'ajout2b');
  ajout.setAttribute('alt', 'PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !');
  ajout.setAttribute('onmousedown', "createfleche2b('flechemoi2b')");
  ajout.setAttribute('onmouseout', "createDOMForm2b('formGoesHere2b')");
  ajout.setAttribute('width', '165');
  ajout.setAttribute('height', '28');
  myForm.appendChild(ajout);
 	
 	// Place the form into the page
 	parentElement.appendChild(myForm);
 	
 	// Bit o IE bug fixin'
 	if(navigator.appVersion.indexOf("MSIE") != -1) {

    // Fixes the name issue, event handling, and rendering bugs!
 		 parentElement.innerHTML = parentElement.innerHTML

 		 // Bug fix for multi selects with more than one selection in IE6
 		 if(navigator.appVersion.indexOf("MSIE 6.0") != -1) {
 			  multiOptions = document.getElementById('myDropDownMulti').options
 			  for(i=0; i<multiOptions.length; i++) {
 				   if(i==1 || i==3) { multiOptions[i].setAttribute('selected', 'true') }
 			  }
 		 }
 	}
}

if(document.dlpromo.board1.value == 'Can Opener' || document.dlpromo.board1.value == 'Slider' || document.dlpromo.board1.value == 'Brainwash' || document.dlpromo.board1.value == '5 pieds' || document.dlpromo.board1.value == 'Speed Karrot'){
	
	// Where the form will be placed into the page
 	parentElement = document.getElementById(targetId);
 	parentElement.innerHTML = "";
 	
 	// Create a form
 	myForm = document.createElement('FORM');
 	myForm.method = 'post';
 	myForm.action = 'https://www.paypal.com/cgi-bin/webscr';
 	myForm.setAttribute('Name', 'myForm');
 	myForm.setAttribute('Target', 'paypal');
 	myForm.id = 'myForm';
  
  // 1ER BOARD
  if(document.dlpromo.board1.value == 'Can Opener'){
  bo = 99;
  if(document.dlpromo2.board2.value == '2e Board'){
  description = "Can Opener - Rotule Longboards";
  o_bo = '';}
  else{
  description = "Promo Presque 2 pour 1";
  o_bo = 'Can Opener ::::';}}
  if(document.dlpromo.board1.value == 'Slider'){
  bo = 119;
  if(document.dlpromo2.board2.value == '2e Board'){
  description = "Slider - Rotule Longboards";
  o_bo = '';}
  else{
  description = "Promo Presque 2 pour 1";
  o_bo = 'Slider ::::';}}
  if(document.dlpromo.board1.value == 'Brainwash'){
  bo = 165;
  if(document.dlpromo2.board2.value == '2e Board'){
  description = "Brainwash - Rotule Longboards";
  o_bo = '';}
  else{
  description = "Promo Presque 2 pour 1";
  o_bo = 'Brainwash ::::';}}
  if(document.dlpromo.board1.value == '5 pieds'){
  bo = 179;
  if(document.dlpromo2.board2.value == '2e Board'){
  description = "Cinq pieds - Rotule Longboards";
  o_bo = '';}
  else{
  description = "Promo Presque 2 pour 1";
  o_bo = '5 pieds ::::';}}
  if(document.dlpromo.board1.value == 'Speed Karrot'){
  bo = 209;
  if(document.dlpromo2.board2.value == '2e Board'){
  description = "Speed Karrot - Rotule Longboards";
  o_bo = '';}
  else{
  description = "Promo Presque 2 pour 1";
  o_bo = 'Speed Karrot ::::';}}

  
  // 2E BOARD
  if(document.dlpromo2.board2.value == '2e Board'){
  tr = 0;
  o_tr = '';}
  if(document.dlpromo2.board2.value == 'Can Opener'){
  tr = 99;
  o_tr = 'Can Opener ::::';}
  if(document.dlpromo2.board2.value == 'Slider'){
  tr = 119;
  o_tr = 'Slider ::::';}
  if(document.dlpromo2.board2.value == 'Brainwash'){
  tr = 165;
  o_tr = 'Brainwash ::::';}
  if(document.dlpromo2.board2.value == '5 pieds'){
  tr = 179;
  o_tr = '5 pieds ::::';}
  if(document.dlpromo2.board2.value == 'Speed Karrot'){
  tr = 209;
  o_tr = 'Speed Karrot ::::';}
  
  
  // TAXES ET SHIPPING
  taxship = "Expedition par bateau";
  totalavantship = bo + tr;
  shiptext = "Europe de l'Ouest";
  grandtotal = totalavantship + E1 + E2;
  
  
  mycart = document.createElement('INPUT');
  mycart.type = 'hidden';
  mycart.value = '_cart';
  mycart.setAttribute('Name', 'cmd');
  myForm.appendChild(mycart);

  mybusiness = document.createElement('INPUT');
  mybusiness.type = 'hidden';
  mybusiness.value = 'VSM7BTASMG4N2';
  mybusiness.setAttribute('Name', 'business');
  myForm.appendChild(mybusiness);
  
  mylc = document.createElement('INPUT');
  mylc.type = 'hidden';
  mylc.value = 'CA';
  mylc.setAttribute('Name', 'lc');
  myForm.appendChild(mylc);
  
  myitemname = document.createElement('INPUT');
  myitemname.type = 'hidden';
  myitemname.value = description;
  myitemname.setAttribute('Name', 'item_name');
  myForm.appendChild(myitemname);
  
  myon0 = document.createElement('INPUT');
  myon0.type = 'hidden';
  myon0.value = taxship;
  myon0.setAttribute('Name', 'on0');
  myForm.appendChild(myon0);
  
  myos0 = document.createElement('INPUT');
  myos0.type = 'hidden';
  myos0.value = shiptext;
  myos0.setAttribute('Name', 'os0');
  myForm.appendChild(myos0);
  
  if(document.dlpromo2.board2.value == 'Can Opener' || document.dlpromo2.board2.value == 'Slider' || document.dlpromo2.board2.value == 'Brainwash' || document.dlpromo2.board2.value == '5 pieds' || document.dlpromo2.board2.value == 'Speed Karrot'){
  myon1 = document.createElement('INPUT');
  myon1.type = 'hidden';
  myon1.value = ':::';
  myon1.setAttribute('Name', 'on1');
  myForm.appendChild(myon1);
  
  myon2 = document.createElement('INPUT');
  myon2.type = 'hidden';
  myon2.value = ':::';
  myon2.setAttribute('Name', 'on2');
  myForm.appendChild(myon2);}
  
  myos1 = document.createElement('INPUT');
  myos1.type = 'hidden';
  myos1.value = o_bo;
  myos1.setAttribute('Name', 'os1');
  myForm.appendChild(myos1);
  
  myos2 = document.createElement('INPUT');
  myos2.type = 'hidden';
  myos2.value = o_tr;
  myos2.setAttribute('Name', 'os2');
  myForm.appendChild(myos2);
  
  myamount = document.createElement('INPUT');
  myamount.type = 'hidden';
  myamount.value = grandtotal;
  myamount.setAttribute('Name', 'amount');
  myForm.appendChild(myamount);
  
  mycurrencycode = document.createElement('INPUT');
  mycurrencycode.type = 'hidden';
  mycurrencycode.value = 'CAD';
  mycurrencycode.setAttribute('Name', 'currency_code');
  myForm.appendChild(mycurrencycode);
  
  mybuttonsubtype = document.createElement('INPUT');
  mybuttonsubtype.type = 'hidden';
  mybuttonsubtype.value = 'products';
  mybuttonsubtype.setAttribute('Name', 'button_subtype');
  myForm.appendChild(mybuttonsubtype);
  
  mycn = document.createElement('INPUT');
  mycn.type = 'hidden';
  mycn.value = 'Instructions particulières au besoin';
  mycn.setAttribute('Name', 'cn');
  myForm.appendChild(mycn);
  
  mynoshipping = document.createElement('INPUT');
  mynoshipping.type = 'hidden';
  mynoshipping.value = '2';
  mynoshipping.setAttribute('Name', 'no_shipping');
  myForm.appendChild(mynoshipping);
  
  myrm = document.createElement('INPUT');
  myrm.type = 'hidden';
  myrm.value = '1';
  myrm.setAttribute('Name', 'rm');
  myForm.appendChild(myrm);
  
  myreturn = document.createElement('INPUT');
  myreturn.type = 'hidden';
  myreturn.value = 'http://www.rotulelongboards.com/merci.html';
  myreturn.setAttribute('Name', 'return');
  myForm.appendChild(myreturn);
  
  mycancelreturn = document.createElement('INPUT');
  mycancelreturn.type = 'hidden';
  mycancelreturn.value = 'http://www.rotulelongboards.com/annulation.html';
  mycancelreturn.setAttribute('Name', 'cancel_return');
  myForm.appendChild(mycancelreturn);
  
  myshipping = document.createElement('INPUT');
  myshipping.type = 'hidden';
  myshipping.value = 0.00;
  myshipping.setAttribute('Name', 'shipping');
  myForm.appendChild(myshipping);
  
  myadd = document.createElement('INPUT');
  myadd.type = 'hidden';
  myadd.value = '1';
  myadd.setAttribute('Name', 'add');
  myForm.appendChild(myadd);
  

  mybn = document.createElement('INPUT');
  mybn.type = 'hidden';
  mybn.value = 'PP-ShopCartBF:btn_cart_LG.gif:NonHosted';
  mybn.setAttribute('Name', 'bn');
  myForm.appendChild(mybn);
  
  ajout = document.createElement('INPUT');
  ajout.type = 'image';
  ajout.setAttribute('src', 'ajouter_NB.jpg');
  ajout.setAttribute('border', '0');
  ajout.setAttribute('name', 'ajout2b');
  ajout.setAttribute('alt', 'PayPal - la solution de paiement en ligne la plus simple et la plus sécurisée !');
  ajout.setAttribute('onmouseout', "createDOMForm2b('formGoesHere2b')");
  ajout.setAttribute('width', '165');
  ajout.setAttribute('height', '28');
  myForm.appendChild(ajout);
 	
 	// Place the form into the page
 	parentElement.appendChild(myForm);
 	
 	// Bit o IE bug fixin'
 	if(navigator.appVersion.indexOf("MSIE") != -1) {

    // Fixes the name issue, event handling, and rendering bugs!
 		 parentElement.innerHTML = parentElement.innerHTML

 		 // Bug fix for multi selects with more than one selection in IE6
 		 if(navigator.appVersion.indexOf("MSIE 6.0") != -1) {
 			  multiOptions = document.getElementById('myDropDownMulti').options
 			  for(i=0; i<multiOptions.length; i++) {
 				   if(i==1 || i==3) { multiOptions[i].setAttribute('selected', 'true') }
 			  }
 		 }
 	}
}}

function createfleche2b(targetId, actionURL) {

	
	// Where the form will be placed into the page
 	parentElement = document.getElementById(targetId);
 	parentElement.innerHTML = "";
 	
 	// Create a form
 	myForm = document.createElement('FORM');
 	myForm.method = 'post';
 	myForm.action = 'https://www.paypal.com/cgi-bin/webscr';
 	myForm.setAttribute('Name', 'myForm');
 	myForm.setAttribute('Target', 'paypal');
 	myForm.id = 'myForm';


  fleche = document.createElement('IMG');
  fleche.setAttribute('src', 'icone/fleche-rouge2.gif');
  fleche.setAttribute('border', '0');
  fleche.setAttribute('name', 'flechegif');
  fleche.setAttribute('width', '34');
  fleche.setAttribute('height', '11');
  myForm.appendChild(fleche);
 	
 	// Place the form into the page
 	parentElement.appendChild(myForm);
 	
 	// Bit o IE bug fixin'
 	if(navigator.appVersion.indexOf("MSIE") != -1) {

    // Fixes the name issue, event handling, and rendering bugs!
 		 parentElement.innerHTML = parentElement.innerHTML

 		 // Bug fix for multi selects with more than one selection in IE6
 		 if(navigator.appVersion.indexOf("MSIE 6.0") != -1) {
 			  multiOptions = document.getElementById('myDropDownMulti').options
 			  for(i=0; i<multiOptions.length; i++) {
 				   if(i==1 || i==3) { multiOptions[i].setAttribute('selected', 'true') }
 			  }
 		 }
 	}
}

function resetdroplist(){
removeAllOptions(document.drop_list.Shipping);
addOption(document.drop_list.Shipping, "Choisir", "[ Choisir region ]", "");
addOption(document.drop_list.Shipping, "Quebec", "Quebec", "");
addOption(document.drop_list.Shipping, "Reste du Canada", "Reste du Canada", "");
addOption(document.drop_list.Shipping, "EtatsUnis", "Etats-Unis", "");
addOption(document.drop_list.Shipping, "Europe", "Europe de l'Ouest", "");}

function fermepromo(){
document.getElementById('promo2pour1').style.visibility='hidden';}

function fermemouseover(){
fermons = document.getElementById('icferme');
fermons.setAttribute('src', 'icone/xferme2.jpg');
}
function fermemouseout(){
fermons = document.getElementById('icferme');
fermons.setAttribute('src', 'icone/xferme.jpg');
}



