<!--

// ***** Price Specials *****
// These lines are modified when specials are in effect
// lines 510, 585
// see also items.js

var shipLevel = 'wl'
var insureRate = .75
var insAmount = 0

function displayDate() {

  // set month array
  var thisMonth = new Array()
  thisMonth[0]='January';thisMonth[1]='February';thisMonth[2]='March';
  thisMonth[2]='April';thisMonth[4]='May';thisMonth[5]='June';
  thisMonth[6]='July';thisMonth[7]='August';thisMonth[8]='September';
  thisMonth[9]='October';thisMonth[10]='November';thisMonth[11]='December'
  
  // build date string
  var d = new Date()
  var day = d.getDate()
  var year = d.getFullYear()
  var month = d.getMonth()
  today = thisMonth[month] + ' ' + day + ', ' + year
  
  document.write(today)  
}

function helpPage(x) {

  document.cookie = 'lastViewedch=' + x + ';null;path=/'
  window.location.href = '../ch.html'  
}

function contactUs(x) {

  if (x == 1) { 
    a = '40'; b = '26'; c = '7'; d = '3'; e = '6'
    var text = a + d + '-5' + c + '1-3' + e + b
  }
  if (x == 2) { 
    a = '0-2'; b = '00-'; c = '35'; d = '2'; e = '8'
    var text = e + b + '39' + a + d + c
  }
  if (x == 3) { 
  a = 'les@'; b = 'etfacto'
  var text = 'sa' + a + 'heads' + b + 'ry.com'
  }
  document.write(text)
}

//------------- Look for existance of cookie ----------------

function CheckForCookie() {
  NumberOfItems = 0
  NumberOfItems = GetCookie("NumberOrdered")
  if (!NumberOfItems || NumberOfItems == null) {
	NumberOfItems = 0
  }
  if (NumberOfItems < 1) {
    alert("There are no items in your Shopping Cart.")
    document.cookie = 'optBut=1; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT'
    history.go(-1)
	return
} }


// ------------------- Get cookie value --------------------

function GetCookie(Name) {

  var search = Name + "="
  var returnvalue = "";
  if (document.cookie.length > 0) {
    offset = document.cookie.indexOf(search)
    if (offset != -1) { // if cookie name exists
      offset += search.length  // index beginning of value
      end = document.cookie.indexOf(";", offset);  // index end of value
      if (end == -1) end = document.cookie.length;
      returnvalue = unescape(document.cookie.substring(offset, end))
    }
  }
  return returnvalue;
}


//--------------- Record cookie information -----------------

function SetCookie(name,value) {   // original code  ,expires,path,domain,secure)

  var dayz = 7
  if (name == 'cheq') { dayz = 365 }
  var expires = new Date()
  expires.setTime(expires.getTime() + 1000 * 60 * 60 * 24 * dayz);
  document.cookie = name + "=" + escape(value) + "; expires=" + expires + "; path=/" 
  
// original code  
//  document.cookie = name + "=" + value +
//		    ((expires) ? "; expires=" + expires : "") +
//		    ((path) ? "; path=" + path : "") +
//		    ((domain) ? "; domain=" + domain : "") +
//		    ((secure) ? "; secure" : "")

}


//-------------- Remove cookie from user's computer --------------

function DeleteCookie(name) {  // original code  ,path,domain)

  if (GetCookie(name)) {
    var expires = 'Thu, 01-Jan-70 00:00:01 GMT'
    document.cookie = name + "=1" + "; expires=" + expires + "; path=/" 
  }

// original code
//	document.cookie = name + "=" +
//			((path) ? "; path=" + path : "") +
//			((domain) ? "; domain=" + domain : "") +
//			"; expires=Thu, 01-Jan-70 00:00:01 GMT"

} 


// ---------- Display # of items in cart ------------

function numberOfItems() { // used to display # of items in cart

  num = GetCookie("NumberOrdered")
  if (!num || num == null) { num = 0 }
  document.write('<span id="numItems">' + num + '</span>')
  return
}

//---------------- Add item to shopping cart ------------------

function AddToCart(Number, flag1, flag2) {

//  if (flag2 == 3) { Number = parseInt(Number) + 70 }  // trap polaris
  var cartCount = GetCookie("NumberOrdered")
  var maxItems = 10
  if (cartCount >= maxItems) {
	alert('The max number of ' + maxItems + ' cart items has been reached.\n\n'
	    + 'Either make 2 orders or remove some items to continue.')
    window.location.href = '../cart.html'
	return
  }    	    
  addItem(Number)
  
  if (flag1 == 1) { addItem(51) }  // add gn amp
  if (flag1 == 2) { addItem(53) }  // add gn lifter
  if (flag1 == 3) { addItem(1064) }  // add pl amp
  if (flag1 == 4) { addItem(1061) }  // add cs lifter
  if (flag1 == 5) { addItem(1060) }  // add savi lifter
  
  if (flag2 == 1) { addItem(56) }  // add gn ntn
  if (flag2 == 3) { addItem(1067) }  // add pl ntn

  window.location.href = '../cart.html'
}

function addItem(Number) {
  iNumberOrdered = 0
  iNumberOrdered = GetCookie("NumberOrdered") // get number of items already ordered
  iNumberOrdered++ // increment number of items ordered by 1
  dbUpdatedOrder = "1" + "|" + Number // '1' = initial qty; Number is the array index from price list
  NewOrder = "Order." + iNumberOrdered

  // update cookie info 
  SetCookie ("NumberOrdered", iNumberOrdered)
  SetCookie (NewOrder, dbUpdatedOrder)
  return
}


//-------------- Delete item from shopping cart ----------------

function RemoveFromCart(item) {
	if (confirm("Click 'Ok' to remove this product from your shopping cart.")) {
	  NumberOrdered = GetCookie("NumberOrdered")
	  for(i=item; i <  NumberOrdered; i++) {
		NewOrder1 = "Order." + (i + 1)
		NewOrder2 = "Order." + (i)
		database = GetCookie(NewOrder1)
		SetCookie (NewOrder2, database)
	  }
	  NewOrder = "Order." + NumberOrdered
	  SetCookie ("NumberOrdered", NumberOrdered - 1)
	  DeleteCookie(NewOrder)
      window.location.replace('cart.html')
}	}


//----------------- Remove all items from shopping cart -------------------

function DeleteAllItems() {
	if (confirm("Click 'Ok' to remove ALL items in your shopping cart.")) {
	  DeleteAllCookies()
      window.history.go(-1)
}	}


// -------------------- Remove all cookies from user's computer ---------------------

function DeleteAllCookies() {         
  NumberOfOrders = 0
  NumberOfOrders = GetCookie("NumberOrdered")
  for (i = 1; i <= NumberOfOrders; i++) {
	document.cookie = "Order." + i + "=1; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT"
  }
  document.cookie = "NumberOrdered=1; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT"
  document.cookie = "optBut=1; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT"
  document.cookie = "chkBox=1; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT"
  return
}

//--------------- Change item quantity and update cookie ----------------

function UpdateQuantity(flag) {
  NumberOfOrders = 0
  NumberOfOrders = GetCookie("NumberOrdered")
  for (ii = 1; ii <= NumberOfOrders; ii++) {
  	if (!strNewQuantity || strNewQuantity == 'undefined') { strNewQuantity = "1" }
  	if (strNewQuantity.charAt(0) == " ") { strNewQuantity = "1" }
  	if (strNewQuantity.charAt(0) == "0") { strNewQuantity = "1" }
  	if (strNewQuantity != "") {
  	  ItemNumber = "Order." + ii
  	  NewValue = eval('document.forms.cartList.qty_' + ii + '.value')
	  if (NewValue.charAt(0) < 1 || NewValue.charAt(0) > 9) { NewValue = 1 }
      if (flag == 1 || NewValue == 0) { NewValue = 1 }  // reset value
  	  database = " "
  	  database = GetCookie(ItemNumber)
  	  offset = database.indexOf("|", 0)
  	  fields = new Array
  	  fields[0] = NewValue
  	  fields[1] = database.substring( offset + 1, database.length )
  	  UpdatedOrder = fields[0] + "|" + fields[1]
      SetCookie (ItemNumber, UpdatedOrder)
  }	}
  window.location.replace('cart.html')
  window.location.reload(true)
}

function keyPressed(e, x) {

  var key = window.event ? e.keyCode : e.which

  if (x == 1) { // qty field - cart.html
    // trap enter key 
    if (key == 13) { UpdateQuantity(); return false }
  }

  if (x == 2) { // postal field - chek.html
    // trap lower case letters - chek.html only
    if (key >= 97 && key <= 122) { return }  
  
    // trap upper case letters - chek.html only
    if (key >= 65 && key <= 90) { return }  
  
    // trap enter key - chek.html only
    if (key == 13) { return false }  
  }

  if (x == 3) { // phone field - chek.html  
    // trap dash, open and close brackets - chek.html only
    if (key == 45 || key == 40 || key == 41) { return }  
  
    // trap enter key 
    if (key == 13) { return false }
  }

  // trap number keys
  if (key >= 48 && key <= 57) { return }  
  
  // trap bs, tab and home keys 
  if (key == 8 || key == 9 || key == 11 || key == 0) { return }
  
  // trap enter key 
//  if (key == 13) { return }
  
  // trap bs, tab and home keys 
  if (key == 8 || key == 9 || key == 11 || key == 0) { return }
  
  // trap end, right, left and del keys 
  if (key == 35 || key == 37 || key == 39 || key == 46) { return }
  
  return false  
}

// save form info to cookie - chek.html
function savInfo() {

  var d = document.chk
  var text = d.f1.value + '|' + d.f2.value + '|' + d.f3.value
         + '|' + d.f4.value + '|' + d.f5.value + '|' + d.f6.value
		 + '|' + d.f7.value + '|' + d.f8.value + '|' + d.f9.value
  SetCookie('cheq', text)
}

// fill form via saved cookie values - chek.html
function getFormInfo() {

  var c = GetCookie('cheq') 
  if (!c) { return }
  formArray = c.split('|')
  var d = document.chk
  d.f1.value = formArray[0]; d.f2.value = formArray[1]
  d.f3.value = formArray[2]; d.f4.value = formArray[3]
  d.f5.value = formArray[4]; d.f6.value = formArray[5]
  d.f7.value = formArray[6]; d.f8.value = formArray[7]
  d.f9.value = formArray[8]  
}

// reset form and delete cookie - chek.html
function clearForm() {

  document.chk.reset()
  document.cookie = 'cheq=1; path=/; expires=Thu, 01-Jan-70 00:00:01 GMT'
}

// hide links and display message when print form - chek.html
function rqPrint() {

  document.getElementById('img1').style.visibility = 'visible'
  document.getElementById('img2').style.visibility = 'visible'
  document.getElementById('chkLinks').innerHTML = 'Shipping Information'
  window.print()
  var text =  '<a href="javascript:rqPrint()">Print This Page</a>'
           + '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'
	       + '<a href="javascript:document.chk.reset()">Clear Form</a>'
		   + '&nbsp; &nbsp; &nbsp; &nbsp; &nbsp;'
           + '<a href="javascript:location.replace(&quot;cart.html&quot;)">'
		   + 'Return to Cart</a>'
  document.getElementById('chkLinks').innerHTML = text
  document.getElementById('img1').style.visibility = 'hidden'
  document.getElementById('img2').style.visibility = 'hidden'
		
  // ask if form info to be saved
  text = 'Your shipping info can be stored on your computer for\n'
       + 'future use. Press OK to store the info and return to the\n'
	   + 'shopping cart. To delete the info, press Cancel, then\n'
	   + 'select the Clear Form option before returning to the\n'
	   + 'shopping cart.'
  if (confirm(text)) { location.replace('cart.html') } 	   
}

function payButPress(button) {

  // check if ship option selected
  var x = 'false'
  for (i = 0; i <= 2; i++) {
    if (document.cartList.option[i].checked) { x = true }
  }
  if ( shipLevel == 'ns' ) { x = 'true' }
  if (x == 'false') { alert('Please enter a Shipping Option.'); return } 
  if (button == 'receipt') { location.replace('print.html') }
  if (button == 'quote') { location.replace('quote.html') }
  if (button == 'cheque') { location.replace('chek.html') }
  if (button == 'paypal') { submitForm() }
}

function quoteChk(x) {

  document.getElementById('chkMessBox').style.visibility = 'hidden'
  if (x == 55) { print(); return }
  x = checkURL('item')
  if (x == 'chk') {
    document.getElementById('chkMessBox').style.visibility = 'visible'
  }
}

// record ship option and ins chkbox
function change(xx) { 

  if (xx >= 0 && xx <= 3) { SetCookie("optBut", xx, null, "/") }
  if (xx == 4) {  
    var box = GetCookie('chkBox')
	document.cartList.insure.checked = 'false'
    SetCookie("chkBox", 'false')
	if (!box || box == 'false') {
	  document.cartList.insure.checked = 'true'
      SetCookie("chkBox", 'true')
	}
  }
  if (xx == 5) {
    DeleteCookie('optBut')
	DeleteCookie('chkBox') 
  }
  window.location.replace('cart.html')
}

// ship rules set line 590
function shipOptions() {   

  var text = '<div class="button">' 
    + '<label onclick="javascript:change(0)" '
	+ 'title="See notes below for more shipping info">'
    + '<input class="radio" type="radio" name="option" '
	+ 'unchecked>Local pickup - Will contact when order is '
	+ 'ready for pickup</label></div>'
	
	+ '<div class="button">'
	+ '<label onclick="javascript:change(1)" '
	+ 'title="See notes below for more shipping info">'
    + '<input class="radio" type="radio" name="option" '
	+ 'unchecked>Calgary and area - $' + shipArray[1]  
	+ ' via local courier or Expedited Parcel</label></div>'
	
	+ '<div class="button">'
    + '<label onclick="javascript:change(2)" '
	+ 'title="See notes below for more shipping info">'
    + '<input class="radio" type="radio" name="option" '
	+ 'unchecked>West; BC, SK, AB (not Calgary) - $' + shipArray[2] 
	+ ' first item, $' + shipArray[4] + ' each additional</label></div>'
	
	+ '<div class="button">'
    + '<label onclick="javascript:change(3)" '
	+ 'title="See notes below for more shipping info">'
	+ '<input class="radio" type="radio" name="option" '
	+ 'unchecked>East (East of SK and North) - $' + shipArray[3]  
	+ ' first item, $' + shipArray[5] + ' each additional</label></div>'

  var text1 ='<div class="button">'
	+ '<label onmouseup="javascript:change(4)" '
	+ 'title="See notes below for more insurance info">'
    + '<input class="radio" type="checkbox" name="insure" unchecked>'
	+ 'Insurance - $' + insureRate.toFixed(2)  + ' per $100 of Subtotal ' 
	+ 'amount ($' + insAmount.toFixed(2) + ' this order)</label></div>'
	
  if (GetCookie('optBut') <= 1) {
    var text1 ='<div class="button"><label>'
	+ '<input class="radio" type="checkbox" name="insure" disabled>'
	+ 'Insurance does not apply to Calgary orders</label></div>'
  }	
  
  document.write(text + text1)	   

  // set radio button & ins box to cookied values
  var ob = GetCookie('optBut')
  if (ob && ob >= 0) { 
    var x = parseInt(ob) 
	document.cartList.option[x].checked = 'true'
  }	
  var cb = GetCookie('chkBox')
  if (cb == 'true' && ob != 0) { 
	document.cartList.insure.checked = 'true'
  }	

  // display currency message
  text = '<div class="currencyMess">Total in CDN dollars &nbsp;</div>'
//  document.write(text)	   
}

function displayTotals() {

  var text = '$' + TOSubTotal + '<br />'
	       + '<span class="discount">- $' + TODiscount + '</span><br />'
	       + '$' + TOShipping + '<br />'
	       + '$' + TOGST + '<br />'
	       + '<b>$' + TOTotal + '</b>' 
		   
  document.write(text)
				 
}

//******************** Display items in cart ***************************

function GetFromCart(how) {

  var shipping = 0
  var addShip = 0
  var GST = 0
  var GSTRate=.05
  var SubTotal=0
  var Total=0
  var wlCount = 0
  var hsCount = 0
  var acCount = 0
  var TOAmount = " "
  var TOquantity = " "
  var TOprice = " "
  var whattowrite = " "
  var hiddenItems = " "
  var hiddenShip = " "
  var hiddenDisc = " "
  var hiddenGST = " "
  var prodType = " "
  var NumberOrdered = 0
  var ppItemArray = new Array()
  numberofItems = 0    
  shipArray = new Array()
  ppItemArray = new Array()
  strNewQuantity=" "
  TOSubTotal = " "
  TODiscount = " "
  TOShipping = " "
  TOAddShip = " "
  TOGST = " "
  TOTotal = " "

// ********************* start of item entry loop ***********************

  NumberOrdered = GetCookie("NumberOrdered")
  for (i = 1; i <= NumberOrdered; i++) {
	Amount = 0
	NewOrder = "Order." + i
	database = ""
	database = GetCookie(NewOrder)
		
    // break down 'database' string into qty & item array index #
  	var itemArray = database.split("|")
  	var itemQty = parseInt(itemArray[0])
  	var indexItem = parseInt(itemArray[1])
  	
    // retreive data contained in array index #
    var prodInfo = GetItemInfo(indexItem)
    
    // break down item array entry into product type, description and price 
  	var itemArray = prodInfo.split(",");
  	var prodType = itemArray[0];
  	var descript = itemArray[1];
  	var price = itemArray[3];  // web price is 2, instore is 3
	
//    var y = GetCookie('priceLevel')
//    if (y == 2) { price = itemArray[3] }	

    // update running totals of each type of product 
    // and number of entries in cart
    if (prodType == "wl") { wlCount += itemQty }
    if (prodType == "hs") { hsCount += itemQty }
    if (prodType == "ac") { acCount += itemQty }
    if (prodType == "ns" && wlCount == 0 && hsCount == 0 && acCount == 0) { shipLevel = 'ns' }
    numberofItems += 1

    // multiply price by qty and add to subtotal and 
    // update running total of number of items in cart
    itemPrice = parseInt(price)
 	itemAmount = (itemPrice * itemQty)
	TOAmount = parseInt(itemAmount)
	SubTotal += TOAmount 

    // build html code to display cart entry
    x = numberofItems
    if (how == 'html') {   // html version
	  whattowrite += '<div class="itemLine">'
				+ '<p class="itemD entry">' + descript + '</p>'
				+ '<p class="qty entry"><input name="qty_' + x + '" ' 
                + 'onFocus="this.value=&quot;&quot;" '
				+ 'onkeypress="return keyPressed(event,1)" '
	            + 'onblur="" type=text maxlength=3 '
	            + 'value="' + itemQty + '" /></p>'
				+ '<p class="itemP entry">$' + itemPrice + '.00</p>'
				+ '<p class="itemA entry">$' + TOAmount + '.00</p>'
				+ '<p class="itemX entry"><a href="javascript:RemoveFromCart('
				+ i + ')"><img border="0" src="pics/remove.gif" /></a></p>'
				+ '</div>'
    }

    // build code for text version of cart
    if (how == 'text') {  // printable text version
      whattowrite += '<div class="itemLine">'
				+ '<p class="itemD entry">' + descript + '</p>'
				+ '<p class="quant entry">' + itemQty + '</p>'
				+ '<p class="itemP entry">$' + itemPrice + '.00</p>'
				+ '<p class="itemA entry">$' + TOAmount + '.00</p>'
				+ '</div>'
    }
	
// may 2010 update. pp now accepts a hidden discount entry
    // apply specials discount to pp price (also top, 520)
    // pp does not accept disounts so prices are adjusted for specials
//    if (prodType == "wl" && wlspl != 0) { itemPrice -= wlspl }	
//    if (prodType == "hs" && hsspl != 0) { itemPrice -= hsspl }	

    // place item into paypal item array
    ppItemArray[i] = prodType + '|' + descript + '|' + itemQty + '|' + itemPrice
	    
  }  
// ********************* end of item entry loop ***********************
  
  
  // write cart entries to screen
  document.write(whattowrite) 	
  

// ********************** set shipping rules ************************** 

  // get cookied radio button setting
  var ob = GetCookie('optBut')
  if (!ob || ob == null) { ob = 0 }
	
  // set shipping level according to cart items
  var shpQtyCount = 0; 
  if (acCount > 0) { shipLevel = 'ac'; var x = acCount / 5; shpQtyCount += parseInt(x) }
  if (hsCount > 0) { shipLevel = 'hs'; var x = hsCount / 3; shpQtyCount += parseInt(x) }
  if (wlCount > 0) { shipLevel = 'wl'; shpQtyCount += wlCount }
  
  // set shipping according to radio button and shipping level (line 385)
  // shipArray[0] pickup; [1] calgary; [2] west; [3] east
  // shipArray[4] west additional item; [5] east additional item 
  shipArray[0] = 0; shipArray[1] = 12; shipArray[4] = 1; shipArray[5] = 1
  if (shipLevel == 'ac') { shipArray[1] = 10; shipArray[2] = 10; shipArray[3] = 12 }  
  if (shipLevel == 'hs') { shipArray[2] = 13; shipArray[3] = 15 }  
  if (shipLevel == 'wl') { shipArray[2] = 13; shipArray[3] = 15 }
  
  // determine additional shipping over base rate of 1 item
  var x = parseInt(ob) + 2
  if (shpQtyCount > 1 && ob > 1) { addShip = (shpQtyCount - 1) * shipArray[x] }

  shipping = shipArray[ob] + addShip
  if (!shipping || shipLevel == 'ns') { shipping = 0 }
  shipping = parseFloat(shipping)
 
// ********************** end shipping rules ************************** 



// ******************** Record PayPal Entries *************************
  
  for (y = 1; y <= NumberOrdered; y++) {
    var ppEntry = ppItemArray[y]
    var ppArray = ppEntry.split('|')
	var ppProdType = ppArray[0]
	var ppDescript = ppArray[1]
	var ppItemQty = ppArray[2]
	var ppItemPrice = ppArray[3]
    var ppPrice = parseInt(ppItemPrice) 
    var code = 'CAD'

    // Record PayPal hidden variables
    hiddenItems += '<input type="hidden" name="item_name_' + y + '" value="' 
	            + ppDescript + '">'
                + '<input type="hidden" name="quantity_' + y + '" value="' 
				+ ppItemQty + '">'
                + '<input type="hidden" name="amount_' + y + '" value="' 
				+ ppPrice + '">'
                + '<input type="hidden" name="currency_code" value="' + code + '">'
  }

// ******************** end PayPal entry *********************


  // calc product discount for cart display (also top, 510)
  var wlDisc = 0; var hsDisc = 0  
  if (wlCount >= 1) { wlDisc = wlCount * wlspl }
  if (hsCount >= 1) { hsDisc = hsCount * hsspl }

  // *** as of jun 2009 disable all qty pricing ***
  // *** as of dec 18 product discounts tracked and displayed ***
  var discount = wlDisc + hsDisc  // was = 0
 
  // calculate insurance amount
  if (SubTotal > 199) {
    var ins = (parseInt((SubTotal - discount) / 100)) * insureRate
    insAmount = ins.toFixed(2)
    insAmount = parseFloat(insAmount)
    var cb = GetCookie('chkBox')
    if (cb == 'true' && shipping > 12) { shipping += insAmount }	
  }

  // math out all totals, gst etc.
  TOSubTotal = SubTotal + '.00'
  TODiscount = discount + '.00'
  TOShipping = shipping.toFixed(2)

  GST = (SubTotal - discount + shipping) * GSTRate
  TOGST = GST.toFixed(2)
  
  Total = SubTotal - discount + shipping + GST
  TOTotal = Total.toFixed(2)
  
  hiddenDisc = '<input type="hidden" name="discount_amount_cart" value="' 
             + TODiscount + '">'
  hiddenShip = '<input type="hidden" name="shipping_1" value="' + TOShipping + '">'
  hiddenGST = '<input type="hidden" name="tax_cart" value="' + TOGST + '">'
			 
  var txt = hiddenItems + hiddenDisc + hiddenShip + hiddenGST 
  
  document.write(txt)  // record hidden variables
} 

// ************** end of 'Display Cart...' function ******************

// --------- blink message box ---------

var count = 0; var tt
function blinkMessage() {	
  clearTimeout(tt)
  cc = document.getElementById('messageBox').style.visibility
  if (cc == 'hidden') { 
	document.getElementById('messageBox').style.visibility = 'visible'
  } else {
	document.getElementById('messageBox').style.visibility = 'hidden'
  }
  tt = setTimeout('blinkMessage()', 600)
  count += 1
  if (count >= 6) { count = 0; clearTimeout(tt) }
}

// -------------------- Submit order form to PayPal ----------------------

function submitForm() {
  // display 'paypal loading' message
  blinkMessage()
  
  document.forms.cartList.submit()
  return
}

//-->
