/* 
   This code creates pricing table(s) on pricing.html dynamically.
*/


function writePricing() {

    /* Draws partner specific pricing table
	
	  Read the cookie to see who the referring_partner is. Set pricing variables. 
	  the cookie 'referring_partner' is set on the homepage by parsequerystring.js which
	  parses the query string and writes the value to a cookie. The partner is provided with
	  a link or banner and link with a query string identifying them.
	*/
	
	/* 
	  eg. We might have a link or banner on the partner site such as:
	  <a href="http://www.paradata.com/vrccp/index.html?ref=ownerdirect.com_us">Sign up</a> for the Vacation Rental Credit Card Program.
	  We can then track the referring partner and set pricing on this page accordingly
	*/
    
	// grab the partner id from cookie.
	var thePartner = getCookie("referring_partner");
	
	/************************************************
	Create objects for each of the 3 pricing plans
	*************************************************/
	
	function planAObj( currencyCode, setupFee, monthlyFee, transactionFee, discountRate, setupFeeSpecial, monthlyFeeSpecial, transactionFeeSpecial, discountRateSpecial ) 
	{
		this.currencyCode = currencyCode;
		this.setupFee = setupFee;
		this.monthlyFee = monthlyFee;
		this.transactionFee = transactionFee;
		this.discountRate = discountRate;
		// special pricing that may be offered by a reseller
		this.setupFeeSpecial = setupFeeSpecial;
		this.monthlyFeeSpecial = monthlyFeeSpecial;
		this.transactionFeeSpecial = transactionFeeSpecial;
		this.discountRateSpecial = discountRateSpecial;
	}
	
	// plan B is what is shown if the reseller only has one pricing plan.
	function planBObj( currencyCode, setupFee, monthlyFee, transactionFee, discountRate, setupFeeSpecial, monthlyFeeSpecial, transactionFeeSpecial, discountRateSpecial ) 
	{
		this.currencyCode = currencyCode;
		this.setupFee = setupFee;
		this.monthlyFee = monthlyFee;
		this.transactionFee = transactionFee;
		this.discountRate = discountRate;
		// special pricing that may be offered by a reseller
		this.setupFeeSpecial = setupFeeSpecial;
		this.monthlyFeeSpecial = monthlyFeeSpecial;
		this.transactionFeeSpecial = transactionFeeSpecial;
		this.discountRateSpecial = discountRateSpecial;
	}
	
	function planCObj( currencyCode, setupFee, monthlyFee, transactionFee, discountRate, setupFeeSpecial, monthlyFeeSpecial, transactionFeeSpecial, discountRateSpecial ) 
	{
		this.currencyCode = currencyCode;
		this.setupFee = setupFee;
		this.monthlyFee = monthlyFee;
		this.transactionFee = transactionFee;
		this.discountRate = discountRate;
		// special pricing that may be offered by a reseller
		this.setupFeeSpecial = setupFeeSpecial;
		this.monthlyFeeSpecial = monthlyFeeSpecial;
		this.transactionFeeSpecial = transactionFeeSpecial;
		this.discountRateSpecial = discountRateSpecial;
	}
	
	/*****************************************************
	These variables are global. Used by all resellers
	******************************************************/
	var footnote = null; // holds a string for a footnote below each price table if their is special pricing offer
						// Which could read "Time-limited offer", or "Offer expires Jan 31/05"
	var specialInfo = null; // Holds a string for a paragraph about the offer which appears before the pricing tables.

    // multiPlans tells us whether the reseller has 1 plan or 3 plans. Default is 1 plan.
	var multiPlans = 0;
	
	var priceTable = ""; // we'll use this to concatenate html table code.
	var footnotes = ""; // paragraph and footnotes which appear below the pricing table(s)
	
	
	
	
	
	
	
    /******************************************************
	Test to see which reseller's pricing we need to display.
	var thePartner is holding the value of the partner's name, which
	was taken from the query string.
	When creating a price plan object(s) for the partner, the last four items are null values if they don't have specials.
	*******************************************************/
	

	// If one pricing plan: use PlanBObj   
	// If three pricing plans: create planAObj, planBObj, planCObj for each new reseller
	if ( thePartner == "forvacationrentalowners.com" ) { myPlanBObj = new planBObj("(USD)", "$99.00","$29.95", "$0.25", "2.59", null, null, null, null ); }
	else if( thePartner == "yourCompany.com" ) { myPlanBObj = new planBObj("(USD)", "$99.00", "$29.95", "$0.25", "2.59", null, null, null, null  ); }
	else if( thePartner == "test.com" ) { myPlanBObj = new planBObj("(USD)", "$85.00","$19.95", "$0.25", "2.49", "$75.00", "$25.00", "$0.15", "1.9"); footnote = "Offer expires Dec.31/05"; specialInfo="Save until Dec.31/05 with our special discounted Set Up Fee and Monthly Fee. $25 off on Set Up and we waive the monthly fee for 3 months if you sign up on or before December 31/05." }

	else if( thePartner == "ownerdirect.com_us" ) { myPlanBObj = new planBObj("(USD)", "$40.00","$19.95", "$0.25", "2.49", null, null, null, null ); }
	else if( thePartner == "ownerdirect.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$65.00","$22.95", "$0.20", "2.79", null, null, null, null  ); }
	else if( thePartner == "resortac.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00","$24.95", "$0.50", "3.25", null, null, null, null  ); }
	else if( thePartner == "resortac.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$99.00","$29.95", "$0.50", "3.25", null, null, null, null  ); }
	else if( thePartner == "vr800.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00","$24.95", "$0.00", "2.59", null, null, null, null  ); }



	else if( thePartner == "vac_ren.com_us" ) { 
	var multiPlans = 1; 
	myPlanAObj = new planAObj( "(USD)", "$99.00", "$19.95", "$0.25", "3.79", null, null, null, null );
	myPlanBObj = new planBObj( "(USD)", "$99.00", "$24.95", "$0.25", "2.59", null, null, null, null );
	myPlanCObj = new planCObj( "(USD)", "$99.00", "$33.95", "$0.25", "2.30", null, null, null, null );
	}
	
	// use the following as a template for those who want A, B, and C  plans.
	/*
	else if( thePartner == "next_partner.com_us" ) { 
	var multiPlans = 1; 
	myPlanAObj = new planAObj( "(USD)", "$99.00", "$19.95", "$0.25", "3.79", null, null, null, null );
	myPlanBObj = new planBObj( "(USD)", "$99.00", "$24.95", "$0.25", "2.59", null, null, null, null );
	myPlanCObj = new planCObj( "(USD)", "$99.00", "$33.95", "$0.25", "2.30", null, null, null, null );
	}
	
	else if( thePartner == "next_partner.com_ca" ) { 
	var multiPlans = 1; 
	myPlanAObj = new planAObj( "(USD)", "$99.00", "$19.95", "$0.25", "3.79", null, null, null, null );
	myPlanBObj = new planBObj( "(USD)", "$99.00", "$24.95", "$0.25", "2.59", null, null, null, null );
	myPlanCObj = new planCObj( "(USD)", "$99.00", "$33.95", "$0.25", "2.30", null, null, null, null );
	}
	*/

	else if( thePartner == "vac_ren.com_ca" ) { 
	myPlanBObj = new planBObj( "(CA)", "$99.00", "$26.95", "$0.25", "2.79", null, null, null, null );
	}
	
	else if( thePartner == "beachhouse.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00", "$29.95", "$0.25", "2.6", null, null, null, null  ); }
	else if( thePartner == "beachhouse.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$99.00", "$29.95", "$0.25", "2.8", null, null, null, null  ); }
	else if( thePartner == "gfrentals.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00", "$29.95", "$0.25", "2.6", null, null, null, null  ); }
	else if( thePartner == "gfrentals.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$99.00", "$29.95", "$0.25", "2.8", null, null, null, null  ); }
    else if( thePartner == "destvillas.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00", "$24.95", "$0.25", "2.59", "$0", null, null, null  ); footnote="Set up fee waiver is an introductory offer that could expire at any time." }
	else if( thePartner == "destvillas.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$99.00", "$29.85", "$0.25", "2.59", "$0", null, null, null  ); footnote="Set up fee waiver is an introductory offer that could expire at any time." }
	else if( thePartner == "villa4vac.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00", "$29.95", "$0.25", "2.60", null, null, null, null  ); }
	else if( thePartner == "villa4vac.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$99.00", "$29.95", "$0.25", "2.80", null, null, null, null  ); }

	// this partner only has CDN pricing
	else if( thePartner == "vacren411.com_us" ) { myPlanBObj = new planBObj("(US)", "$99.00", "$19.95", "$0.25", "2.90", "$0", null, null, null  ); footnote="Set up is free!" }

	
	/* Use this as a template for partners who only have plan B pricing.
	else if( thePartner == "nextpartner.com_us" ) { myPlanBObj = new planBObj("(USD)", "$99.00", "$29.95", "$0.25", "2.6", null, null, null, null  ); }
	else if( thePartner == "nextpartner.com_ca" ) { myPlanBObj = new planBObj("(CA)", "$99.00", "$29.95", "$0.25", "2.8", null, null, null, null  ); }
    */
	
	
	// if the query string does not contain a partner name, then display default pricing. The visitor has come from the web
	// or someone has tried to manipulate the query string. In that case, we show PSI pricing.
	
	else { myPlanBObj = new planBObj("(USD)", "$99.00", "$29.95", "$0.25", "2.59", null, null, null, null  ); }
	
	
	
	
	

    /*************************************************************
	Write pricing table for those who have ONLY ONE PLAN plan: Plan B
	**************************************************************/
	if( multiPlans == 0 )
	{
			if( specialInfo != null ) {
				document.write("<div style='padding-left:20px'><img src='../images/specialoffer.gif'></div><p style='margin-bottom:20px;'>" +specialInfo+"</p>")
				}
				
			// concatenate fancy pricing table
			priceTable += '<table width="185" border="0" align="center" cellpadding="0" cellspacing="0">'
			priceTable += '<tr><td colspan="3" style="background-color:#f7f7f6"><img src="../images/pricingbox_top.gif" alt="Pricing" title="Pricing" width="185" height="40"></td></tr>'
			priceTable += '<tr><td style="background-image:url(../images/plan_box_l.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_l.gif" width="6" height="162" alt=""></td>'
			
			if( myPlanBObj.setupFeeSpecial == null )
			{   
				// display regular set up fee.
				priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight">' +myPlanBObj.setupFee+ '</strong> ' +myPlanBObj.currencyCode+ '</span></td>'
			}
			else
			{   
				// display set fee special price
				priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strike>' +myPlanBObj.setupFee+ '</strike><strong class="highlight"> ' +myPlanBObj.setupFeeSpecial+ '</strong> ' +myPlanBObj.currencyCode+ '</span></td>'
			}
			priceTable += '<td style="background-image:url(../images/plan_box_r.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_r.gif" alt="" width="6" height="162"></td></tr>'
			priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
		  
			if( myPlanBObj.monthlyFeeSpecial == null )
			{ 	
				// display regular monthly fee
				priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight">' +myPlanBObj.monthlyFee+ '</strong> ' +myPlanBObj.currencyCode+ '</span></td></tr>'
			}
			else
			{   
				// display special monthly fee
				priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strike>' +myPlanBObj.monthlyFee+ '</strike> <strong class="highlight">' +myPlanBObj.monthlyFeeSpecial+ '</strong> ' +myPlanBObj.currencyCode+ '</span></td></tr>'
			}
			
			priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
			
			if( myPlanBObj.discountRateSpecial == null )
			{
				// display regular discount rate
				priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight">' +myPlanBObj.discountRate+ '% </strong> <sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
			}
			else
			{
				// display special discount rate
				priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strike>' +myPlanBObj.discountRate+ '%</strike> <strong class="highlight">' +myPlanBObj.discountRateSpecial+ '%</strong> <sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
			}
		
			priceTable += '<tr><td style="background-color:#f7f7f6" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
			priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><a href="https://www.paygateway.com/express_app/vrppgen_signup.html?ref=' +thePartner+ '">'
			priceTable += '<img src="../images/signup_sm.gif" alt="Apply now" width="96" height="34" border="0" title="Apply now"></a></td></tr>'
			priceTable += '<tr><td style="background-color:#f7f7f6" colspan="3"><img src="../images/plan_box_bot.gif" width="185" height="9" alt=""></td></tr>'
			
			if( footnote != null )
			{
			   // display footnote in last row of table
			   priceTable += '<tr><td style="background-color:transparent" colspan="3" align="center"><p style="font-size:10px; margin:0px;"><em>' +footnote+ '</em></p></td></tr>'
		
			}
			priceTable += "</table>"
			
			
			
			footnotes += '<p><strong>Each price plan is subject to</strong>:</p>'
			footnotes += '<ul>';
			
			if( myPlanBObj.setupFeeSpecial == null )
			{
				footnotes += '<li>One-Time Set Up Fee: ' +myPlanBObj.setupFee+ ' ' +myPlanBObj.currencyCode+ '</li>'
			}
			else
			{
				footnotes += '<li>One-Time Set Up Fee: ' +myPlanBObj.setupFeeSpecial+ ' ' +myPlanBObj.currencyCode+ '</li>'
			}
		
			
			footnotes += '<li>Transaction Fees: ' +myPlanBObj.transactionFee+ ' ' +myPlanBObj.currencyCode+ '</li>'
		
		
			footnotes += '<li>Monthly Minimum: $0.00 ' +myPlanBObj.currencyCode+ '</li>'
			footnotes += '</ul>'
			footnotes += '<ol class="footnote">';
			
			if(myPlanBObj.setupFeeSpecial == null)
			{
				footnotes += '<li><a name="footnote1"></a>The ' +myPlanBObj.setupFee+ ' set up fee is not an application fee. This fee will not be charged until your merchant account has been approved.<br><br></li>'
			}
			else
			{
				footnotes += '<li><a name="footnote1"></a>The ' +myPlanBObj.setupFeeSpecial+ ' set up fee is not an application fee. This fee will not be charged until your merchant account has been approved.<br><br></li>'
			}
			
			footnotes += '<li><a name="footnote2"></a> <a name="footnote3"></a>The <em>discount rate</em> is the percentage of a transaction total charged to you for processing that transaction.<br>'
			if( myPlanBObj.discountRateSpecial == null )
			{
			   footnotes +=  '<br>Example: if a transaction of $100 is processed, you are charged ' +myPlanBObj.discountRate+ '% ($' +myPlanBObj.discountRate+ ') for that transaction.<br><br></li>'
			}
			else
			{
			   footnotes +=  '<br>Example: if a transaction of $100 is processed, you are charged ' +myPlanBObj.discountRateSpecial+ '% ($' +myPlanBObj.discountRateSpecial+ ') for that transaction.<br><br></li>'
			}
			footnotes += '<li>Discount rate applies to qualified transactions. Non-qualified and purchase card transactions are subject to additional charges of between 1% to 1.5%.<br></li></ol>'
		
	} // end writing table for those with only one plan: Plan B
	
	else
	{
		    /*************************************************************
			Write pricing table for those who have 3 PRICING PLANS: PLAN A, PLAN B, PLAN C.
			**************************************************************/
	
		    /****************************************************
			the reseller has 3 pricing plans: Plan A, B, and C. Each plan is in a table.
			There's an outer table to holds the 3 pricing tables.
			The outer table has 5 cols that work as shown below:

			<table>
			    <tr>
				   <td><table>Plan A pricing table. A bunch of cells and images and text etc.</table></td>
				   <td>Just a column divider</td>
				   <td><table>Plan B pricing table. A bunch of cells and images and text etc.</table></td>
				   <td>Just a column divider</td>
				   <td><table>Plan C pricing table. A bunch of cells and images and text etc.</table></td>
				</tr>
			</table>
			****************************************************/
			

			/**********
			 Plan A Table
			***********/
			  priceTable += "<table align='center' border='0'>";
			  priceTable += "<tr>";
			  priceTable += "<td>";
			  
						if( specialInfo != null ) {
							document.write("<h2><strong>Special</strong></h2><p style='color:#cc0000'><strong>" +specialInfo+"</strong></p>")
							}
							
						// concatenate fancy pricing table for Plan A
						priceTable += '<table width="185" border="0" align="center" cellpadding="0" cellspacing="0">'
						priceTable += '<tr><td colspan="3" style="background-color:#f7f7f6"><img src="../images/plan_a_top.gif" alt="Plan A Pricing" title="Plan A Pricing" width="185" height="57"></td></tr>'
						priceTable += '<tr><td style="background-image:url(../images/plan_box_l.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_l.gif" width="6" height="162" alt=""></td>'
						
						if( myPlanAObj.setupFeeSpecial == null)
						{   
							// display regular set up fee.
							priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight">' +myPlanAObj.setupFee+ '</strong> ' +myPlanAObj.currencyCode+ '</span></td>'
						}
						else
						{   
							// display set fee special price
							priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight"><strike>' +myPlanAObj.setupFee+ '</strike></strong> ' +myPlanAObj.setupFeeSpecial+ ' ' +myPlanAObj.currencyCode+ '</span></td>'
						}
						priceTable += '<td style="background-image:url(../images/plan_box_r.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_r.gif" alt="" width="6" height="162"></td></tr>'
						priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
					  
						if( myPlanAObj.monthlyFeeSpecial == null )
						{ 	
							// display regular monthly fee
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight">' +myPlanAObj.monthlyFee+ '</strong> ' +myPlanAObj.currencyCode+ '</span></td></tr>'
						}
						else
						{   
							// display special monthly fee
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight"><strike>' +myPlanAObj.monthlyFee+ '</strike></strong> ' +myPlanAObj.monthlyFeeSpecial+ ' ' +myPlanAObj.currencyCode+ '</span></td></tr>'
						}
						
						priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
						if( myPlanAObj.discountRateSpecial == null )
						{
							// display regular discount rate
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight">' +myPlanAObj.discountRate+ '% </strong> <sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
						}
						else
						{
							// display special discount rate
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight"><strike>' +myPlanAObj.discountRate+ '%</strike></strong> ' +myPlanAObj.discountRateSpecial+ '%<sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
						}
					
						priceTable += '<tr><td style="background-color:#f7f7f6" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
						priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><a href="https://www.paygateway.com/express_app/vrppgen_signup.html?ref=' +thePartner+ '">'
						priceTable += '<img src="../images/signup_sm.gif" alt="Apply now" width="96" height="34" border="0" title="Apply now"></a></td></tr>'
						priceTable += '<tr><td style="background-color:#f7f7f6" colspan="3"><img src="../images/plan_box_bot.gif" width="185" height="9" alt=""></td></tr>'
						
						if( footnote != null )
						{
						   // display footnote in last row of table
						   priceTable += '<tr><td style="background-color:transparent" colspan="3" align="center"><p style="font-size:10px; margin:0px;"><em>' +footnote+ '</em></p></td></tr>'
					
						}
						priceTable += "</table>"
                 priceTable += "</td>";
				 
				 priceTable += "<td>&nbsp;</td>";
			

			/**********
			 Plan B Table
			***********/
			priceTable += "<td>";
			
						if( specialInfo != null ) {
							document.write("<h2><strong>Special</strong></h2><p style='color:#cc0000'><strong>" +specialInfo+"</strong></p>")
							}
							
						// concatenate fancy pricing table for Plan B
						priceTable += '<table width="185" border="0" align="center" cellpadding="0" cellspacing="0">'
						priceTable += '<tr><td colspan="3" style="background-color:#f7f7f6"><img src="../images/plan_b_top.gif" alt="Plan B Pricing" title="Plan B Pricing" width="185" height="57"></td></tr>'
						priceTable += '<tr><td style="background-image:url(../images/plan_box_l.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_l.gif" width="6" height="162" alt=""></td>'
						
						if( myPlanBObj.setupFeeSpecial == null )
						{  
							// display regular set up fee.
							priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight">' +myPlanBObj.setupFee+ '</strong> ' +myPlanBObj.currencyCode+ '</span></td>'
						}
						else
						{   
							// display set fee special price
							priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight"><strike>' +myPlanBObj.setupFee+ '</strike></strong> ' +myPlanBObj.setupFeeSpecial+ ' ' +myPlanBObj.currencyCode+ '</span></td>'
						}
						priceTable += '<td style="background-image:url(../images/plan_box_r.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_r.gif" alt="" width="6" height="162"></td></tr>'
						priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
					  
						if( myPlanBObj.monthlyFeeSpecial == null )
						{ 	
							// display regular monthly fee
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight">' +myPlanBObj.monthlyFee+ '</strong> ' +myPlanBObj.currencyCode+ '</span></td></tr>'
						}
						else
						{   
							// display special monthly fee
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight"><strike>' +myPlanBObj.monthlyFee+ '</strike></strong> ' +myPlanBObj.monthlyFeeSpecial+ ' ' +myPlanBObj.currencyCode+ '</span></td></tr>'
						}
						
						priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
						if( myPlanBObj.discountRateSpecial == null )
						{
							// display regular discount rate
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight">' +myPlanBObj.discountRate+ '% </strong> <sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
						}
						else
						{
							// display special discount rate
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight"><strike>' +myPlanBObj.discountRate+ '%</strike></strong> ' +myPlanBObj.discountRateSpecial+ '%<sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
						}
					
						priceTable += '<tr><td style="background-color:#f7f7f6" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
						priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><a href="https://www.paygateway.com/express_app/vrppgen_signup.html?ref=' +thePartner+ '">'
						priceTable += '<img src="../images/signup_sm.gif" alt="Apply now" width="96" height="34" border="0" title="Apply now"></a></td></tr>'
						priceTable += '<tr><td style="background-color:#f7f7f6" colspan="3"><img src="../images/plan_box_bot.gif" width="185" height="9" alt=""></td></tr>'
						
						if( footnote != null )
						{
						   // display footnote in last row of table
						   priceTable += '<tr><td style="background-color:transparent" colspan="3" align="center"><p style="font-size:10px; margin:0px;"><em>' +footnote+ '</em></p></td></tr>'
					
						}
						priceTable += "</table>";
           priceTable += "</td>";
		   priceTable += "<td>&nbsp;</td>";
			
			


			/**********
			 Plan C Table
			***********/
			priceTable += "<td>";
						if( specialInfo != null ) {
							document.write("<h2><strong>Special</strong></h2><p style='color:#cc0000'><strong>" +specialInfo+"</strong></p>")
							}
							
						// concatenate fancy pricing table for Plan C
						priceTable += '<table width="185" border="0" align="center" cellpadding="0" cellspacing="0">'
						priceTable += '<tr><td colspan="3" style="background-color:#f7f7f6"><img src="../images/plan_c_top.gif" alt="Plan C Pricing" title="Plan C Pricing" width="185" height="57"></td></tr>'
						priceTable += '<tr><td style="background-image:url(../images/plan_box_l.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_l.gif" width="6" height="162" alt=""></td>'
						
						if( myPlanCObj.setupFeeSpecial == null )
						{   
							// display regular set up fee.
							priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight">' +myPlanCObj.setupFee+ '</strong> ' +myPlanCObj.currencyCode+ '</span></td>'
						}
						else
						{   
							// display set fee special price
							priceTable += '<td width="173" height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">One-time Set Up Fee&nbsp;<sup><a href="#footnote1" class="main">1</a></sup><br><strong class="highlight"><strike>' +myPlanCObj.setupFee+ '</strike></strong> ' +myPlanCObj.setupFeeSpecial+ ' ' +myPlanCObj.currencyCode+ '</span></td>'
						}
						priceTable += '<td style="background-image:url(../images/plan_box_r.gif);" width="6" rowspan="7" valign="top"><img src="../images/plan_box_r.gif" alt="" width="6" height="162"></td></tr>'
						priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
					  
						if( myPlanCObj.monthlyFeeSpecial == null )
						{ 	
							// display regular monthly fee
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight">' +myPlanCObj.monthlyFee+ '</strong> ' +myPlanCObj.currencyCode+ '</span></td></tr>'
						}
						else
						{   
							// display special monthly fee
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Monthly Fee<br><strong class="highlight"><strike>' +myPlanCObj.monthlyFee+ '</strike></strong> ' +myPlanCObj.monthlyFeeSpecial+ ' ' +myPlanCObj.currencyCode+ '</span></td></tr>'
						}
						
						priceTable += '<tr><td style="background-color:#f7f7f6" height="2" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
						if( myPlanCObj.discountRateSpecial == null )
						{
							// display regular discount rate
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight">' +myPlanCObj.discountRate+ '% </strong> <sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
						}
						else
						{
							// display special discount rate
							priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><span class="planBoxText">Discount Rate&nbsp;<sup><a href="#footnote2" class="main">2</a></sup><br><strong class="highlight"><strike>' +myPlanCObj.discountRate+ '%</strike></strong> ' +myPlanCObj.discountRateSpecial+ '%<sup><a href="#footnote3" class="main">3</a></sup></span></td></tr>'
						}
					
						priceTable += '<tr><td style="background-color:#f7f7f6" align="center" valign="top"><img src="../images/priceplan_hr.gif" width="145" height="2" alt=""></td></tr>'
						priceTable += '<tr><td height="45" align="center" style="background-color:#f7f7f6"><a href="https://www.paygateway.com/express_app/vrppgen_signup.html?ref=' +thePartner+ '">'
						priceTable += '<img src="../images/signup_sm.gif" alt="Apply now" width="96" height="34" border="0" title="Apply now"></a></td></tr>'
						priceTable += '<tr><td style="background-color:#f7f7f6" colspan="3"><img src="../images/plan_box_bot.gif" width="185" height="9" alt=""></td></tr>'
						
						if( footnote != null )
						{
						   // display footnote in last row of table
						   priceTable += '<tr><td style="background-color:transparent" colspan="3" align="center"><p style="font-size:10px; margin:0px;"><em>' +footnote+ '</em></p></td></tr>'
					
						}
						priceTable += "</table>"			
						
			priceTable += "</td>";
			priceTable += "</tr>";
			priceTable += "</table>";
			// end outer table which holds 3 pricing tables.
			
			
			
			
            footnotes += '<p><strong>Each price plan is subject to</strong>:</p>'
			footnotes += '<ul>';
			footnotes += '<li>One-Time Set Up Fee</li>';
			footnotes += '<li>Transaction Fees:' +myPlanAObj.transactionFee+ '</li>';
			footnotes += '<li>Monthly Minimum: $0.00 ' +myPlanAObj.currencyCode+ '</li>'
			footnotes += '</ul>'
			footnotes += '<ol class="footnote">';
			footnotes += '<li><a name="footnote1"></a>The set up fee is not an application fee. This fee will not be charged until your merchant account has been approved.<br><br></li>'
			footnotes += '<li><a name="footnote2"></a> <a name="footnote3"></a>The <em>discount rate</em> is the percentage of a transaction total charged to you for processing that transaction.<br>'
			footnotes +=  '<br>Example: if a transaction of $100 is processed and the discount rate is 3.99%,  you are charged $3.99 for that transaction.<br><br></li>'
			footnotes += '<li>Discount rate applies to qualified transactions. Non-qualified and purchase card transactions are subject to additional charges of between 1% to 1.5%.<br></li></ol>'

			
	}
	

// write the pricing table(s)
document.write(priceTable + footnotes);
}