
function Checkout(InvoiceNum, Amount, Description, FirstName, LastName, Company, Address, City, State, Zip, Phone, Fax,  Email, Recurring)
{
  var   loginID         = "377GMZrzM";
  var   transactionKey  = "823f8Rn26GCm35Jx";
  var   label		= "Submit Payment";
  var	testMode	= "false";
  
// By default, this sample code is designed to post to our test server for
// developer accounts: https://test.authorize.net/gateway/transact.dll
// for real accounts (even in test mode), please make sure that you are
// posting to: https://secure.authorize.net/gateway/transact.dll
  var   url				= "https://secure.authorize.net/gateway/transact.dll";

// an invoice is generated using the date and time
  var MyDate = new Date();
  
  var invoice = InvoiceNum;
  if (InvoiceNum.toString().length == 0)
  {
    invoice   = MyDate.getFullYear() + (MyDate.getMonth() + 1) + MyDate.getDate() + MyDate.getHours() + MyDate.getMinutes() + MyDate.getSeconds();  
  }
  
// a sequence number is randomly generated
  var   sequence        = Math.floor(Math.random()* 1000)

// a time stamp is generated (using a function from simlib.asp)
  var   timeStamp       = simTimeStamp();

// a fingerprint is generated using the functions from simlib.asp and md5.asp
  var   fingerprint     = HMAC (transactionKey, loginID + "^" + sequence + "^" + timeStamp + "^" + Amount + "^");

// Create the HTML form containing necessary SIM post values
  var MyForm  = "<FORM id='dynForm' method='post' action='" + url + "' >";
    MyForm += "     <INPUT type='hidden' name='x_login' value='" + loginID + "' />";
    MyForm += "     <INPUT type='hidden' name='x_first_name' value='" + FirstName + "' />";
    MyForm += "     <INPUT type='hidden' name='x_last_name' value='" + LastName + "' />";
    MyForm += "     <INPUT type='hidden' name='x_company' value='" + Company + "' />";     
    MyForm += "     <INPUT type='hidden' name='x_address' value='" + Address + "' />"; 
    MyForm += "     <INPUT type='hidden' name='x_city' value='" + City + "' />"; 
    MyForm += "     <INPUT type='hidden' name='x_state' value='" + State + "' />"; 
    MyForm += "     <INPUT type='hidden' name='x_zip' value='" + Zip + "' />"; 
    MyForm += "     <INPUT type='hidden' name='x_phone' value='" + Phone + "' />"; 
    MyForm += "     <INPUT type='hidden' name='x_fax' value='" + Fax+ "' />"; 
    MyForm += "     <INPUT type='hidden' name='x_email' value='" + Email + "' />"; 
    MyForm += "	    <INPUT type='hidden' name='x_amount' value='" + Amount + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_description' value='" + Description + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_invoice_num' value='" + invoice + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_fp_sequence' value='" + sequence + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_fp_timestamp' value='" + timeStamp + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_fp_hash' value='" + fingerprint + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_test_request' value='" + testMode + "' />";
    MyForm += "	    <INPUT type='hidden' name='x_show_form' value='PAYMENT_FORM' />";    
//    MyForm += "	    <input type='submit' value='" + label + "' />";
    MyForm += "</FORM>";    
    
    document.body.innerHTML += MyForm;
    document.getElementById("dynForm").submit();

}

