<!--

// setBorderColor
function setBorderColor(divID,divColor) {
  if( document.getElementById ) {
	divref = document.getElementById(divID);
	divref.style.borderColor = divColor;
  } else {
    alert('This browser does not support div properties'); 
  }
} // end setBorderColor

// setSelectedColor
function setSelectedColor(divID,colorID,divColor,divImage) {

  if( document.getElementById ) {
	divref    = document.getElementById(divID);
	searchref = document.getElementById('color_id');
	searchref.value = colorID;
     if (divImage == undefined) {
	divref.style.backgroundImage = "url(/images/trans.gif)";
	divref.style.backgroundColor = divColor;
     } else {
	divref.style.backgroundImage = "url("+divImage+")";
     }
  } else {
    alert('This browser does not support div properties'); 
  }

} // end setSelectedColor

// PopUp
function popUpWindow(URL) {

window.open(URL,"popup");
} // end PopUpWindow


// confirmSubmission
function confirmSubmission() {

var message = 'Are you sure you wish to delete this item?';
var agree = confirm(message);
  if (agree) {
     return true;
  } else {
     return false;
  }
} // end confirmSubmission

// this function gets the cookie, if it exists
function Get_Cookie( name ) {
	
var start = document.cookie.indexOf( name + "=" );
var len = start + name.length + 1;
if ( ( !start ) &&
( name != document.cookie.substring( 0, name.length ) ) )
{
return null;
}
if ( start == -1 ) return null;
var end = document.cookie.indexOf( ";", len );
if ( end == -1 ) end = document.cookie.length;
return unescape( document.cookie.substring( len, end ) );
}

// Delete login cookie
function Delete_Cookies() {
document.cookie = "UID=" + ";path=/;" + "expires=Thu, 01-Jan-1970 00:00:01 GMT";
}

// Verify input
function verifyCart() {

numbreaks = window.document.cart.pricebreak.length;
radiochecked = false;

if (numbreaks == undefined) {
    numbreaks = 0;
    radiochecked = true;
}

for (i = 0; i < numbreaks; i++) {
  if (window.document.cart.pricebreak[i].checked == true) {
      radiochecked = true;
  }
}

if (!radiochecked) {
    alert('Please select a price level');
    return false;
}

if (window.document.cart.quantity.value == false) {
    alert('Please enter a Quantity');
    return false;
}

} // end Verify function

// Verify shipping
function verifyShipping() {

numshipping = window.document.cart.shipping.length;
radiochecked = false;

for (i = 0; i < numshipping; i++) {
  if (window.document.cart.shipping[i].checked == true) {
      radiochecked = true;
  }
}

if (!radiochecked) {
    alert('Please select a shipping destination for your shopping cart');
    return false;
}

} // end Verify function

// Update cart on change of region
function doUpdate() {

document.cart.submit();

return false;

} // end Update function


// Update cart on change of additional shipping options
function doUpdateOptions(clicked) {

// The couriered option was clicked
if (clicked) {
   if (typeof(window.document.cart.recorded) != "undefined") { 
     window.document.cart.recorded.checked  = false;
   }
} else { 
   if (typeof(window.document.cart.couriered) != "undefined") { 
     window.document.cart.couriered.checked = false;
   }
}

document.cart.submit();

return false;

} // end Update function

//-->

