﻿<!-- Begin Change Value In Paypal Form
// Copyright Maxbal Genealogy 2007 - All rights reserved
// This script may not be used without permission

// Updates price and item number in PaypPal form depending on option selected
// and validates that an item has been selcted

function UpdateItemCode(form)
{

// Bowtie (Blank Charts 5) Charts Code

 valid = true;
 promo = "rtgbnj804dw";
 ispromo = "No"; 	// Yes If Promotion
 					// No If No Promotion
 A1P = 6.50;
 A1W = 3.50;
 promoA1P = 4.99;

if ( form.os0.selectedIndex == 0 )
   		{
        	alert ( "Please select from the dropdown box which " + '\n' + form.item_name.value + '\n' +" you would like to purchase." );
        	valid = false;
    	}

if ( form.os1.value )
  {
  	if ( ispromo == "No" )
  		{
  		  alert ("There are no current promotions on this item");
  		  form.os1.value = null;
  		  valid = false;
  		}

	 else if ( form.os1.value != promo )
   		{
          alert ("You have entered an invalid promotion code" + '\n\n' + "The code is case sensitive so it must be entered using the correct upper and lower case letters." + '\n\n' + "Check that the code entered is still valid");
          valid = false;
        }
   }

if ( form.handling_cart.selectedIndex == 0 )
   		{
        	alert ( "Please select the postage zone from the dropdown box.");
        	valid = false;
    	}

if (form.os0.value == "Parchment Paper")  
  { form.item_number.value = "C-BT10G-GP";
	   if (form.os1.value == promo)
	       { form.amount.value = promoA1P;
	       }
	   else {form.amount.value = A1P;
	       } 
   }
if (form.os0.value == "White Paper")
	{ form.amount.value = A1W;
	  form.item_number.value = "C-BT10G-W";
	}

return valid
}

// End -->
