//Some basic info about the store used by cookie.js for saving cookies var cart_cookie_name = "tnt_cart"; //Non-inline frame cart requires these to be set var cart_count = 0; var basket = ""; //Set the store tracker cookie var expdate = new Date(); FixCookieDate(expdate); //fix date for Macs expdate.setTime(expdate.getTime() + (24 * 60 * 60 * 1000)); //24 hours from now SetCookie("gs_st","38.107.179.220-1337218999",expdate,"/","trackntrade.com",false); //build the pid objects //basic info will be need to display on the form var pid_list = new Array; //This keeps track of the type of subs we have //This way we can turn on and off certain type of subscription services var sub_type_pids = new Array; //Used to keep subscriptions and non-subs organized var ptype = new Array(2); // For beta.trackntrade.com we are going to send back what needs to be printed rather than print var form = ''; function formBuilder() { // clear any existing form contents form = ''; //No one loaded storetracker with any products if(pid_list.length == 0){ alert("No Product Ids were loaded in Store Tracker to build a form with. Cannot build the form"); return(false); //They are trying to build a form without any products/services } else if(arguments.length == 0){ alert("No Product Ids were passed in to build a form with. Cannot build the form"); return(false); } //This is for the two type of forms we have to build //Non-Sub are not categorized by type... very simple //Sub forms have groups and service types ptype[0] = new Array; //Non-Sub ptype[1] = new Array; //Sub //begin writing the basic stuff for the form form += "
"; form += "
"; form += ""; form += ""; //If only 1 product is passed in, we do a simply "Add to Cart" button add form if(arguments.length == 1 && (pid_list[arguments[0]].is_sub == 0 || (pid_list[arguments[0]].is_sub == 1 && pid_list[arguments[0]].rates.length == 1))){ writePid(loadPid(arguments[0]),"hidden"); //Otherwise, we use checkboxes along with the "Add to Cart" button } else { //Sort out the non-subs from the subs for(var a=0; a"; if((ptype[0].length + ptype[1].length) > 1) form += ""+d.name+"

"; form += "
"; //This keeps the name and the prices in line //otherwise, a checkbox may cause them to not line up as nice var tab = ""; if(!pid_form_type.match(/hidden/g)) tab = "     "; //If there is a savings to promote... do it! if(d.savings > 0) form += "
"+tab+"Regularly $"+d.msrp+" Save $"+d.savings+"
"; //Finally show then the final price... rock bottom prices everyday :) form += "
"+tab+"Only $"+d.price+"

"; } //Ok this one is fun... function writeSubs(list) { //list should be an array of service pids... //This array keeps each type of services separate... ie Futures is not the same as Options //likewise newsletters are not the same as data services //since you have a futures and options service and since all form fields are named 'pid'... this causes problems //because in a radio button world, you can only have one unless you use separate forms or separate form field names //we could use check boxes... but would be misleading... can I really have a monthly and an annual at once? //yah, yah, yah... we can control selecting both, but radio buttons are a better fit. //we will use separate form field names based on type and then put the into the correct names during submission //loop through all of the services we have for(var i=0; i 1 && d.pid != 244) { form += ""; } else { // we are using sub_id later to determine that it's a sub service form instead of regular product form // so we make sure we still have it form += ""; } form += d.name; if (d.parans != '') form += "
"+d.parans; form += ""; form += ""; form += ""; //if the service matches the type... then show it. for(var r=0; r"; form += ""; form += ""; form += ""; //This keeps an idex of where all services are for the type //this way when we want to turn on only the Futures services... we now to turn on pid_1[0] - pid_1[2] and so forth // sub_type_pids[t].push(found); // found++; } form += "
Billing CycleMonthly AverageSavings
"+rate.name+"$"+rate.mon_rate+""; if(rate.true_savings > 0) { form += "$" + rate.true_savings; form += " [" + rate.months_free + " month(s) FREE!]"; } form += "

"; // 8-4-2010 ... determined to list free forex term (with active account) with the auto-renew terms if (d.pid == 244) { form += "

*To Qualify for Free Data:

"; form += "
  1. Open a real money trading account, within 30 days from the date of purchase, with FXCM, through Gecko Financial Services, and fund it with a minimum of $1,000. To get started, click here.
  2. "; form += "
  3. Place at least one trade per month to be considered an Active Trader.

"; form += "

Already have an FXCM account? Email info@geckofs.com to see if your current account qualifies for the Active Trader program.

"; break; } } //Show the man how much he is spending for all of his services... especially how much he is saving //document.writeln("

Service Total: $

"); } //This allows us to turn on and off all of the services for a given service type. function enableSubs(form,sub_type) { var status = true; if(sub_type.checked) status = false; var pid = sub_type.value; var found = 0; for(var f=0; f 0) tot_obj.savings_percent = (tot_obj.savings_percent/tot_obj.found); var tot_txt = tot_obj.total.toFixed(2); if(tot_obj.savings > 0) tot_txt += " ... Total Savings: $"+tot_obj.savings.toFixed(2)+" ( "+tot_obj.savings_percent.toFixed(1)+"% )"; if(form.service_total) form.service_total.value = tot_txt; function updateSubSave(form,pid,tot_obj) { var rate_found = 0; for(var f=0; f