function initForm(form) {}
	
<!-- Begin
function toRobe(form) {
	if (document.form1.R_Robe_Size.selectedIndex == 0 )
	{
		
		document.form1.R_Robe_Size.focus();
	}
}
//  End -->

<!-- Begin
function toShipChoice(form) {
	if (document.form1.R_Shipping_Choice.selectedIndex == 0 )
	{
		
		document.form1.R_Shipping_Choice.focus();
	}
}
//  End -->

<!-- Begin
function toCard(form) {
	if (document.form1.R_Card_Amount.value == " " || document.form1.R_Card_Amount.value < 25)
	{
		alert ( "Gift Card Amount must be at least 25." );
		document.form1.R_Card_Amount.focus();
	}
	return true;
}
//  End -->



<!-- Begin
function toCardType(form) {
		document.form1.R_Credit_Card_Type.focus();

}
function toCardMonth(form) {
		document.form1.R_Credit_Card_Exp_Month.focus();

}
function toCardYear(form) {
		document.form1.R_Credit_Card_Exp_Year.focus();

}

//  End -->

function validate_robe (form)
{
    valid = true;

     if (document.form1.R_Robe_Size.selectedIndex == 0 )
    {
        alert ( "Please Select the Robe Size." );
		document.form1.R_Robe_Size.focus();
        valid = false;
    }
	
	    return valid;
}

function validate_CardType (form)
{
    valid = true;
	
	if (document.form1.R_Credit_Card_Type.selectedIndex == 0 )
    {
        alert ( "Please Select the Credit Card Type." );
		document.form1.R_Credit_Card_Type.focus();
        valid = false;
    }
	    return valid;
}

function validate_ExpMonth (form)
{
    valid = true;
	
	if (document.form1.R_Credit_Card_Exp_Month.selectedIndex == 0 )
    {
        alert ( "Please Select an Expiration Month." );
		document.form1.R_Credit_Card_Exp_Month.focus();
        valid = false;
    }
	    return valid;
}

function validate_ExpYear (form)
{
    valid = true;
	
	if (document.form1.R_Credit_Card_Exp_Year.selectedIndex == 0 )
    {
        alert ( "Please Select the Expiration Year." );
		document.form1.R_Credit_Card_Exp_Year.focus();
        valid = false;
    }

    return valid;
}

function validate_Ship (form)
{
    valid = true;
	
	if (document.form1.R_Shipping_Choice.selectedIndex == 0 )
    {
        alert ( "Please Select Your Preference for Shipping." );
		document.form1.R_Shipping_Choice.focus();
        valid = false;
    }

    return valid;
}

//-->
function checkcheckbox(form){
     if (document.form1.R_Ship_To1.checked == false &&
         document.form1.R_Ship_To2.checked == false) 
	 {
	  alert("Please Select the Address to Ship To.\n");
	 	return false;
     }
	 
	 if (document.form1.R_Ship_To1.checked == true &&
         document.form1.R_Ship_To2.checked == false) 
	 {
	 	return true;
     }
	 
	 if (document.form1.R_Ship_To1.checked == false &&
         document.form1.R_Ship_To2.checked == true) 
	 {
	 	return true;
     }
	 
	 if (document.form1.R_Ship_To1.checked == true &&
         document.form1.R_Ship_To2.checked == true) 
	 {
	  alert("Please Select ONLY ONE Address to Ship To.\n");
	 	return false;
     }
}



<!--


function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_validateForm() { //v4.0



  var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
	
    if (val) { nm=val.name; if ((val=val.value)!="") {
	  
      if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
        if (p<1 || p==(val.length-1)) errors+='- '+(nm.replace(new RegExp(/R_/g), ""))+' must contain an e-mail address.\n';
      } else if (test!='R') { num = parseFloat(val);
        if (isNaN(val)) errors+='- '+(nm.replace(new RegExp(/R_/g), ""))+' must contain a number.\n';
        if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
          min=test.substring(8,p); max=test.substring(p+1);
          if (num<min || max<num) errors+='- '+(nm.replace(new RegExp(/R_/g), ""))+' must contain a number between '+min+' and '+max+'.\n';
    } } } else if (test.charAt(0) == 'R') errors += '- '+(nm.replace(new RegExp(/R_/g), ""))+' is required.\n'; }
	
	 
  } if (errors) alert('The following error(s) occurred:\n'+errors);
  document.MM_returnValue = (errors == '');
 
}
//-->

	
function autoLoadShopperInfo(form) {
	document.form1.R_Recipient_First_Name.value = document.form1.R_Purchaser_First_Name.value;
	document.form1.R_Recipient_Last_Name.value = document.form1.R_Purchaser_Last_Name.value;
	document.form1.R_Recipient_Street.value = document.form1.R_Purchaser_Street.value;
	document.form1.R_Recipient_City.value = document.form1.R_Purchaser_City.value;
	document.form1.R_Recipient_State.value = document.form1.R_Purchaser_State.value;
	document.form1.R_Recipient_Zip.value = document.form1.R_Purchaser_Zip.value;
	document.form1.R_Recipient_Phone.value = document.form1.R_Purchaser_Phone.value;
	document.form1.R_Recipient_First_Name.focus();
	
}


function formatCurrency(num) {
num = num.toString().replace(/\$|\,/g,'');
if(isNaN(num))
num = "0";
sign = (num == (num = Math.abs(num)));
num = Math.floor(num*100+0.50000000001);
cents = num%100;
num = Math.floor(num/100).toString();
if(cents<10)
cents = "0" + cents;
for (var i = 0; i < Math.floor((num.length-(1+i))/3); i++)
num = num.substring(0,num.length-(4*i+3))+','+
num.substring(num.length-(4*i+3));
return (num + '.' + cents);
}

var prefix="$"

function calcTotal(form) {
	var CardAmt = document.form1.R_Card_Amount
	var value = document.form1.R_Card_Amount.value;
	var tmp = parseFloat(value);
		if (tmp < 25) {
			alert("Gift Card Amount must be at least $25."); 
			CardAmt.focus()
			return(false);
		}
	gTotal=tmp+parseFloat(document.form1.R_Shipping_Choice.value);
	document.form1.R_Grand_Total.value = prefix + " " + (toDouble(gTotal));
}

function toDouble(num)
   {

   // roll the number up or down to 2 decimal places
      num = Math.round(num * 100);	
      num = parseFloat(num / 100);

   // if the number is an integer add the zero cents and return
      if( num == parseInt(num) )	
         return(num + ".00");

   // see if the number is missing one trailing zero
      if((num * 10) == parseInt(num * 10))
         return(num + "0");

   // if the number got this far, it has two decimal places, 
   // so just return it
      return(num);

   } //  close the toDouble function

function handleEnter (field, event) {
		var keyCode = event.keyCode ? event.keyCode : event.which ? event.which : event.charCode;
		if (keyCode == 13) {
			var i;
			for (i = 0; i < field.form.elements.length; i++)
				if (field == field.form.elements[i])
					break;
			i = (i + 1) % field.form.elements.length;
			field.form.elements[i].focus();
			return false;
		} 
		else
		return true;
}      

