email1="Motown Sound <"; email2="info"; email3="rmat"; email4="ion@"; email5="motownsound.co.uk"; email6=">"; // ***************************************************************************************************** // **************************************** Postage Calculations ***************************************** // ***************************************************************************************************** var contactName = "Mick Holdsworth"; var contactdetailsTXT = contactName + "\n" + "76 The Lindens" + "\n" + "Wolverhampton" + "\n" + "West Midlands" + "\n" + "WV6 0LS" + "\n" + "United Kingdom" + "\n" + "Tel: 01902 744457"; var contactdetailsHTML = contactName + "
" + "76 The Lindens" + "
" + "Wolverhampton" + "
" + "West Midlands" + "
" + "WV6 0LS" + "
" + "United Kingdom" + "
" + "Tel: 01902 744457"; function InitialSelection() { FullOrderDescriptionTXT=""; FullOrderDescriptionHTML=""; FullItemNumber=""; ExtraItemNumber="None"; ExtraItemNumberHeader = "Additional Item Numbers"; var sel = document.getElementById("InitialSelect").value; coccod=""; if (sel=="None") { SelctdCountry="None";SelctdService="None";FullItemNumber=FullOrderDescriptionTXT=FullOrderDescriptionHTML="";} if (sel=="UK1") { SelctdCountry="UK";SelctdService="Standard"; } if (sel=="UK2") { SelctdCountry="UK";SelctdService="Signed For"; } if (sel=="UK3") { SelctdCountry="UK";SelctdService="Special Delivery"; } if (sel=="UK4") { SelctdCountry="UK";SelctdService="Collect In Person"; coccod="COD";} if (sel=="EU1") { SelctdCountry="EU";SelctdService="Standard"; } if (sel=="EU2") { SelctdCountry="EU";SelctdService="Tracked and Signed"; } if (sel=="USA1") { SelctdCountry="USA";SelctdService="Standard"; } if (sel=="USA2") { SelctdCountry="USA";SelctdService="Tracked and Signed"; } if (sel=="AUS1") { SelctdCountry="AUS";SelctdService="Standard"; } if (sel=="AUS2") { SelctdCountry="AUS";SelctdService="Tracked and Signed"; } if (sel=="WW1") { SelctdCountry="WW";SelctdService="Standard"; } if (sel=="WW2") { SelctdCountry="WW";SelctdService="Tracked and Signed"; } if (SelctdCountry=="UK") { SelctdCountryDesc="Delivery within the United Kingdom"; } if (SelctdCountry=="EU") { SelctdCountryDesc="Delivery within the European Union"; } if (SelctdCountry=="USA") { SelctdCountryDesc="Delivery within the United States"; } if (SelctdCountry=="AUS") { SelctdCountryDesc="Delivery within Australasia"; } if (SelctdCountry=="WW") { SelctdCountryDesc="Delivery to a Worldwide Destination"; } document.getElementById("Postage").innerHTML =""; if(SelctdCountry!="None") { getcartdata(SelctdCountry, SelctdService); if(itemtext != undefined || itemtext != null) { document.getElementById("Postage").innerHTML = startspan + SelctdCountryDesc + " - " + SelctdService + " - £" + PostValue + "

" + "Order Total (Including Postage As Above) - £" + TotalCost + ""; if(SelctdService=="Collect In Person") { document.getElementById("Postage").innerHTML = startspan + "Order Total - £" + TotalCost + "

" + "Collect in Person from the following address ..." + "

" + contactdetailsHTML + "
" + "email: " + email2 + email3 + email4 + email5 + ""; } } } } // end of function InitialSelection() function calculateformattotals() { if (ThisFormt == "7 Inch" || ThisFormt == "EP") {Total7Inch = eval(Total7Inch)+eval(ThisQty);} if (ThisFormt == "Double 7" || ThisFormt == "Double EP") {Total7Inch = eval(Total7Inch)+eval(ThisQty*2);} if (ThisFormt == "Triple 7" || ThisFormt == "EPx3") {Total7Inch = eval(Total7Inch)+eval(ThisQty*3);} if (ThisFormt == "7x4" || ThisFormt == "EPx4") {Total7Inch = eval(Total7Inch)+eval(ThisQty*4);} if (ThisFormt == "Box Set A") {Total7Inch = eval(Total7Inch)+eval(ThisQty*5);} // Box Set A is about 5 discs if (ThisFormt == "Box Set B") {Total7Inch = eval(Total7Inch)+eval(ThisQty*10);} // Box Set B is about 10 discs if (ThisFormt == "Box Set C") {Total7Inch = eval(Total7Inch)+eval(ThisQty*15);} // Box Set C is about 15 discs if (ThisFormt == "Box Set D") {Total7Inch = eval(Total7Inch)+eval(ThisQty*20);} // Box Set D is about 20 discs if (ThisFormt == "CDA" || ThisFormt == "CDS") {TotalCD = eval(TotalCD)+eval(ThisQty);} if (ThisFormt == "Double CD") {TotalCD = eval(TotalCD)+eval(ThisQty);} if (ThisFormt == "Triple CD") {TotalCD = eval(TotalCD)+eval(ThisQty*2);} if (ThisFormt == "CDx4" || ThisFormt == "CDx4") {TotalCD = eval(TotalCD)+eval(ThisQty*4);} if (ThisFormt == "CD Box Set") {TotalCD = eval(TotalCD)+eval(ThisQty*5);} if (ThisFormt == "8 Inch" || ThisFormt == "10 Inch" || ThisFormt == "12 Inch" || ThisFormt == "LP") {Total12Inch = eval(Total12Inch)+eval(ThisQty);} if (ThisFormt == "Double 12" || ThisFormt == "Double LP") {Total12Inch = eval(Total12Inch)+eval(ThisQty*2);} if (ThisFormt == "Triple 12" || ThisFormt == "Triple LP") {Total12Inch = eval(Total12Inch)+eval(ThisQty*3);} if (ThisFormt == "12x4" || ThisFormt == "LPx4") {Total12Inch = eval(Total12Inch)+eval(ThisQty*4);} if (ThisFormt == "12 Box Set" || ThisFormt == "LP Box Set") {Total12Inch = eval(Total12Inch)+eval(ThisQty*5);} } // end of function calculateformattotals() function calculateprimaryitem() { if(PostCountry=="UK") { Allowance12Inch = AllowanceUK10; AllowanceCD = AllowanceUK06; Allowance7Inch = AllowanceUK04; } if(PostCountry=="EU") { Allowance12Inch = AllowanceEU10; AllowanceCD = AllowanceEU06; Allowance7Inch = AllowanceEU04; } if(PostCountry=="USA") { Allowance12Inch = AllowanceUSA10; AllowanceCD = AllowanceUSA06; Allowance7Inch = AllowanceUSA04; } if(PostCountry=="AUS") { Allowance12Inch = AllowanceAUS10; AllowanceCD = AllowanceAUS06; Allowance7Inch = AllowanceAUS04; } if(PostCountry=="WW") { Allowance12Inch = AllowanceWW10; AllowanceCD = AllowanceWW06; Allowance7Inch = AllowanceWW04; } Remaining12=Remaining7=RemainingCD=RemainingAllowance12=RemainingAllowance7=RemainingAllowanceCD=0; PrimaryItem="None"; if(Total7Inch>0) { PrimaryItem="Seven"; } if(TotalCD>0) { PrimaryItem="CD"; } if(Total12Inch>0) { PrimaryItem="Twelve"; } if(PrimaryItem=="Twelve") { Remaining12 = eval(Total12Inch) - eval(Allowance12Inch); RemainingAllowance12 = eval(Allowance12Inch) - eval(Total12Inch); if(RemainingAllowance12<0) { RemainingAllowance12=0;} if(Remaining12<0) { Remaining12=0;} Remaining7=0; Total7Inch = eval(Total7Inch) + eval(TotalCD); TotalCD=0; if(Total7Inch>0 && RemainingAllowance12>0) { Remaining7 = eval(Total7Inch)-eval(RemainingAllowance12); if(Remaining7<0) { Remaining7=0;} } else { Remaining7=eval(Total7Inch); } } if(PrimaryItem=="CD") { RemainingCD = eval(TotalCD) - eval(AllowanceCD); RemainingAllowanceCD = eval(AllowanceCD) - eval(TotalCD); if(RemainingAllowanceCD<0) { RemainingAllowanceCD=0;} if(RemainingCD<0) { RemainingCD=0;} Remaining7=0; if(Total7Inch>0 && RemainingAllowanceCD>0) { Remaining7 = eval(Total7Inch)-eval(RemainingAllowanceCD); if(Remaining7<0) { Remaining7=0;} } else { Remaining7=eval(Total7Inch); } } if(PrimaryItem=="Seven") { Remaining7 = eval(Total7Inch) - eval(Allowance7Inch); if(Remaining7<0) { Remaining7=0;} } } // end of function calculateprimaryitem() function calculatepost() { if(PostCountry=="UK") { PostValuePrimary04=PostValuePrimaryUK04; PostValueSecondary04=PostValueSecondaryUK04; GroupRange04=GroupRangeUK04; GroupRangeStart04=GroupRangeStartUK04; GroupRangeEnd04=GroupRangeEndUK04; GroupRangeValue04=GroupRangeValueUK04 ; PostValuePrimary06=PostValuePrimaryUK06; PostValueSecondary06=PostValueSecondaryUK06; GroupRange06=GroupRangeUK06; GroupRangeStart06=GroupRangeStartUK06; GroupRangeEnd06=GroupRangeEndUK06; GroupRangeValue06=GroupRangeValueUK06 ; PostValuePrimary10=PostValuePrimaryUK10; PostValueSecondary10=PostValueSecondaryUK10; GroupRange10=GroupRangeUK10; GroupRangeStart10=GroupRangeStartUK10; GroupRangeEnd10=GroupRangeEndUK10; GroupRangeValue10=GroupRangeValueUK10 ; } if(PostCountry=="EU") { PostValuePrimary04=PostValuePrimaryEU04; PostValueSecondary04=PostValueSecondaryEU04; GroupRange04=GroupRangeEU04; GroupRangeStart04=GroupRangeStartEU04; GroupRangeEnd04=GroupRangeEndEU04; GroupRangeValue04=GroupRangeValueEU04 ; PostValuePrimary06=PostValuePrimaryEU06; PostValueSecondary06=PostValueSecondaryEU06; GroupRange06=GroupRangeEU06; GroupRangeStart06=GroupRangeStartEU06; GroupRangeEnd06=GroupRangeEndEU06; GroupRangeValue06=GroupRangeValueEU06 ; PostValuePrimary10=PostValuePrimaryEU10; PostValueSecondary10=PostValueSecondaryEU10; GroupRange10=GroupRangeEU10; GroupRangeStart10=GroupRangeStartEU10; GroupRangeEnd10=GroupRangeEndEU10; GroupRangeValue10=GroupRangeValueEU10 ; } if(PostCountry=="WW") { PostValuePrimary04=PostValuePrimaryWW04; PostValueSecondary04=PostValueSecondaryWW04; GroupRange04=GroupRangeWW04; GroupRangeStart04=GroupRangeStartWW04; GroupRangeEnd04=GroupRangeEndWW04; GroupRangeValue04=GroupRangeValueWW04 ; PostValuePrimary06=PostValuePrimaryWW06; PostValueSecondary06=PostValueSecondaryWW06; GroupRange06=GroupRangeWW06; GroupRangeStart06=GroupRangeStartWW06; GroupRangeEnd06=GroupRangeEndWW06; GroupRangeValue06=GroupRangeValueWW06 ; PostValuePrimary10=PostValuePrimaryWW10; PostValueSecondary10=PostValueSecondaryWW10; GroupRange10=GroupRangeWW10; GroupRangeStart10=GroupRangeStartWW10; GroupRangeEnd10=GroupRangeEndWW10; GroupRangeValue10=GroupRangeValueWW10 ; } if(PostCountry=="USA") { PostValuePrimary04=PostValuePrimaryUSA04; PostValueSecondary04=PostValueSecondaryUSA04; GroupRange04=GroupRangeUSA04; GroupRangeStart04=GroupRangeStartUSA04; GroupRangeEnd04=GroupRangeEndUSA04; GroupRangeValue04=GroupRangeValueUSA04 ; PostValuePrimary06=PostValuePrimaryUSA06; PostValueSecondary06=PostValueSecondaryUSA06; GroupRange06=GroupRangeUSA06; GroupRangeStart06=GroupRangeStartUSA06; GroupRangeEnd06=GroupRangeEndUSA06; GroupRangeValue06=GroupRangeValueUSA06 ; PostValuePrimary10=PostValuePrimaryUSA10; PostValueSecondary10=PostValueSecondaryUSA10; GroupRange10=GroupRangeUSA10; GroupRangeStart10=GroupRangeStartUSA10; GroupRangeEnd10=GroupRangeEndUSA10; GroupRangeValue10=GroupRangeValueUSA10 ; } if(PostCountry=="AUS") { PostValuePrimary04=PostValuePrimaryAUS04; PostValueSecondary04=PostValueSecondaryAUS04; GroupRange04=GroupRangeAUS04; GroupRangeStart04=GroupRangeStartAUS04; GroupRangeEnd04=GroupRangeEndAUS04; GroupRangeValue04=GroupRangeValueAUS04 ; PostValuePrimary06=PostValuePrimaryAUS06; PostValueSecondary06=PostValueSecondaryAUS06; GroupRange06=GroupRangeAUS06; GroupRangeStart06=GroupRangeStartAUS06; GroupRangeEnd06=GroupRangeEndAUS06; GroupRangeValue06=GroupRangeValueAUS06 ; PostValuePrimary10=PostValuePrimaryAUS10; PostValueSecondary10=PostValueSecondaryAUS10; GroupRange10=GroupRangeAUS10; GroupRangeStart10=GroupRangeStartAUS10; GroupRangeEnd10=GroupRangeEndAUS10; GroupRangeValue10=GroupRangeValueAUS10 ; } if(PrimaryItem=="Twelve") { PostValue = eval(PostValuePrimary10) + (eval(PostValueSecondary10)*eval(Remaining12)) + (eval(PostValueSecondary06)*eval(RemainingCD)) + (eval(PostValueSecondary04)*eval(Remaining7)); if(GroupRange10=="Y") { Total12CD7 = eval(Total12Inch) + eval(Total7Inch) + eval(TotalCD); Total12CD7Modified = Math.round( eval(Total7Inch) / 3 ) + Math.round( eval(TotalCD) / 2 ) + eval(Total12Inch); if(Total12CD7>=GroupRangeStart10) { PostValue=GroupRangeValue10; NewRemaining12CD7=0; NewRemaining12CD7=eval(Total12CD7Modified)-eval(GroupRangeEnd10); if(NewRemaining12CD7<0) { NewRemaining12CD7=0;} PostValue=eval(PostValue) + ( eval(NewRemaining12CD7)*eval(PostValueSecondary10) ); } } } if(PrimaryItem=="CD") { PostValue = eval(PostValuePrimary06) + (eval(PostValueSecondary06)*eval(RemainingCD)) + (eval(PostValueSecondary04)*eval(Remaining7)); if(GroupRange06=="Y") { TotalCD7 = eval(Total7Inch) + eval(TotalCD); TotalCD7Modified = Math.round( eval(Total7Inch) / 2 ) + eval(TotalCD); if(TotalCD7>=GroupRangeStart06) { PostValue=GroupRangeValue06; NewRemainingCD7=0; NewRemainingCD7=eval(TotalCD7Modified)-eval(GroupRangeEnd06); if(NewRemainingCD7<0) { NewRemainingCD7=0;} PostValue=eval(PostValue) + ( eval(NewRemainingCD7)*eval(PostValueSecondary06) ); } } } if(PrimaryItem=="Seven") { PostValue = eval(PostValuePrimary04) + (eval(PostValueSecondary04)*eval(Remaining7)); if(GroupRange04=="Y") { if(Total7Inch>=GroupRangeStart04) { PostValue=GroupRangeValue04; NewRemaining7=0; NewRemaining7=eval(Total7Inch)-eval(GroupRangeEnd04); if(NewRemaining7<0) { NewRemaining7=0;} PostValue=eval(PostValue) + ( eval(NewRemaining7)*eval(PostValueSecondary04) ); } } } } // end of function calculatepost() function calculateordervalues() { OrderValue = eval(OrderValue)+(eval(ThisPric)*eval(ThisQty)); } // end of function calculateordervalues() function calculateorderdescription() { if(ThisQty<=1) { OrderDescriptionTXT = OrderDescriptionTXT + ThisItmNo + ": " + ThisDesc + " - " + ThisFormt + " - £" + ThisPric + " \n"; OrderDescriptionHTML = OrderDescriptionHTML + "" + ThisItmNo + ": " + ThisDesc + " - " + ThisFormt + " £" + ThisPric + "
"; if(Items<=8) { FullItemNumber=FullItemNumber + ThisItmNo + " / "; } else { if(Items==9) { ExtraItemNumber=""; } ExtraItemNumber=ExtraItemNumber + ThisItmNo + " / "; } } else { ThisPricXQty=ThisPricXQty.toFixed(2) // converts to 2 decimal places OrderDescriptionTXT = OrderDescriptionTXT + ThisItmNo + ": " + ThisDesc + " - " + ThisFormt + " - £" + ThisPric + " (x " + ThisQty + ") = £" + ThisPricXQty + " \n"; OrderDescriptionHTML = OrderDescriptionHTML + "" + ThisItmNo + ": " + ThisDesc + " - " + ThisFormt + " £" + ThisPric + " (x " + ThisQty + ") = £" + ThisPricXQty + "
"; if(Items<=8) { FullItemNumber=FullItemNumber + ThisItmNo + " x " + ThisQty + " / "; } else { if(Items==9) { ExtraItemNumber=""; } ExtraItemNumber=ExtraItemNumber + ThisItmNo + " x " + ThisQty + " / "; } } } // end of function calculateorderdescription() function calculatepackageweight() { ItemsWeight=eval(Total12Inch*ItemWeight10)+eval(TotalCD*ItemWeight06)+eval(Total7Inch*ItemWeight04); if(PrimaryItem=="Twelve") { TotalWeight=eval(ItemsWeight)+eval(PackageWeight10); } if(PrimaryItem=="CD") { TotalWeight=eval(ItemsWeight)+eval(PackageWeight06); } if(PrimaryItem=="Seven") { TotalWeight=eval(ItemsWeight)+eval(PackageWeight04); } } // end of function calculatepackageweight() function calculateinsuranceUKSD() { PostValueSpecialDeliveryUKCat=PostValueSpecialDeliveryUKCat5; if(TotalWeight<=ItemWeightValueSpecialDeliveryCat4) { PostValueSpecialDeliveryUKCat=PostValueSpecialDeliveryUKCat4; } if(TotalWeight<=ItemWeightValueSpecialDeliveryCat3) { PostValueSpecialDeliveryUKCat=PostValueSpecialDeliveryUKCat3; } if(TotalWeight<=ItemWeightValueSpecialDeliveryCat2) { PostValueSpecialDeliveryUKCat=PostValueSpecialDeliveryUKCat2; } PostValue=PostValueSpecialDeliveryUKCat; if (OrderValue<=UKSDValue1) { PostValue = eval(PostValue)+eval(UKSDExtra1); } if (OrderValue>UKSDValue1 && OrderValue<=UKSDValue2) { PostValue = eval(PostValue)+eval(UKSDExtra2); } if (OrderValue>UKSDValue2) { PostValue = eval(PostValue)+eval(UKSDExtra3); } } // end of function calculateinsuranceUKSD() function calculateinsuranceITS() { if (OrderValue<=InternationalSIV) { PostValue = eval(PostValue)+eval(PostValueITS1); } if (OrderValue>InternationalSIV) { PostValue = eval(PostValue)+eval(PostValueITS2); } } // end of function calculateinsuranceITS() function getcartdata(selectedcountry, selectedservice) { PostCountry=selectedcountry; PostService=selectedservice; itemtext=""; PrimaryItem=""; OrderDescriptionTXT=""; OrderDescriptionHTML=""; FullItemNumber=""; OrderValue=0;PostValue=0; Secondary12Inch=SecondaryCD=Secondary7Inch=Total7Inch=TotalCD=Total12Inch=0; TotalWeight=0; var str = document.getElementById("justcartdata").innerHTML; var res = str.replace('|||', '|||
|Invalid|Invalid|||Invalid|Invalid|Invalid'); result = res.split('|||'); Items=1; for (i=0 ; i < 50; i++) { i=eval(i) + eval(1); itemtext = result[i]; if(itemtext != undefined || itemtext != null) { innerresult=itemtext.split('|'); if(innerresult[0]=="Valid"){ ThisItmNo = innerresult[1]; ThisDesc = innerresult[2]; ThisFormt = innerresult[3]; ThisQty = innerresult[4]; ThisPric = innerresult[5]; ThisPricXQty = eval(ThisQty) * eval(ThisPric); window["ItmNo" + Items]=ThisItmNo; window["Desc" + Items]=ThisDesc; window["Formt" + Items]=ThisFormt; window["Qty" + Items]=ThisQty; window["Pric" + Items]=ThisPric; window["PricXQty" + Items]=ThisPricXQty; calculateformattotals(); calculateordervalues(); calculateorderdescription(); Items= eval(Items)+eval(1); } if(innerresult[0]!="Valid"){ break; } } else { break; } } calculateprimaryitem(); calculatepost(); calculatepackageweight(); if(PostService!="Standard") { if(PostCountry=="UK") { if(PostService=="Signed For" || PostService=="SF") { PostValue=eval(PostValue)+eval(PostValueRecordedUK); } if(PostService=="Special Delivery" || PostService=="SD") { calculateinsuranceUKSD(); } } if(PostCountry=="EU" || PostCountry=="USA" || PostCountry=="AUS" || PostCountry=="WW") { if(PostService=="Tracked and Signed" || PostService=="TS") { calculateinsuranceITS(); } } } if(PostService=="Collect In Person") { PostValue=0; } TotalCost = eval(OrderValue) + eval(PostValue); OrderValue=OrderValue.toFixed(2) // converts to 2 decimal places PostValue=PostValue.toFixed(2) // converts to 2 decimal places TotalCost=TotalCost.toFixed(2) // converts to 2 decimal places TotalCostAltText = ""; if (ThisConvertionRate!=1) { TotalCostAltCurrency = eval(TotalCost) * ThisConvertionRate; TotalCostAltCurrency=TotalCostAltCurrency.toFixed(2) // converts to 2 decimal places TotalCostAltText = " (" + ThisCurrencySymbol + TotalCostAltCurrency + ")"; } FullOrderDescriptionTXT = OrderDescriptionTXT + "\n" + "Sub Total = £" + OrderValue + "\n" + "Postage (" + PostCountry + ") £" + PostValue + "\n" + "Total Cost = £" + TotalCost + TotalCostAltText; FullOrderDescriptionHTML = OrderDescriptionHTML + "
" + "Sub Total = £" + OrderValue + "
" + "Postage (" + PostCountry + ") £" + PostValue + "
" + "Total Cost = £" + TotalCost + "" + TotalCostAltText; } // end of function getcartdata() // ***************************************************************************************************** // ************************************* End Of Postage Calculations ************************************* // ***************************************************************************************************** // ***************************************************************************************************** // *************************************** Email Body Calculations *************************************** // ***************************************************************************************************** paypalemail1 = "pay"; paypalemail2 = "ments@"; paypalemail3 = "moon"; paypalemail4 = "light"; paypalemail5 = "music"; paypalemail6 = ".co.uk"; PaypalEmail = paypalemail1 + paypalemail2 + paypalemail3 + paypalemail4 + paypalemail5 + paypalemail6; emailbackup1 = "sixt"; emailbackup2 = "ify@"; emailbackup3 = "aol"; emailbackup4 = ".com"; emailbackup1 = "fb"; emailbackup2 = "@motown"; emailbackup3 = "sound"; emailbackup4 = ".co.uk"; EmailTitle = "Here are the details of your order with : Motown Sound"; FirstColor = "Blue"; SecondColor ="Black"; mainspanopen = "" + EmailTitle + "" subspan1open = "" subspan1close = "" subspan2open = "" subspan2close = "" function ValidityOfData(paypost) { vodp="Y"; ValidityAlert = ""; var str = document.getElementById("justcartdata").innerHTML; var res = str.replace('|||
', '|||
|Invalid|Invalid|||Invalid|Invalid|Invalid'); result = res.split('|||'); itemtext = result[1]; if(itemtext == undefined || itemtext == null) { vodp="N"; ValidityAlert= ValidityAlert + "You Have No Items In Your Shopping Cart" + " \n\n\n"; } var sel = document.getElementById("InitialSelect").value; if (sel=="None") { vodp="N"; ValidityAlert= ValidityAlert + "Please Select Shipping Option" + " \n\n"; } CustomerEmail = document.getElementById("CustEmail").value; if(CustomerEmail == "") { vodp="N"; ValidityAlert= ValidityAlert + "Please Enter Email Address" + " \n\n"; } CustomerDetails = document.getElementById("CustDetails").value; if(CustomerDetails =="" && paypost == "Emaill") { vodp="N"; ValidityAlert= ValidityAlert + "Paying with a Cheque or Postal Order through the Post ? " + " \n" + "Please Enter Your Name and Address" + " \n\n"; } if (ValidityAlert != "") { alert(ValidityAlert); } } function CheckCustomerEntries() { CustomersDetailsTXT =""; CustomersDetailsHTML =""; CustomersMessageTXT =""; CustomersMessageHTML =""; CustomersMessageFullTXT =""; CustomersMessageFullHTML =""; CustomerEmail = document.getElementById("CustEmail").value; if(CustomerEmail=="") { CustomerEmail="Please Enter Email Address"; } CustomerDetails = document.getElementById("CustDetails").value; if(CustomerDetails!="") { CustomerDetailsCRHTML = CustomerDetails.replace(/(\r\n|\n|\r)/gm,"
"); CustomerDetailsCRTXT = CustomerDetails.replace(/(\r\n|\n|\r)/gm," \n"); CustomersDetailsTXT= "Your name and address ..." + " \n\n" + CustomerDetailsCRTXT + " \n\n"; CustomersDetailsHTML="Your name and address ..." + "
" + subspan1open + CustomerDetailsCRHTML + subspan1close + "

"; } CustomerMessage = document.getElementById("CustMessage").value; if(CustomerMessage!="") { CustomerMessageCRHTML = CustomerMessage.replace(/(\r\n|\n|\r)/gm,"
"); CustomerMessageCRTXT = CustomerMessage.replace(/(\r\n|\n|\r)/gm," \n"); CustomersMessageTXT= "Here is your message ..." + " \n\n" + CustomerMessageCRTXT + " \n\n"; CustomersMessageHTML= "Here is your message ..." + "
" + subspan1open + CustomerMessageCRHTML + subspan1close + "

"; } CustomersMessageFullTXT= CustomersDetailsTXT + CustomersMessageTXT + "Here is your Order ..." + "\n\n"; CustomersMessageFullHTML= CustomersDetailsHTML + CustomersMessageHTML + "Here is your Order ..." + "
"; } function fixitemnumber() { FullItemNumberFixed= FullItemNumber + "//" ExtraItemNumberFixed= ExtraItemNumber + "//" var regEx = ' / //'; // FullItemNumberFixed = FullItemNumberFixed.replace(regEx,""); ExtraItemNumberFixed = ExtraItemNumberFixed.replace(regEx,""); } function createEmailBody(paypost,coccod) { MethodOfPaymentTXT = "UK Cheque / UK Postal Order / Cash On Collection / Cash in Post" + "\n" + "( If you're sending Cash in the Post, PLEASE INSURE IT )"; MethodOfPaymentHTML = "UK Cheque / UK Postal Order / Cash On Collection / Cash in Post" + "
" + "( If you're sending Cash in the Post, PLEASE INSURE IT )"; if(paypost=="PayPal") { MethodOfPaymentTXT = MethodOfPaymentHTML = "PAYPAL"; } if(coccod=="COD") { MethodOfPaymentTXT = MethodOfPaymentHTML = "Cash On Collection ONLY ( Unless agreed differently )"; } EmailBodyTXT = "Hello," + "\n\n" + "Thank you for placing your order ... " + "\n\n" + CustomersMessageFullTXT + FullOrderDescriptionTXT + "\n\n" + "Method of Shipping - " + SelctdCountryDesc + " - " + PostService + "\n" + "Method of Payment - " + MethodOfPaymentTXT + "\n\n"; EmailBodyHTML = mainspanopen + "Hello," + "

" + subspan1open + "Thank you for placing your order ... " + subspan1close + "

" + CustomersMessageFullHTML + FullOrderDescriptionHTML + "

" + "Method of Shipping - " + subspan1open + SelctdCountryDesc + " - " + PostService + subspan1close + "
" + "Method of Payment - " + subspan1open + MethodOfPaymentHTML + subspan1close + "

"; EmailBodyTXT = EmailBodyTXT + "If you are paying with a UK Cheque or Postal Order, please make it payable to M. Holdsworth and send it to the following address ... " + "\n\n" + contactdetailsTXT + "\n\n" + "Please note, this email is a confirmation of your order only. It is NOT a receipt of payment." + "\n" + "If you have paid though Paypal, then please refer to your Paypal email receipt, or log in to your Paypal account directly for your confirmation of payment." + "\n\n" + "If you need to contact me regarding this order then simply reply to this email." + "\n\n" + "Thank you for your order." + "\n\n"; on0=on1=on2=on3=on4=on5=on6= os0=os1=os2=os3=os4=os5=os6= canceltransaction=returntomerchant=""; // on0 = " this is on0 - One "; // 64 max - adds a : after this variable // os0 = " this is os0 - Two "; // 200 max - adds a , after this variable // on1 = " this is on1 - Three "; // 64 max - adds a : after this variable // os1 = " this is os1 - Four "; // 200 max - adds a , after this variable // on2 = " this is on2 - Fifth "; // os2 = " this is os2 - Sixth "; // on3 = " this is on3 - Seven "; // os3 = " this is os3 - Eight "; // on4 = " this is on4 - Nine "; // os4 = " this is os4 - Ten "; // on5 = " this is on5 - Eleven "; // 64 max - adds a : after this variable // os5 = " this is os5 - Twelve "; // 200 max - adds a , after this variable // on6 = " this is on6 - Thirteen "; // 64 max - adds a : after this variable // os6 = " this is os6 - Fourteen "; // 200 max - adds NOTHING after this variable if (ExtraItemNumber != "None") { on0 = ExtraItemNumberHeader; os0 = ExtraItemNumberFixed; } on1 = "Postage / Shipping"; os1 = SelctdCountryDesc + " - " + PostService; if (CustomerDetails != "") { on2 = "--- Your Details"; CustomerDetailsStripped = CustomerDetails.replace(/(\r\n|\n|\r)/gm,", "); os2 = CustomerDetailsStripped; on3 = "If these details are different from your Verified Paypal Address"; os3= " please confirm with me. Overseas will ONLY be shipped to a Verified Paypal address"; } if (CustomerMessage != "") { on4 = "--- Your Message"; CustomerMessageStripped = CustomerMessage.replace(/(\r\n|\n|\r)/gm,", "); os4 = CustomerMessageStripped; } returndomainURL="http://" + "motownsound.co.uk" + "/"; canceltransaction = '&cancel_return=' + returndomainURL + 'orderstatus/cancelled'; returntomerchant = '&return=' + returndomainURL + 'orderstatus/paid '; PaypalAction = 'https://www.paypal.com/cgi-bin/webscr?cmd=_xclick&item_name=' + "Items As Per Numbers Below" + '&item_number=' + FullItemNumberFixed + '&business=' + PaypalEmail + '&amount=' + OrderValue + '&shipping=' + PostValue + '&on0=' + on0 + '&os0=' + os0 + '&on1=' + on1 + '&os1=' + os1 + '&on2=' + on2 + '&os2=' + os2 + '&on3=' + on3 + '&os3=' + os3 + '&on4=' + on4 + '&os4=' + os4 + '&on5=' + on5 + '&os5=' + os5 + '&on6=' + on6 + '&os6=' + os6 + canceltransaction + returntomerchant; PaypalActionEmailLink = PaypalAction.replace(/\ /gi, "_") + "¤cy_code=GBP"; EmailBodyHTML = EmailBodyHTML + "If you are paying with a UK Cheque or Postal Order, please make it payable to " + subspan1open + "M. Holdsworth" + subspan1close + " and send it to the following address ... " + "

" + subspan1open + contactdetailsHTML + subspan1close + "

" + "Please note, this email is a confirmation of your order only. " + subspan1open + "It is NOT a receipt of payment." + subspan1close + "
" + "If you have paid though Paypal, then please refer to your Paypal email receipt, or log in to your Paypal account directly for your confirmation of payment." + "

" + subspan2open + "If you haven't paid through Paypal yet, just " + 'Click Here ( ... goes directly to https://paypal.com/...)" + subspan2close + "

" + "If you need to contact me regarding this order then simply reply to this email." + "

" + subspan1open + "Thank you for your order." + subspan1close + "

"; } function createEmailData(paypost) { var regEx = /\£/gi; // Change '£' to 'XXXGBPYYY' EmailBodyTXT = EmailBodyTXT.replace(regEx,"XXXGBPYYY"); EmailBodyHTML = EmailBodyHTML.replace(regEx,"XXXGBPYYY"); PaypalAction = PaypalAction.replace(regEx,"XXXGBPYYY"); CustomerMessage = CustomerMessage.replace(regEx,"XXXGBPYYY"); var form = document.forms[0]; var edata = new Array(); edata[0] = CustomerEmail; // Sent From (The Customer) edata[1] = email1 + email2 + email3 + email4 + email5 + email6; // Sent To (Me) edata[2] = EmailTitle; // Title of email edata[3] = EmailBodyTXT; // The Body of the email to the customer (TXT Formatted) edata[4] = EmailBodyHTML; // The Body of the email to the customer (HTML Formatted) edata[5] = CustomerMessage; // Message entered by customer edata[6] = ""; // No action for Non-Paypal method edata[7] = emailbackup1 + emailbackup2 + emailbackup3 + emailbackup4; // Bcc (Me at my backup location) edata[8] = email2 + email3 + email4 + email5; // My raw email to display if mail fails // this ALLOWS Paypal if customer has selected Collect In Person // if(paypost=="PayPal") // this BLOCKS Paypal if customer has selected Collect In Person if(paypost == "PayPal" && coccod != "COD") { edata[6] = PaypalAction; // The Full Link (Without the currency value) to send to Paypal } // Initialize packed or we get the word 'undefined' var packed = ""; for (i = 0; (i < edata.length); i++) { if (i > 0) { packed += ","; } packed += escape(edata[i]); } document.edata.edata.value = packed; document.edata.submit(); } function CollateEmailData(paypost,coccod) { ValidityOfData(paypost); if(vodp=="Y") { InitialSelection(); CheckCustomerEntries(); fixitemnumber(); createEmailBody(paypost,coccod); createEmailData(paypost); } } // ***************************************************************************************************** // ************************************ End Of Email Body Calculations ************************************ // ***************************************************************************************************** // This next funcion is for the infofmation page, but it's put it here because the contactdetailsHTML and email variables are only declared here function showcontactdetails() { document.getElementById("ShowFirstContact").innerHTML = startspan + contactdetailsHTML + "
" + "email: " + email2 + email3 + email4 + email5 + ""; document.getElementById("ShowSecondContact").innerHTML = startspan + contactdetailsHTML + "
" + "email: " + email2 + email3 + email4 + email5 + ""; }