<!--

var submitcount=0;

function checkClicks()
{
   if (submitcount == 0)
   {
      submitcount++;
      return true;
   } else {
      return false;
   }
}

function shipToChange()
{
   if (document.checkout.shipto.checked == true)
   {
      document.checkout.s_fname.value     = document.checkout.b_fname.value;
      document.checkout.s_lname.value     = document.checkout.b_lname.value;
      document.checkout.s_org.value       = document.checkout.b_org.value;
      document.checkout.s_address_1.value = document.checkout.b_address_1.value;
      document.checkout.s_address_2.value = document.checkout.b_address_2.value;
      document.checkout.s_city.value      = document.checkout.b_city.value;
      document.checkout.s_state.value     = document.checkout.b_state.value;
      document.checkout.s_zip.value       = document.checkout.b_zip.value;
      document.checkout.s_country.value   = document.checkout.b_country.value;
      document.checkout.s_phone.value     = document.checkout.b_phone.value;
   } else {
      document.checkout.s_fname.value     = '';
      document.checkout.s_lname.value     = '';
      document.checkout.s_org.value       = '';
      document.checkout.s_address_1.value = '';
      document.checkout.s_address_2.value = '';
      document.checkout.s_city.value      = '';
      document.checkout.s_state.value     = '';
      document.checkout.s_zip.value       = '';
      document.checkout.s_country.value   = '';
      document.checkout.s_phone.value     = '';
   }
}

function clearShip()
{
   document.shipto.ship_fname.value     = '';
   document.shipto.ship_lname.value     = '';
   document.shipto.ship_org.value       = '';
   document.shipto.ship_address_1.value = '';
   document.shipto.ship_address_2.value = '';
   document.shipto.ship_city.value      = '';
   document.shipto.ship_state.value     = '';
   document.shipto.ship_zip.value       = '';
   document.shipto.ship_country.value   = '';
   document.shipto.ship_phone.value     = '';
}

function clearSubTo()
{
   if (document.subscriptions.recipient.value == 'gift')
   {
      document.subscriptions.ship_fname.value     = '';
      document.subscriptions.ship_lname.value     = '';
      document.subscriptions.ship_org.value       = '';
      document.subscriptions.ship_address_1.value = '';
      document.subscriptions.ship_address_2.value = '';
      document.subscriptions.ship_city.value      = '';
      document.subscriptions.ship_state.value     = '';
      document.subscriptions.ship_zip.value       = '';
      document.subscriptions.ship_country.value   = '';
      document.subscriptions.ship_phone.value     = '';
      document.subscriptions.ship_email.value     = '';
      document.subscriptions.sendto.value         = "new";
   } else {
      document.subscriptions.ship_fname.value     = document.subscriptions.self_fname.value;
      document.subscriptions.ship_lname.value     = document.subscriptions.self_lname.value;
      document.subscriptions.ship_org.value       = document.subscriptions.self_org.value;
      document.subscriptions.ship_address_1.value = document.subscriptions.self_address_1.value;
      document.subscriptions.ship_address_2.value = document.subscriptions.self_address_2.value;
      document.subscriptions.ship_city.value      = document.subscriptions.self_city.value;
      document.subscriptions.ship_state.value     = document.subscriptions.self_state.value;
      document.subscriptions.ship_zip.value       = document.subscriptions.self_zip.value;
      document.subscriptions.ship_country.value   = document.subscriptions.self_country.value;
      document.subscriptions.ship_phone.value     = document.subscriptions.self_phone.value;
      document.subscriptions.ship_email.value     = document.subscriptions.self_email.value;
      document.subscriptions.sendto.value         = "self";
   }
}

function textCounter(field, countfield, maxlimit)
{
   if (field.value.length > maxlimit)
   {
      field.value = field.value.substring(0, maxlimit);
   } else {
      countfield.value = maxlimit - field.value.length;
   }
}

function get_ship() {
   var $ship_id = document.getElementById('sendto').value
   script = document.createElement( 'script' );
   script.src = 'ship_to.php?ship_id='+$ship_id;
   document.getElementsByTagName( 'head' )[0].appendChild( script );
}

function get_sub_ship() {
   var $ship_id = document.getElementById('sendto').value

   if ($ship_id == 'self')
   {
      document.getElementById('ship_fname').value     = document.getElementById('self_fname').value;
      document.getElementById('ship_lname').value     = document.getElementById('self_lname').value;
      document.getElementById('ship_org').value       = document.getElementById('self_org').value;
      document.getElementById('ship_address_1').value = document.getElementById('self_address_1').value;
      document.getElementById('ship_address_2').value = document.getElementById('self_address_2').value;
      document.getElementById('ship_city').value      = document.getElementById('self_city').value;
      document.getElementById('ship_state').value     = document.getElementById('self_state').value;
      document.getElementById('ship_zip').value       = document.getElementById('self_zip').value;
      document.getElementById('ship_country').value   = document.getElementById('self_country').value;
      document.getElementById('ship_phone').value     = document.getElementById('self_phone').value;
      document.getElementById('ship_email').value     = document.getElementById('self_email').value;
      document.getElementById('recipient').value = "self";
   } else {
      script = document.createElement( 'script' );
      script.src = 'ship_to.php?ship_id='+$ship_id;
      document.getElementsByTagName( 'head' )[0].appendChild( script );
   
      document.getElementById('recipient').value = "gift";
   }
}

//-->


      