// JavaScript Document
<!--



<!--

//  ===============================================================

//  Copyright © 2000, The Floyd Consultancy Ltd. All rights reserved.

//  Shop@ssistant by Rodney Myers                      Version 3.6_

//  ===============================================================

//

//1.Edit the data HERE   2. Create a corresponding display how you like.

//                \||/   3. That's it.

//                 ||

//                 ||

//                 ||

//              \\ || //

//               \\||//

//                \\//

//                 \/

var Description = "Rapide Drysuit"; // Description of the product

var Ref         = "Rapide";    // Identifying Reference

var chest_size    = "";          // Chest Size  text (from FORM input)

var waist_size      = "";          // Waist

var r_height   = "";          // Height

var r_leg   = "";          // Inside Leg

var r_shoe   = "";          // Shoe Size

var r_hip   = "";          // Hip Size

var r_zip   = "";          // Zip

var colour  = "";          // Colour

var ankles = "";          // Ankles

var Price       = 315.00;        // unit price

var Weight      = 8.00;        // weight in kilos or any other consistent measure for your site

var Taxcode     = 1;           // 1 = standard rate (may be omitted and default code of ?1 set for all)



function good_text_input(E,min_length){ // checks lengths of inputs

var V = E.value;

return(V.length>min_length);

}







// -->

<!--

//  ===============================================================

//  Copyright © 2000, The Floyd Consultancy Ltd. All rights reserved.

//  Shop@ssistant by Rodney Myers                      Version 3.6_

//  ===============================================================



var ProductsInList = 3  // Highest subscript +1

var prodlist = new Array();

prodlist[0] = new prodobj('Fly Zip','FZ',45.00,0.875,1)

prodlist[1] = new prodobj('Neoprene Hard Boots','HB', 30.00,0.75 ,1)

prodlist[2] = new prodobj('Reflective Tape','RT', 9.00,0.675,1)



    // Define a custom object named prodobj (Product Object).

    // An array of these objects will act as our product/price list.



    function prodobj(name, ref, unitprice, unitweight, taxcode) {

        this.name = name

        this.ref  = ref

        this.unitprice  = unitprice

        this.unitweight = unitweight

        this.taxcode    = taxcode

    }



// :::::::::::::::::::::::::::::::::::

// ::     Code added by Jethro      ::

// :::::::::::::::::::::::::::::::::::





function ProcessMultipleSession(form,form2){

var OK=true;

var msg="";

var CRLF=unescape("%0D%0A");



// Chest Size

if(good_text_input(form.user_input,0)){chest_size="Chest Size : " + form.user_input.value;}

else{OK=false;msg+="Please enter a Chest Size\n\n";}



// Waist

if(good_text_input(form.recipient_name,0)){waist_size="Waist Size:  " + form.recipient_name.value+CRLF;}

else{OK=false;msg+="Please enter a Waist Size\n\n";}



// Height

if(good_text_input(form.height,0)){r_height="Height: " + form.height.value+CRLF;}

else{OK=false;msg+="Please enter a Height\n\n";}



// Inside Leg

if(good_text_input(form.inside_leg,0)){r_leg="Inside Leg: " + form.inside_leg.value+CRLF;}

else{OK=false;msg+="Please enter a Inside Leg\n\n";}



//  Shoe Size

if(good_text_input(form.shoe_size,0)){r_shoe="Shoe Size: " + form.shoe_size.value+CRLF;}

else{OK=false;msg+="Please enter a Shoe Size\n\n";}



// Hip Size

if(good_text_input(form.hip_size,0)){r_hip="Hip Size: " + form.hip_size.value+CRLF;}

else{OK=false;msg+="Please enter a Hip Size\n\n";}



// Colour

if(good_text_input(form.colour,1)){colour="Colour: " + form.colour.value+CRLF;}

else{OK=false;msg+="Please enter a Colour Choice\n\n";}



// Zip

if(good_text_input(form.zip,1)){r_zip="Zip: " + form.zip.value+CRLF;}

else{OK=false;msg+="Please enter a Zip Choice\n\n";}



// Ankles

if(good_text_input(form.ankles,1)){ankles="Ankles: " + form.ankles.value+CRLF;}

else{OK=false;msg+="Please enter a Foot Seal Choice - no additonal cost!\n\n";}



if(OK)

{

top.newchoice(Description,Ref,chest_size,waist_size+r_height+r_leg+r_shoe+r_hip+colour+r_zip+ankles,Price,1,Weight,Taxcode); 

Add2Basket(form2)

}

else

{alert(msg); }



}







// :::::::::::::::::::::::::::::::::::

// ::  End of Code added by Jethro  ::

// :::::::::::::::::::::::::::::::::::









function Add2Basket(form){

top.multiproduct_start()         // prevents messaging/review after newchoice

var first_of_group = 0

var last_of_group  = 2

var Buying = false



for (var i = first_of_group ; i <= last_of_group ; i++ )

    {

     if ( form.elements[i].checked)

        {

         Prod   =  form.elements[i].value

         top.newchoice(prodlist[i].name,prodlist[i].ref,"Drysuit Exras","", prodlist[i].unitprice ,1,prodlist[i].unitweight,prodlist[i].taxcode )

         Buying =  true

         }



    }



top.multiproduct_end() // Restores system to state prior to multiproduct_start()



// Only go to Review if a quantity was found.

if (Buying) {top.reviewbasket(true)}



return (false); // no need for any real SUBMIT ACTION

} // end of function Add2Basket



function wMCP(V){document.write("£"+V);} //SIMPLIFIED non-system price writer : see /help/local_wMCP.txt



//  -->



function MM_swapImgRestore() { //v3.0

  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;

}



function MM_preloadImages() { //v3.0

  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();

    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)

    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}

}



function MM_findObj(n, d) { //v4.0

  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {

    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}

  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];

  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);

  if(!x && document.getElementById) x=document.getElementById(n); return x;

}



function MM_swapImage() { //v3.0

  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)

   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}

}

//-->
