Wednesday, July 25, 2012

Political Calculations: The Tax Burden of ObamaCare

LUP) output = "The larger quantity has the lower unit price, making it the better deal.";
if (LUP > SUP) output = "The smaller quantity has the lower unit price, making it the better deal.";
if (LUP == SUP) output = "There's no difference in the unit price for either size package.";
BL = output; // The Bottom Line

// Output Calculated Values to Form
form.SUP.value = decimalFP(SUP, 3);
form.LUP.value = decimalFP(LUP, 3);
form.BL.value = BL;

} // End UnitPriceCoupon function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function termLife(form) {
// Convert Input Variables to Numeric Values
THI = eval(form.THI0.value); // How much annual income would your survivors need in the event of your death?
SHI = eval(form.SHI1.value); // How much annual income do they bring into your household today?
Y = eval(form.Y2.value); // How many years will your survivors need the income?
D = eval(form.D3.value); // How much total debt do you have that you would like to have paid off in the event of your death?
B = eval(form.B4.value); // How much do you anticipate will be needed to cover your burial expenses?
I = eval(form.I5.value); // Annualized interest rate for investing death benefit [%]
ALI = eval(form.ALI6.value); // Existing Term Life Insurance

// Calculate values
R = I/100; // Decimalized Interest Rate
AIS = Math.max(-1*(SHI - THI), 0); // Annual Income Shortfall [Amount of Income Needed to Replace Yours]
TDB = D + B; // Total Debt and Burial Expenses
PV = AIS*(1 + R)/R * (1 - 1/Math.pow((1+R),Y)); // Minimum Amount of Policy Needed to Cover Replacement Income
LIN = PV + TDB - ALI; // Estimated Amount of Term Life Insurance Needed

// Output Calculated Values to Form
form.AIS.value = decimalFP(AIS, 2);
form.PV.value = decimalFP(PV, 2);
form.LIN.value = decimalFP(LIN, 2);

} // End termLife function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function benefitPhaseoutTax(form) {
// Convert Input Variables to Numeric Values
BL = eval(form.BL0.value); // Amount of Benefit Received at Lower Income Level
IL = eval(form.IL1.value); // Lower Income Level
BH = eval(form.BH2.value); // Amount of Benefit Received at Higher Income Level
IH = eval(form.IH3.value); // Higher Income Level

// Calculate values
BD = BL - BH; // Difference in Benefits Received
ID = IH - IL; // Difference in Income Earned
ITR = BD/ID * 100; // Implicit Income Tax Rate for Benefit Phaseout

// Output Calculated Values to Form
form.ITR.value = decimalFP(ITR, 1) + "%";

} // End benefitPhaseoutTax function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function stimulusFTE(form) {
// Convert Input Variables to Numeric Values
H = eval(form.H0.value); // Hours of Work Compensated for with Stimulus Package Funds Over a Period of Time
E = eval(form.E1.value); // Hours One Full Time Employee Would Work During the Same Time Period

// Calculate values
FTE = H/E; // Number of Equivalent Full Time Workers (Jobs Created or Saved by Stimulus Spending Over the Period of Time)

// Output Calculated Values to Form
form.FTE.value = decimalFP(FTE, 0);

} // End stimulusFTE function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function CAWithhold2009(form) {
// This function will perform the paycheck withholding calculations for 2009!

// Constants
USA = 3650; // Value of (1) Federal Allowance for Annual Pay Period
CAA = 108.90; // New Value of (1) California Allowance for Annual Pay Period

// Convert Input Variables to Numeric Values
SAL = eval(form.AP0.value); // Current Annual Salary ($)
PER = setTerm(form.PP1.selectedIndex); // Term of Pay Period
FS = form.FS2.selectedIndex; // Filing Status
WA = form.WA3.selectedIndex; // Number of Withholding Allowances
PT = eval(form.PT4.value); // Pre-Tax 401(k) Contribution (%)
AT = eval(form.AT5.value); // After-Tax 401(k) Contribution (%)
HCSA = eval(form.HCSA6.value); // Annual Contribution to Health Care Spending Account
DCSA = eval(form.DCSA7.value); // Annual Contribution to Dependent Care Spending Account


// Set Values for Tax Rates and Income Bracket Threshhold Values
USRates = new Array(0.350, 0.330, 0.280, 0.250, 0.150, 0.100);
CARates0 = new Array(0.10550, 0.09550, 0.08250, 0.06250, 0.04250, 0.02250, 0.01250);
CARatesR = new Array(0.11605, 0.10505, 0.09075, 0.06875, 0.04675, 0.02475, 0.01375);

switch(FS) {
case 0: // Single
CALimits = new Array(1000000, 47055, 37233, 26821, 16994, 7168);
CSA = 3692;
break;
case 1: // Married
CALimits = new Array(1000000, 94110, 74466, 53642, 33988, 14336);
if (WA 59.5) {
RETIREMENT *= 1.0 / (3.7832E+01 - 3.2691E+00*AGE + 1.0908E-01*Math.pow(AGE,2) - 1.6087E-03*Math.pow(AGE,3) + 8.806E-06*Math.pow(AGE,4));
}
RETIREMENT = Math.max(RETIREMENT,0);
EDUCATION = (-1.3528E+02 - 1.1331E-01*AGE + 9.3392E-02*Math.pow(AGE,2) - 1.3468E-03*Math.pow(AGE,3)) / (1.0 - 9.3579E-02*AGE + 2.4995E-03*Math.pow(AGE,2) - 2.0856E-05*Math.pow(AGE,3)) // Education

// Total Expenditures

TAXES = FEDERAL + SOCIALSECURITY + STATE + LOCAL;
TOTAL = HEALTHCARE + CONTRIBUTIONS + FOOD + HOUSING + APPAREL + TRANSPORTATION + ENTERTAINMENT + OTHER + RETIREMENT + EDUCATION + TAXES;

// Percentage Calculations

pctHEALTHCARE = HEALTHCARE/TOTAL;
pctCONTRIBUTIONS = CONTRIBUTIONS/TOTAL;
pctFOOD = FOOD/TOTAL;
pctHOUSING = HOUSING/TOTAL;
pctAPPAREL = APPAREL/TOTAL;
pctTRANSPORTATION = TRANSPORTATION/TOTAL;
pctTAXES = TAXES/TOTAL;
pctENTERTAINMENT = ENTERTAINMENT/TOTAL;
pctOTHER = OTHER/TOTAL;
pctRETIREMENT = RETIREMENT/TOTAL;
pctEDUCATION = EDUCATION/TOTAL;
pctTOTAL = TOTAL/TOTAL;

// Output Calculated Values to Form
form.HEALTHCARE.value = decimalFP(HEALTHCARE, 2);
form.CONTRIBUTIONS.value = decimalFP(CONTRIBUTIONS, 2);
form.FOOD.value = decimalFP(FOOD, 2);
form.HOUSING.value = decimalFP(HOUSING, 2);
form.APPAREL.value = decimalFP(APPAREL, 2);
form.TRANSPORTATION.value = decimalFP(TRANSPORTATION, 2);
form.TAXES.value = decimalFP(TAXES, 2);
form.ENTERTAINMENT.value = decimalFP(ENTERTAINMENT, 2);
form.OTHER.value = decimalFP(OTHER, 2);
form.RETIREMENT.value = decimalFP(RETIREMENT, 2);
form.EDUCATION.value = decimalFP(EDUCATION, 2);
form.TOTAL.value = decimalFP(TOTAL, 2);

form.pctHEALTHCARE.value = decimalFP(pctHEALTHCARE*100, 1) + "%";
form.pctCONTRIBUTIONS.value = decimalFP(pctCONTRIBUTIONS*100, 1) + "%";
form.pctFOOD.value = decimalFP(pctFOOD*100, 1) + "%";
form.pctHOUSING.value = decimalFP(pctHOUSING*100, 1) + "%";
form.pctAPPAREL.value = decimalFP(pctAPPAREL*100, 1) + "%";
form.pctTRANSPORTATION.value = decimalFP(pctTRANSPORTATION*100, 1) + "%";
form.pctTAXES.value = decimalFP(pctTAXES*100, 1) + "%";
form.pctENTERTAINMENT.value = decimalFP(pctENTERTAINMENT*100, 1) + "%";
form.pctOTHER.value = decimalFP(pctOTHER*100, 1) + "%";
form.pctRETIREMENT.value = decimalFP(pctRETIREMENT*100, 1) + "%";
form.pctEDUCATION.value = decimalFP(pctEDUCATION*100, 1) + "%";
form.pctTOTAL.value = decimalFP(pctTOTAL*100, 1) + "%";

} // End ageIncomeDrivenExpenditures function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function economicData(YEAR) {

// This function will project the value of the U.S.' Gross Domestic Product based upon the
// Social Security Administration's projection of this data from 2008 through 2085 [ED01],
// as represented by the Trustees' Intermediate Cost Assumptions.
//
// "For the intermediate assumptions, the average annual growth in real GDP is projected to
// be 2.4 percent from 2008 to 2018, a slower rate than the 3.0 percent average observed over
// the historical 40 year period from 1967 to 2007. This slowdown is primarily due to slower
// projected growth in total employment." [ED02]
//
// "After 2018, no economic cycles are assumed for the three alternatives. Accordingly, projected
// rates of growth in real GDP are determined by the projected full-employment rate of growth for
// total employment, and the assumed full-employment rates of growth for total U.S. economy productivity
// and average hours worked. For the intermediate assumptions, the pro?jected rate of growth for real
// GDP falls toward the assumed productivity growth rate because of the projected decline in labor force
// growth over the period. At the end of the 75 year projection period, the annual growth in real GDP is
// 2.1 percent, due to the assumed ultimate percent changes of about 0.4, 1.7, and 0.0 for total
// employment, productivity, and average hours worked, respectively." [ED02]
//
// Performing a regression analysis of future GDP using the OASDI Trustees' data provided in Table VI.F4 [ED01]
// in Microsoft Excel using a simple regression analysis with an exponential model reveals that the Trustees'
// anticipate nominal GDP to grow at an average compound annualized rate of 5.16% from 2009 through 2018.
// Subtracting the 2.4% real GDP growth rate from this figure indicates an average level of annual inflation of
// 2.76%, which is low compared to the U.S. long term average of 3.29% observed since 1913. [ED03]
//
// Performing a similar regression analysis for the period from 2018 through 2085, we find a nominal GDP
// compound annualized growth rate of 4.49%. Given the OASDI Trustees' projected real GDP growth rate of
// 2.1%, this indicates they anticipate an average annual rate of inflation of approximately 2.05% during
// this period.
//
// We terminated the projection of GDP data at 2080 since this corresponds to the end of the period for
// which the Congressional Budget Office has extended its baseline expenditures projections.
//
// [ED01] 2009 OASDI Trustees Report. Table VI.F6. - Selected Economic Variables, Calendar Years 2008-85. http://www.ssa.gov/OACT/TR/2009/lr6f6.html. [Accessed 7 December 2009]
// [ED02] 2009 OASDI Trustees Report. Principal Economic Assumptions. http://www.ssa.gov/OACT/TR/2009/V_economic.html. [Accessed 7 December 2009]
// [ED03] Political Calculations. Mapping Inflation Extremes Since 1913. http://politicalcalculations.blogspot.com/2006/11/mapping-inflation-extremes-since-1913.html. [Accessed 7 December 2009]

GDP = new Array();
for(y=YEAR; y High) { // Swap Low and High Values if Mis-entered.
Temp = Low;
Low = High;
High = Temp;
}
Low = Math.max(Low, 0); // Set Lower Limit at 0 if Negative Value is Entered.
Smiths = Math.max(N/100*(fedEmpPayPctile2010(High) - fedEmpPayPctile2010(Low)), 1); // Number of Federal Employees Within Indicated Salary Range

// Output Calculated Values to Form
form.Smiths.value = decimalFP(Smiths, 0);

} // End numFedEmpPayRange2010 function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function areYouOldEnoughToMarryYet(form) {
// Constants
k = .368; // Probability of Proposal Success

// Convert Input Variables to Numeric Values
N = eval(form.N0.value); // The Oldest Age by Which You Want to Be Married
P = eval(form.P1.value); // The Earliest Age by Which Your Dating Pool Would Include Potential Spouses

// Calculate values
A = (N - P)*k + P; // Your Optimal Age for Proposing Marriage

// Output Calculated Values to Form
form.A.value = decimalFP(A, 1);

} // End areYouOldEnoughToMarryYet function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function minimumDatingAge(form) {
// Convert Input Variables to Numeric Values
Age = eval(form.Age0.value); // Your Age
legalAge = eval(form.legalAge1.value); // Your State's Age Threshold for Consensual Relationships

// Calculate values
minimumAge = Math.min(Age/2 + 7, Age-1); // Inter-Age Rule
if (Age > 16) minimumAge = Math.max(minimumAge, legalAge); // If user's age is over the statutory age, set minimum age to be the higher of the minimum age or legal age
minimumAge = minimumAge; // The Minimum Age of the Potential Members of Your Dating Pool

// Output Calculated Values to Form
form.minimumAge.value = decimalFP(minimumAge, 0);

} // End minimumDatingAge function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function taxCodePages(form) {
// Constants
R = 0.03253; // Average Exponential Growth Rate of U.S. Tax Code Complexity, 1954-2010
A = 11301.34; // Base Reference Value

// Convert Input Variables to Numeric Values
Year = eval(form.Year0.value); // Year

// Calculate values
Pages = A*Math.exp(R*(Year-1954)); // Estimated Number of Pages

// Output Calculated Values to Form
form.Pages.value = decimalFP(Pages, 0);

} // End taxCodePages function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function azSpeedLottery(form) {
// Constants
Decision = "It makes more sense to pay the fine when you first receive notice by mail."; // Default Decision: Pay the Fine

// Convert Input Variables to Numeric Values
Cost = eval(form.Cost0.value); // Cost of Administrative Fees (Cost of "Buying" a "Lottery" Ticket)
Prize = eval(form.Prize1.value); // Fine for Photo Enforcement Speed Violation (Amount of "Winnings")
Odds = eval(form.Odds2.value); // Probability of Not Being Served (Odds of "Winning") [1 in ...]

// Calculate values
minPrize = Cost*Odds; // Minimum "Prize" Needed to Justify "Playing" the "Lottery"
if (minPrize 1) comment = "The person appears less unattractive to you now than if you were fully sober. If you keep drinking, keep checking back...."; // Comment if Impaired, But Not Yet More Attractive
if (B > 50) comment = "The conditions and your drinking have combined to seriously distort your perception of reality. You should stop now and get a ride home!"; // Comment if Impaired, And Person Appears To Be Attractive
if (B > 100) comment = "Danger. Stop now. That isn't a professional model of any kind."; // Comment if Very Impaired
alertNotice = comment; // The Bottom Line

// Output Calculated Values to Form
form.B.value = decimalFP(B, 1);
form.alertNotice.value = alertNotice;

} // End beerGoggles function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function winningBaseballRecord(form) {
// Constants
NRG = 162; // Number of Regular Season Games

// Convert Input Variables to Numeric Values
R1 = eval(form.R10.value); // Runs Scored For Your Team
R2 = eval(form.R21.value); // Runs Scored Against Your Team
SLG1 = eval(form.SLG12.value); // Slugging Percentage For Your Team
SLG2 = eval(form.SLG23.value); // Slugging Percentage Against Your Team
NG = eval(form.NG4.value); // Number of Games Played

// Calculate values
a = Math.pow(0.723*(R1/NG + R2/NG), 0.373); // Exponent for Offense/Pitching Runs per Game Ratio
b = Math.pow(0.977*(R1/NG + R2/NG), -0.947); // Exponent for Offense/Pitching Slugging Percentage Ratio
WLRatio = Math.pow(R1/R2, a)*Math.pow(SLG1/SLG2, b); // Ratio of Wins to Losses
W1 = NG*WLRatio/(1 + WLRatio); // Projected Current Number of Wins
L1 = NG - W1; // Projected Current Number of Losses
WNG = W1/NG; // Projected Winning Percentage
SW1 = NRG*WLRatio/(1 + WLRatio); // Projected Number of Wins for Full Season
SL1 = NRG - SW1; // Projected Number of Losses for Full Season

// Output Calculated Values to Form
form.WLRatio.value = decimalFP(WLRatio, 3);
form.W1.value = decimalFP(W1, 0);
form.L1.value = decimalFP(L1, 0);
form.WNG.value = decimalFP(WNG, 3);
form.SW1.value = decimalFP(SW1, 0);
form.SL1.value = decimalFP(SL1, 0);

} // End winningBaseballRecord function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function unemploymentDuration2010(form) {
// Constants
shift = 10.4; // Change in U.S. Duration of Unemployment from 2009

// Convert Input Variables to Numeric Values
ueRate = eval(form.ueRate0.value); // Your State's Unemployment Rate

// Calculate values
ueDuration = 1.105*ueRate + 3.4123 + shift; // Median Number of Weeks of Unemployment

// Output Calculated Values to Form
form.ueDuration.value = decimalFP(ueDuration, 1);

} // End unemploymentDuration2010 function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function robinHoodMoralityTale(form) {
// Convert Input Variables to Numeric Values
m0 = eval(form.m0.value); // The "Most" Moral
m1 = eval(form.m1.value); // Second-most Moral
m2 = eval(form.m2.value); // Third-most Moral
m3 = eval(form.m3.value); // The "Least" Moral

// Determine ranking

comment = "You've duplicated an option you've already selected. Please make a unique selection. ";
survey = "";
switch(m0) {
case 0: // First Option is Robin Hood
switch(m1) {
case 1: // Second Option is Little John
switch(m2) {
case 2: // Third Option is Maid Marian
if (m3==3) {
comment = "You are a moralist with conventional ideas. Old fashioned. ";
survey = "5%";
}
break;
case 3: // Third Option is the Sheriff of Nottingham
if (m3==2) {
comment = "You are massively puritanical and believe women conspire against men. ";
survey = "2%";
}
break;
}
break;
case 2: // Second Option is Maid Marian
switch(m2) {
case 1: // Third Option is Little John
if (m3==3) {
comment = "Your philosophy is a confused mix of romanticism and moralism. ";
survey = "4%";
}
break;
case 3: // Third Option is the Sheriff of Nottingham
if (m3==1) {
comment = "You have high standards and are not predisposed to trust others. "
survey = "2%";
}
break;
}
break;
case 3: // Second Option is the Sheriff of Nottingham
switch(m2) {
case 2: // Third Option is Maid Marian
if (m3==1) {
comment = "You are a ruthless authoritarian with weak personal morals. "
survey = "2%";
}
break;
case 1: // Third Option is Little John
if (m3==2) {
comment = "You are a misogynist! You see women as the possessions of men. "
survey = "3%";
}
break;
}
break;
}
break;
case 1: // First Option is Little John
switch(m1) {
case 0: // Second Option is Robin Hood
switch(m2) {
case 2: // Third Option is Maid Marian
if (m3==3) {
comment = "You are cautious and insecure - you distrust the opposite sex. ";
survey = "6%";
}
break;
case 3: // Third Option is the Sheriff of Nottingham
if (m3==2) {
comment = "You have an inferiority complex. Men: You fear women. Women: Get a backbone. ";
survey = "2%";
}
break;
}
break;
case 2: // Second Option is Maid Marian
switch(m2) {
case 0: // Third Option is Robin Hood
if (m3==3) {
comment = "You're a romantic, idealizing women or expecting too much of men. ";
survey = "15%";
}
break;
case 3: // Third Option is the Sheriff of Nottingham
if (m3==0) {
comment = "You're a slightly romantic realist. Broad-minded, flexible, and likely happy. "
survey = "10%";
}
break;
}
break;
case 3: // Second Option is the Sheriff of Nottingham
switch(m2) {
case 2: // Third Option is Maid Marian
if (m3==0) {
comment = "You believe in common sense and relative morality. You're uncertain. "
survey = "3%";
}
break;
case 0: // Third Option is Robin Hood
if (m3==2) {
comment = "You are a misogynist! You're a prude with an old-school opinion of women. "
survey = "1%";
}
break;
}
break;
}
break;
case 2: // First Option is Maid Marian
switch(m1) {
case 1: // Second Option is Little John
switch(m2) {
case 0: // Third Option is Robin Hood
if (m3==3) {
comment = "You are happy and well balanced, with some chivalry and/or high standards. ";
survey = "13%";
}
break;
case 3: // Third Option is the Sheriff of Nottingham
if (m3==0) {
comment = "You are contented and maybe a little superior. For you, morality fits the occasion. ";
survey = "10%";
}
break;
}
break;
case 0: // Second Option is Robin Hood
switch(m2) {
case 1: // Third Option is Little John
if (m3==3) {
comment = "You're guilty, lack confidence and are overly concerned about others' opinions. ";
survey = "4%";
}
break;
case 3: // Third Option is the Sheriff of Nottingham
if (m3==1) {
comment = "You need to live a little! You're too stubborn. "
survey = "1%";
}
break;
}
break;
case 3: // Second Option is the Sheriff of Nottingham
switch(m2) {
case 1: // Third Option is Little John
if (m3==1) {
comment = "Women: You like your men strong and your women stronger. Men: You're a wannabe lover. "
survey = "2%";
}
break;
case 0: // Third Option is Robin Hood
if (m3==0) {
comment = "You're strong to the point of ruthlessness. For you, Truth rules all. "
survey = "3%";
}
break;
}
break;
}
break;
case 3: // First Option is the Sheriff of Nottingham
switch(m1) {
case 1: // Second Option is Little John
switch(m2) {
case 2: // Third Option is Maid Marian
if (m3==0) {
comment = "You are sulky, confused and immature. ";
survey = "2%";
}
break;
case 0: // Third Option is Robin Hood
if (m3==2) {
comment = "Men: You see women as fickle and inferior. Women: Get a backbone. ";
survey = "1%";
}
break;
}
break;
case 2: // Second Option is Maid Marian
switch(m2) {
case 1: // Third Option is Little John
if (m3==0) {
comment = "You claim to be a realist, but really, you're a romantic. ";
survey = "3%";
}
break;
case 0: // Third Option is Robin Hood
if (m3==1) {
comment = "You are a rebel with a trace of spoiled child. You value truth above morality. "
survey = "2%";
}
break;
}
break;
case 0: // Second Option is Robin Hood
switch(m2) {
case 2: // Third Option is Maid Marian
if (m3==1) {
comment = "You prefer fantasy sex to real life. "
survey = "3%";
}
break;
case 1: // Third Option is Little John
if (m3==2) {
comment = "Men: You're afraid of women. Women: You like bad boys. "
survey = "2%";
}
break;
}
break;
}
break;
} // End switch statement

observation = comment; // Observation
percentage = survey; // Percentage of Individuals Who Chose the Same Option

// Output Calculated Values to Form
form.observation.value = observation;
form.percentage.value = percentage;

} // End robinHoodMoralityTale function.

//
//-------|---------|---------|---------|---------|---------|---------|---------|
//

function sexAppeal(form) {
// Convert Input Variables to Numeric Values
T = eval(form.T0.value); // [T] If you can see your toes while standing, enter zero. If not, enter the inches of reduced belt size needed to restore your podiatric vision.
HH = eval(form.HH1.value); // [HH] Enter the percentage of scalp showing through your hair. (0 = Jean Luc Picard, 100 = Justin Bieber). HB = eval(form.HB2.value); // [HB] Enter the percentage of your body below your neck showing through hair. M = eval(form.M3.value); // [M] Go to a park and smile at ten mothers. How many smile back? (Subtract from this value the number of children who cry.) Oplus = eval(form.Oplus4.value); // [O+] How many of the following do you have or have you had? (A gym membership, a cat or dog, silk boxer sorts, a motorcycle, shoes that cost more than $100, sex in the past month, massage oil and/or bubble bath.) Ominus = eval(form.Ominus5.value); // [O-] How many of the following do you have? (A snake or rat, underwear with holes, a video game machine, Velcro shoes, a condom past its expiration date, any personalized or joke beer paraphernalia, your mother's phone number on speed dial.) SS = eval(form.SS6.value); // [SS] Your shoe size. X = eval(form.X7.value); // [X] Five will be subtracted from your Sex Appeal score if you actually click the "Calculate" button.... // Calculate values SA = 25*Math.sqrt(HB/(HH+25))*((M+Oplus+SS+25)/(T+Ominus+25))-X; // Your Sex Appeal Rank, on a Scale from 0 to 100 // Output Calculated Values to Form form.SA.value = decimalFP(SA, 0); } // End sexAppeal function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function bmiBodyFat(form) { // Convert Input Variables to Numeric Values H = eval(form.H0.value); // Height W = eval(form.W1.value); // Weight HF = eval(form.heightUnits.value); // Height Unit Adjustment Factor WF = eval(form.weightUnits.value); // Weight Unit Adjustment Factor H = H*HF; W = W*WF; Age = eval(form.Age2.value); // Age [years] Gender = eval(form.Gender3.value); // Gender // Calculate values BMI = W/Math.pow(H, 2); // Body Mass Index switch(Gender) { case 0: // Female ABF = 4.35*BMI - 0.05*Math.pow(BMI, 2) - 46.24; // Your Estimated Body Fat Percentage (Based on BMI and Gender Only) break; case 1: // Male ABF = 3.76*BMI - 0.04*Math.pow(BMI, 2) - 47.80; // Male Estimated Adult Body Fat Percentage (Based on BMI and Gender Only) break; } // End Switch Statement ABFAge = 1.39*BMI + 0.16*Age - 10.34*Gender - 9; // Your Estimated Body Fat Percentage (Also Taking Your Age Into Account) // Output Calculated Values to Form form.BMI.value = decimalFP(BMI, 1); form.ABF.value = decimalFP(ABF, 1) + "%"; form.ABFAge.value = decimalFP(ABFAge, 1) + "%"; } // End bmiBodyFat function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function subtractionForMediaTypes(form) { // Convert Input Variables to Numeric Values F = eval(form.F0.value); // First Value S = eval(form.S1.value); // Second Value // Calculate values A = F - S; // Solution // Output Calculated Values to Form form.A.value = decimalFP(A, 2); } // End subtractionForMediaTypes function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function healthCareFSAcash(form) { // Convert Input Variables to Numeric Values A = eval(form.A0.value); // Estimated Copayments for Doctor Visits and Prescription Drugs B = eval(form.B1.value); // Deductibles and Copayments for Dental Coverage C = eval(form.C2.value); // Cost of Reimburseable Items (such as eyeglasses) D = eval(form.D3.value); // Expenses Related to Special Health Care Needs (such as diabetic supplies) E = eval(form.E4.value); // Expected Extraordinary Expenses (such as for baby delivery or major surgery) M = eval(form.M5.value); // Your Employers Maximum Health Care FSA Contribution Amount // Calculate values T = A+B+C+D+E; // Total Expected Health and Dental Care Expenses if (T On how many of the following services are you a registered user? [Facebook, MySpace, Friendster, Twitter, Blogger, Badoo, Bebo, Flickr, LinkedIn]
CT = eval(form.CT2.value); // How many cell phones do you own? D = eval(form.D3.value); // In how many of the following dinosaur activities do you participate on a daily basis?
[read the newspaper,subscribe to a newspaper, use a pen/pencil, watch TV, listen to music that has ever been placed on any nondigital recordable media, recreate offline] W = eval(form.W4.value); // In how many programming languages could you design a widget of any sort? P = eval(form.P5.value); // How many of the following people have you heard of?
Linus Torvalds, Ray Ozzie, Kevin Mitnick, Jean Grey, Samwise Gamgee, Violet Blue] // Calculate values Atech = A + Math.pow(SN + CT + W + P, 2)/Math.sqrt(D + 2); // Age of Your Personal Technological Obsolescence // Output Calculated Values to Form form.Atech.value = decimalFP(Atech, 1); } // End ageTechnologyOvertakes function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function USWithholdJan2011(form) { // This function will perform federal income tax paycheck withholding calculations for 2010 // Constants USA = 3650; // Value of (1) Federal Allowance for Annual Pay Period (same as for 2009!) // Convert Input Variables to Numeric Values AP = eval(form.AP0.value); // Current Annual Salary ($) PER = setTerm(form.PP1.selectedIndex); // Term of Pay Period USFS = form.FS2.selectedIndex; // Federal Filing Status WA = form.WA3.selectedIndex; // Number of Federal Withholding Allowances PT = eval(form.PT4.value); // Pre-Tax 401(k) Contribution (%) AT = eval(form.AT5.value); // After-Tax 401(k) Contribution (%) HCSA = eval(form.HCSA6.value); // Annual Contribution to Health Care Spending Account DCSA = eval(form.DCSA7.value); // Annual Contribution to Dependent Care Spending Account // Set Values for Tax Rates and Income Bracket Threshhold Values switch(USFS) { case 0: // Single USRates2010 = new Array(0.350, 0.330, 0.280, 0.300, 0.270, 0.250, 0.150, 0.100); USLimits2010 = new Array(375700, 173900, 87700, 84450, 67700, 36050, 10425, 6050); USRatesJan2011 = new Array(0.386, 0.350, 0.300, 0.270, 0.150, 0.100); USLimitsJan2011 = new Array(375700, 173900, 78900, 36000, 10250, 3200); break; case 1: // Married USRates2010 = new Array(0.350, 0.330, 0.280, 0.250, 0.270, 0.250, 0.150, 0.100); USLimits2010 = new Array(381400, 217000, 145050, 124050, 94050, 75750, 24500, 13750); USRatesJan2011 = new Array(0.386, 0.350, 0.300, 0.270, 0.150, 0.100); USLimitsJan2011 = new Array(381400, 217000, 133800, 62650, 22100, 7700); break; } // Calculate Values Used in Tax Calculations SAL = AP; // Annual Salary PBP = SAL/PER; // Base Pay per Pay Period PTC = PT/100*SAL; // Annual Pre-Tax 401(k) Contributions VA = WA*USA; // Annual Value of Withholding Allowances USTI = SAL - VA - PTC - HCSA - DCSA; // Annual U.S. Taxable Income // Federal Income Tax Calculations FAIT2010 = taxBrackets(USTI, USLimits2010, USRates2010); // Annual Federal Income Tax Withholding in 2010 FAITJan2011 = taxBrackets(USTI, USLimitsJan2011, USRatesJan2011); // Estimated Annual Federal Income Tax Withholding in January 2011 PC2010 = (FAIT2010 - FAIT2010)/FAIT2010*100; // 2010 Percentage Change from Amount of Federal Income Taxes Withheld in 2010 PCJan2011 = (FAITJan2011 - FAIT2010)/FAIT2010*100; // January 2011 Percentage Change from Amount of Federal Income Taxes Withheld in 2010 // Output Calculated Values to Form form.PAY.value = formatUSD(SAL/PER); // Paycheck Amount form.FIT2010.value = formatUSD(FAIT2010/PER); // Withheld Federal Income Taxes per Paycheck in 2010 form.FITJan2011.value = formatUSD(FAITJan2011/PER); // Withheld Federal Income Taxes per Paycheck in 2010 form.PC2010.value = formatUSD(PC2010)+"%"; // 2010 Percentage Change from Amount of Federal Income Taxes Withheld in 2010 form.PCJan2011.value = formatUSD(PCJan2011)+"%"; // January 2011 Percentage Change from Amount of Federal Income Taxes Withheld in 2010 } // End USWithholdJan2011 function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function coinTossOdds(form) { // Convert Input Variables to Numeric Values N = eval(form.N0.value); // Total Number of Opportunities k = eval(form.k1.value); // Number of Times the Outcome Goes a Particular Way p = eval(form.p2.value); // Probability of Outcome Occurring in Each Opportunity [%] // Calculate values p = p/100; // Decimalized Probability q = 1 - p; // Opposite Probability probability = Factorial(N)/Factorial(k)/Factorial(N-k)*Math.pow(p, k)*Math.pow(q, N - k)*100; // Probability of the Event Occurring [%] odds = 1/(probability/100); // Odds of the Event Occurring [1 in ...] // Output Calculated Values to Form form.probability.value = decimalFP(probability, 4) + "%"; form.odds.value = decimalFP(odds, 1); } // End coinTossOdds function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function halloweenBucket(form) { // Constants Bucket = "Your Pockets Are More Than Enough"; // Default Output // Convert Input Variables to Numeric Values T = eval(form.T0.value); // Total Time You Plan to Spend Trick or Treating (in hours) A = eval(form.A1.value); // Trick or Treater's Age (If over 20, or below 0, shame on you!) Hc = eval(form.Hc2.value); // Hours Spent on Costume (If Store Bought, Take Price and Divide by 20) Pd = eval(form.Pd3.value); // Population Density of Your Targeted Neighborhood Ma = eval(form.Ma4.value); // Estimated Median Age in the Neighborhood (the lower the age, the more houses you'll likely be visiting) X = eval(form.X5.value); // Your Child's "Lust for Candy" Factor (Enter a value from 1-10, with 10 being "has strategized since last Halloween") // Calculate values B = T*(A - 0.05*A*A + Hc*Pd/Math.sqrt(Ma) + X); // Bucket Size if (B > 1) Bucket = "Your Child Should Use the Small-Size, Plastic Jack-'O-Lantern Bucket"; // Small if (B > 7) Bucket = "Your Child Should Use the Standard-Size Trick-or-Treating Bucket"; // Standard if (B > 12) Bucket = "Your Child Should Upgrade to a Pillowcase"; // Pillowcase if (B > 17) Bucket = "Your Candy Collecting Achiever Should Use a Grocery Bag"; // Grocery if (B > 25) Bucket = "Wow! You Might as Well Let Them Use a Trash Bag!"; // Trash Comment = Bucket; // Your Child's Optimum Halloween Candy Collection Container // Output Calculated Values to Form form.Comment.value = Comment; } // End halloweenBucket function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function FTRtoHMI(form) { // Convert Input Variables to Numeric Values FTC = eval(form.FTC0.value); // Total Federal Tax Receipts for Fiscal Year [billions USD] // Calculate values HMI = 255.982541*Math.pow(FTC, 0.679450); // Projected Household Median Income // Output Calculated Values to Form form.HMI.value = decimalFP(HMI, 0); } // End FTRtoHMI function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function zeroDeficitLine(form) { // Convert Input Variables to Numeric Values MHI = eval(form.MHI0.value); // Median Household Income // Calculate values FSpHH = 0.4425*MHI - 1089.59; // Federal Spending per U.S. Household // Output Calculated Values to Form form.FSpHH.value = decimalFP(FSpHH, 0); } // End zeroDeficitLine function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function incomePercentile2009(form) { // Constants earners = 211254000; // Number of Income Earners in 2009 // Convert Input Variables to Numeric Values x = eval(form.income0.value); // Your Annual Income (Total Money Income) // Calculate values maxIncome = 150000000; if(x= 1) TieTheKnot = "Yes. It's time to start shopping for a ring!"; // Comment = TieTheKnot; // The Bottom Line // Output Calculated Values to Form form.TTK.value = decimalFP(TTK, 2); form.Comment.value = Comment; } // End readyToPropose function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function USWithhold2011(form) { // This function will perform federal income tax paycheck withholding calculations for 2010 // Constants USA = 3700; // Value of (1) Federal Allowance for Annual Pay Period // Convert Input Variables to Numeric Values AP = eval(form.AP0.value); // Current Annual Salary ($) PER = setTerm(form.PP1.selectedIndex); // Term of Pay Period USFS = form.FS2.selectedIndex; // Federal Filing Status WA = form.WA3.selectedIndex; // Number of Federal Withholding Allowances PT = eval(form.PT4.value); // Pre-Tax 401(k) Contribution (%) AT = eval(form.AT5.value); // After-Tax 401(k) Contribution (%) HCSA = eval(form.HCSA6.value); // Annual Contribution to Health Care Spending Account DCSA = eval(form.DCSA7.value); // Annual Contribution to Dependent Care Spending Account DR = eval(form.DR8.value); // Desired Raise Percentage (%) // Set Values for Tax Rates and Income Bracket Threshhold Values switch(USFS) { case 0: // Single USRates = new Array(0.350, 0.330, 0.280, 0.250, 0.150, 0.100); USLimits = new Array(381250, 176500, 85700, 36600, 10600, 2100); break; case 1: // Married USRates = new Array(0.350, 0.330, 0.280, 0.250, 0.150, 0.100); USLimits = new Array(387050, 220200, 147250, 76900, 24900, 7900); break; } // Set values for Tax Rate Comparison with 2010 switch(USFS) { case 0: // Single USRates2010 = new Array(0.350, 0.330, 0.280, 0.300, 0.270, 0.250, 0.150, 0.100); USLimits2010 = new Array(375700, 173900, 87700, 84450, 67700, 36050, 10425, 6050); break; case 1: // Married USRates2010 = new Array(0.350, 0.330, 0.280, 0.250, 0.270, 0.250, 0.150, 0.100); USLimits2010 = new Array(381400, 217000, 145050, 124050, 94050, 75750, 24500, 13750); break; } // Calculate Values Used in Tax Calculations SAL = AP*(1 + DR/100); // Proposed Annual Salary (with Raise) PBP = SAL/PER; // Proposed Base Pay per Pay Period PTC = PT/100*SAL; // Annual Pre-Tax 401(k) Contributions ATC = AT/100*SAL; // Annual After Tax 401(k) Contributions VA = WA*USA; // Annual Value of Withholding Allowances // Federal Income Tax Calculations USTI = SAL - VA - PTC - HCSA - DCSA; // Annual U.S. Taxable Income FAIT = taxBrackets(USTI, USLimits, USRates); // Annual Federal Income Tax Withholding // Federal Income Tax Calculations for 2010 FAIT2010 = taxBrackets(USTI, USLimits2010, USRates2010); // FICA Withholding Calculations SST = Math.min(.042*SAL, .042*106800); // Annual Withheld Social Security Taxes MCT = .0145*SAL; // Annual Withheld Medicare Taxes // Miscellaneous Calculations T401k = PTC + ATC; // Annual Total 401(k) Contributions WH = FAIT + SST + MCT + T401k + HCSA + DCSA; // Annual Total Withholding NET = SAL - WH; // Annual Pay After Total Withholding // Comparison Calculations DBT = Math.min(.020*SAL, .02*106800); // Social Security Tax Cut Savings (2011) DIT = FAIT2010 - FAIT; // Difference in Federal Income Taxes DIF = DBT + DIT; // Net Change from 2010 // Output Calculated Values to Form form.SAL.value = formatUSD(SAL); // Proposed Annual Salary form.PAY.value = formatUSD(SAL/PER); // Paycheck Amount form.FIT.value = formatUSD(FAIT/PER); // Withheld Federal Income Taxes per Paycheck form.SST.value = formatUSD(SST/PER); // Withheld Social Security Taxes per Paycheck form.MCT.value = formatUSD(MCT/PER); // Withheld Medicare Taxes form.PTC.value = formatUSD(PTC/PER); // Pre-Tax 401(k) Contributions per Paycheck form.ATC.value = formatUSD(ATC/PER); // After-Tax 401(k) Contributions per Paycheck form.T401k.value = formatUSD(T401k/PER); // Total 401(k) Contributions per Paycheck form.HSA.value = formatUSD(HCSA/PER); // Pre-Tax Health Care Spending Account Contributions per Paycheck form.DSA.value = formatUSD(DCSA/PER); // Pre-Tax Dependent Care Spending Account Contributions per Paycheck form.NET.value = formatUSD(NET/PER); // Net Paycheck Amount After Withholding form.DBT.value = formatUSD(DBT/PER); // Social Security Tax Cut Savings (2011) form.DIT.value = formatUSD(DIT/PER); // Change in Tax Withholding form.DIF.value = formatUSD(DIF/PER); // Net Change from 2010 form.STIM.value = decimalFP(DIF/SAL*100, 1) + "%"; // Percentage of Income "Stimulus" } // End USWithhold2011 function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function topOnePctTaxCollections(form) { // Constants a = -5.3805388414261332E+06; // a b = -6.7378355944145390E-12; // b c = 5.2057116603559622E+05; // c d = 6.1169870046247370E-13; // d f= 1.1741786853311759E-01; // f g = 1.0670314607969531E-05; // g h = -4.9596727665121447E-07; // h offset = -1.1778311928168268E+05; // Offset // Convert Input Variables to Numeric Values x = eval(form.x_in0.value); // Maximum U.S. Income Tax Rate y = eval(form.y_in1.value); // Taxable Income Floor to be in Top 1% of Taxpayers // Calculate values z = (a + b*Math.exp(x) + c*Math.log(y) + d*Math.exp(x)*Math.log(y)) / (1.0 + f*x + g*y + h*x*y) + offset; // Estimated Total Tax Collections [millions U.S. dollars] // Output Calculated Values to Form form.z.value = decimalFP(z, 0); } // End topOnePctTaxCollections function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function goldCube(form) { // Constants RM = 19.3; // Density of Gold [grams per cubic centimeter] // Convert Input Variables to Numeric Values A = eval(form.A0.value); // Amount of Federal Spending [billions U.S. dollars] G = eval(form.G1.value); // Spot Price of Gold [U.S. dollars per ounce] // Calculate values RE = RM*62.428; // Convert Gold Density to Pounds per Cubic Foot P = G*16; // Convert Gold Price to Price per Pound W = A*1E9/P; // Equivalent Value in Weight of Gold [pounds] V = W/RE; // Equivalent Volume of Gold [cubic feet] S = Math.pow(V, 1/3); // Side Dimension of Gold Cube [feet] P = V/Math.pow(66, 3)*100; // Percent of All Gold Ever Found // Output Calculated Values to Form form.W.value = decimalFP(W, 2); if (S > 10) { form.S.value = decimalFP(S, 1) + " x " + decimalFP(S, 1) + " x " + decimalFP(S, 1); } else { form.S.value = decimalFP(S, 2) + " x " + decimalFP(S, 2) + " x " + decimalFP(S, 2); } form.P.value = decimalFP(P, 4) + "%" } // End goldCube function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function howManyKids(form) { // Constants O = "No. You're not ready yet!"; // Default Response // Convert Input Variables to Numeric Values S = eval(form.S0.value); // Your combined household salary K = eval(form.K1.value); // Combined, how many brothers and sisters do you and your spouse have (include yourselves in this number) T = eval(form.T2.value); // Combined hours per week you and your significant other work outside the house A = eval(form.A3.value); // On a scale from 1-10, the highest level of aversion you have to any of the following: Changing diapers, sleep deprivation, visiting in-laws, tantrums E = eval(form.E4.value); // On a scale from 1-10, how concerned are you about global overpopulation // Calculate values if (S >= 30000) { K = Math.pow((S - 30000)/5000, 1/3) + (K + 11 - E)/(T/20 + A); // Number of Kids } else { K = -Math.pow((30000 - S)/5000, 1/3) + (K + 11 - E)/(T/20 + A); // Number of Kids; } if (K >= 1) O = "You're probably ready!"; // Should You Have Kids? shouldYou = O; // Should You Have Kids? Kids = K; // How Many Kids Should You Have? C = "No - we just provide that to give you an idea of how close you might be to a particular 'whole child' threshold so you can play with tweaking your input data!"; // Should You Be Concerned by the Decimal Portion of the Answer? // Output Calculated Values to Form form.shouldYou.value = shouldYou; form.Kids.value = decimalFP(Kids, 1); form.C.value = C; } // End howManyKids function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function gasPriceToUnemploymentRate(form) { // Constants CPIJan2011 = 220.223; // Consumer Price Index, January 2011 // Convert Input Variables to Numeric Values Gnominal = eval(form.Gnominal0.value); // Average Price of a Gallon of Gasoline CPILatest = eval(form.CPILatest1.value); // Most Recent Consumer Price Index (CPI-U) Value // Calculate values Greal = CPIJan2011/CPILatest*Gnominal; // Adjust Gasoline Price to be in Constant January 2011 U.S. Dollars UE50 = 1.943*Greal + 2.070; // Projected Unemployment Rate // Output Calculated Values to Form form.UE50.value = decimalFP(UE50, 1) + "%"; } // End gasPriceToUnemploymentRate function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function planetValue(form) { // Constants Msun = 1.9891; // Mass of the Sun Mearth = 5.9736; // Mass of the Planet Earth Mmars = 0.64585; // Mass of the Planet Mars Tearth = 254.3; // Effective Temperature Tmars = 210.2; // Effective Temperature // Convert Input Variables to Numeric Values Teff = eval(form.Teff0.value); // Effective Temperature of the Planet [degrees Kelvin] Mplanet = eval(form.Mplanet1.value); // Mass of the Planet [quadrillion kg] Tyr = eval(form.Tyr2.value); // Year of Discovery [Enter 2009 if Discovered Prior to 2009] Tstar = eval(form.Tstar3.value); // Age of the Planet's Star [billion years] Mstar = eval(form.Mstar4.value); // Mass of the Planet's Star [quintillion kg] Vstar = eval(form.Vstar5.value); // Apparent Visual Magnitude (Brightness) of the Planet's Star // Calculate values V1 = 6000000*Tstar/0.5 * Math.pow(Msun/Mstar, 1/3); V2 = Math.exp(-Math.pow(Math.log(Mplanet/Mearth)/Math.LN10/0.2, 2)); V3 = Math.exp(-Math.pow((Teff - 273)/30, 2)); V4 = Math.exp(-((Math.max(Tyr, 2009) - 2009)/4)); V5 = Math.sqrt(Math.pow(2.5, 12-Vstar)); V = V1*V2*V3*V4*V5; // Estimated Value [Constant 2009 U.S. Dollars] // Output Calculated Values to Form form.V.value = decimalFP(V, 2); } // End planetValue function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function lightTechnologyComparison(form) { // This function will find out if one electric light source type is more // economical than a competing technology // Convert Input Variables to Numeric Values C = eval(form.C0.value); // Electricity Rate [$ per kiloWatt-hour] H = eval(form.H1.value); // Time Period of Operation [Hours] L1 = eval(form.L12.value); // Technology for Light #1 [Incandescent, Fluorescent, LED = 1, CFL = 2/3] L2 = eval(form.L23.value); // Technology for Light #2 [Incandescent, Fluorescent, LED = 1, CFL = 2/3] W1 = eval(form.W14.value); // Light #1 Power Consumption Rate [Watts] W2 = eval(form.W25.value); // Light #2 Power Consumption Rate [Watts] T1 = eval(form.T16.value); // Rated Life of Light #1 [Hours] T2 = eval(form.T27.value); // Rated Life of Light #2 [Hours] P1 = eval(form.P18.value); // Purchase Price of Light #1 [$ per Lamp] P2 = eval(form.P29.value); // Purchase Price of Light #2 [$ per Lamp] // Calculate values N1 = Math.ceil(H/T1/L1); // Number of Consumed Units Like Light #1 N2 = Math.ceil(H/T2/L2); // Number of Consumed Units Like Light #1 CB1 = N1*P1; // Cost of Bulbs OVer Time Period of Operation for Light #1 CB2 = N2*P2; // Cost of Bulbs Over Time Period of Operation for Light #2 CE1 = H*W1/1000*C; // Cost of Electricity Over Time Period of Operation for Light #1 CE2 = H*W2/1000*C; // Cost of Electricity Over Time Period of Operation for Light #2 CT1 = CB1 + CE1; // Total Cost of Ownership and Use of Light #1 CT2 = CB2 + CE2; // Total Cost of Ownership and Use of Light #2 if(CT10) IPM = "+"; G = -I*2.65; // Effective Change in GDP Growth Rate if (G>0) GPM = "+"; // Output Calculated Values to Form form.I.value = IPM + decimalFP(I, 1) + "%"; form.G.value = GPM + decimalFP(G, 1) + "%"; } // End cdsGDP function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function perfectToast(form) { // Convert Input Variables to Numeric Values ha = eval(form.ha0.value); // Bread Thickness [millimeters] Cpa = eval(form.Cpa1.value); // Bread Specific Heat [kJ/kg/oC] Cpb = eval(form.Cpb2.value); // Butter Specific Heat [kJ/kg/oC] pa = eval(form.pa3.value); // Density of Bread [g/L] pb = eval(form.pb4.value); // Density of Butter [g/L] T = eval(form.T5.value); // Temperature of Bread Immediately After Toasting [oC] wa = eval(form.wa6.value); // Weight of Bread Slice [g] // Calculate values hb = (Cpa*pa*(T-35))/60/Cpb/pb*ha; // Thickness of Butter [mm] F = Cpa*(T-35)/60/Cpb*wa; // Weight of Butter [g] // Output Calculated Values to Form form.hb.value = decimalFP(hb, 2); form.F.value = decimalFP(F, 2); } // End perfectToast function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function actuarialssIRR2010(form) { // This function will return an approximate internal rate of return for average // Social Security old age beneficiaries under present law (August 2011). The // formula was generated using ZunZun's 3-D contour mapping functions, with x // representing the difference between the individual's birth year and 1913, y // representing the individual's average lifetime annual income in 2010 dollars. // ZunZun generated the various values for the constants a, b, and c. // // Reference Link: http://www.ssa.gov/OACT/NOTES/ran5/an2009-5.html // Convert Input Variables to Numeric Values by = eval(form.by0.value); // Your Birth Year ai = eval(form.ai1.value); // Your Average Lifetime Annual Income hh = eval(form.hh2.value); // Household Type // Calculate values x = by - 0 // Difference Between Birth Year and 1913 // Set Constants if (hh == 0) { // Single Male a = 3.4830058483131051E+07; b = -1.3769406994404348E+07; c = -9.8160827145620715E+01; d = 1.8145060082775326E+06; f = 9.3514340906403959E+00; g = -7.9703860850292258E+04; h = -3.0071162991225719E-01; } if (hh == 1) { // Single Female a = 4.6465115514614679E+07; b = -1.8370376588547118E+07; c = -9.6139752013958059E+01; d = 2.4209750412252117E+06; f = 9.1590634707827121E+00; g = -1.0635075353067368E+05; h = -2.9447480291128159E-01; } if (hh == 2) { // One-Earner Couple a = 4.9682508087921910E+07; b = -1.9637628433339857E+07; c = -1.0157001107651740E+02; d = 2.5873554737905581E+06; f = 9.6840790377464145E+00; g = -1.1363222687139083E+05; h = -3.1141287088394165E-01; } if (hh == 3) { // Two-Earner Couple a = 4.3581663567176104E+07; b = -1.7228949575518753E+07; c = -9.9209529911546269E+01; d = 2.2703632689268854E+06; f = 9.4518688353709877E+00; g = -9.9726351340780966E+04; h = -3.0402682162821293E-01; } // Approximated Internal Rates of Return from Social Security IRR = a; IRR += b*Math.log(x); IRR += c*Math.log(ai); IRR += d*Math.pow(Math.log(x), 2); IRR += f*Math.pow(Math.log(ai), 2); IRR += g*Math.pow(Math.log(x), 3); IRR += h*Math.pow(Math.log(ai), 3); LIRR = IRR - .20; // Low Rate of Return Approximation (%) AIRR = IRR; // Average Rate of Return Approximation (%) HIRR = IRR + .20; // High Rate of Return Approximation (%) // Output Calculated Values to Form form.LIRR.value = decimalFP(LIRR, 2); form.AIRR.value = decimalFP(AIRR, 2); form.HIRR.value = decimalFP(HIRR, 2); } // End actuarialssIRR2010 function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function generalLogistic(A, C, M, B, T, x) { return A + C/Math.pow(1 + T*Math.exp(-1*B*(x - M)) , 1/T); } // End generalLogistic function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function indIncPctle2010(form) { // Constants earners = 211492000; // Number of Income Earners in 2010 A = -1.5477245366007452E+02; C = 2.1280577680304385E+05; M = 1.0409005647526971E+01; B = 2.2975240441106495E+00; T = 2.2584329924097539E+00; // Convert Input Variables to Numeric Values x = eval(form.income0.value); // Your Annual Total Money Income // Calculate values maxIncome = 150000000; if(x= -1)) { var mainMessage =" Merry Christmas!!! "; var speed=175; var scrollingRegion=100; var tempLoc=(scrollingRegion*3/mainMessage.length)+1; if (tempLocscrollingRegion) startPosition=0; setTimeout("Xmascountdown()",speed); } else { if (days >= 0) { var theDay = XmasDate; } else { var theDay = new Date(XmasDate.getYear()+1,XmasDate.getMonth(),XmasDate.getDate()); } var second = Math.floor((theDay.getTime() - today.getTime())/1000); var minute = Math.floor(second/60); var hour = Math.floor(minute/60); var day = Math.floor(hour/24); CDay= day; CHour= hour % 24; CMinute= minute % 60; CSecond= second % 60; dayOrDays = " days, "; hourOrHours = " hours, "; minuteOrMinutes = " minutes and "; secondOrSeconds = " seconds"; if (CDay 0) dayOrDays = " day, "; if (CHour 0) hourOrHours = " hour, "; if (CMinute 0) minuteOrMinutes = " minute and "; if (CSecond 0) secondOrSeconds = " second"; var DayTill = CDay + dayOrDays + CHour + hourOrHours + CMinute + minuteOrMinutes + CSecond + secondOrSeconds; clock.XmascountdownDisplay.value = DayTill; var counter = setTimeout("Xmascountdown()", 1000); } } // End Xmascountdown function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function USWithhold2012(form) { // This function will perform federal income tax paycheck withholding calculations for 2010 // Constants USA = 3800; // Value of (1) Federal Allowance for Annual Pay Period // Convert Input Variables to Numeric Values AP = eval(form.AP0.value); // Current Annual Salary ($) PER = setTerm(form.PP1.selectedIndex); // Term of Pay Period USFS = form.FS2.selectedIndex; // Federal Filing Status WA = form.WA3.selectedIndex; // Number of Federal Withholding Allowances PT = eval(form.PT4.value); // Pre-Tax 401(k) Contribution (%) AT = eval(form.AT5.value); // After-Tax 401(k) Contribution (%) HCSA = eval(form.HCSA6.value); // Annual Contribution to Health Care Spending Account DCSA = eval(form.DCSA7.value); // Annual Contribution to Dependent Care Spending Account DR = eval(form.DR8.value); // Desired Raise Percentage (%) // Set Values for Tax Rates and Income Bracket Threshhold Values switch(USFS) { case 0: // Single USRates = new Array(0.350, 0.330, 0.280, 0.250, 0.150, 0.100); USLimits = new Array(390500, 180800, 87800, 37500, 10850, 2150); break; case 1: // Married USRates = new Array(0.350, 0.330, 0.280, 0.250, 0.150, 0.100); USLimits = new Array(396450, 225550, 150800, 78800, 25500, 8100); break; } // Set values for Tax Rate Comparison with 2010 switch(USFS) { case 0: // Single USRates2010 = new Array(0.350, 0.330, 0.280, 0.300, 0.270, 0.250, 0.150, 0.100); USLimits2010 = new Array(375700, 173900, 87700, 84450, 67700, 36050, 10425, 6050); break; case 1: // Married USRates2010 = new Array(0.350, 0.330, 0.280, 0.250, 0.270, 0.250, 0.150, 0.100); USLimits2010 = new Array(381400, 217000, 145050, 124050, 94050, 75750, 24500, 13750); break; } // Calculate Values Used in Tax Calculations SAL = AP*(1 + DR/100); // Proposed Annual Salary (with Raise) PBP = SAL/PER; // Proposed Base Pay per Pay Period PTC = PT/100*SAL; // Annual Pre-Tax 401(k) Contributions ATC = AT/100*SAL; // Annual After Tax 401(k) Contributions VA = WA*USA; // Annual Value of Withholding Allowances // Federal Income Tax Calculations USTI = SAL - VA - PTC - HCSA - DCSA; // Annual U.S. Taxable Income FAIT = taxBrackets(USTI, USLimits, USRates); // Annual Federal Income Tax Withholding // Federal Income Tax Calculations for 2010 FAIT2010 = taxBrackets(USTI, USLimits2010, USRates2010); // FICA Withholding Calculations SST = Math.min(.042*SAL, .042*106800); // Annual Withheld Social Security Taxes MCT = .0145*SAL; // Annual Withheld Medicare Taxes // Miscellaneous Calculations T401k = PTC + ATC; // Annual Total 401(k) Contributions WH = FAIT + SST + MCT + T401k + HCSA + DCSA; // Annual Total Withholding NET = SAL - WH; // Annual Pay After Total Withholding // Comparison Calculations DBT = Math.min(.020*SAL, .02*106800); // Social Security Tax Cut Savings (2012) DIT = FAIT2010 - FAIT; // Difference in Federal Income Taxes DIF = DBT + DIT; // Net Change from 2010 // Output Calculated Values to Form form.SAL.value = formatUSD(SAL); // Proposed Annual Salary form.PAY.value = formatUSD(SAL/PER); // Paycheck Amount form.FIT.value = formatUSD(FAIT/PER); // Withheld Federal Income Taxes per Paycheck form.SST.value = formatUSD(SST/PER); // Withheld Social Security Taxes per Paycheck form.MCT.value = formatUSD(MCT/PER); // Withheld Medicare Taxes form.PTC.value = formatUSD(PTC/PER); // Pre-Tax 401(k) Contributions per Paycheck form.ATC.value = formatUSD(ATC/PER); // After-Tax 401(k) Contributions per Paycheck form.T401k.value = formatUSD(T401k/PER); // Total 401(k) Contributions per Paycheck form.HSA.value = formatUSD(HCSA/PER); // Pre-Tax Health Care Spending Account Contributions per Paycheck form.DSA.value = formatUSD(DCSA/PER); // Pre-Tax Dependent Care Spending Account Contributions per Paycheck form.NET.value = formatUSD(NET/PER); // Net Paycheck Amount After Withholding form.DBT.value = formatUSD(DBT/PER); // Social Security Tax Cut Savings (2012) form.DIT.value = formatUSD(DIT/PER); // Change in Tax Withholding form.DIF.value = formatUSD(DIF/PER); // Net Change from 2010 form.STIM.value = Math.round(DIF/SAL*100*10)/10 + "%"; // Percentage of Income "Stimulus" } // End USWithhold2012 function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function volPriceAbort2008(form) { // Convert Input Variables to Numeric Values C = eval(form.C0.value); // Annual Caseload // Calculate values P = 350.37*(1 - Math.exp(-4.72*Math.pow((Math.max(C,30) - 28.22), -0.44))) + 412.45; // Average Price Paid for Abortion, 2008 R = C*P; // Estimated Annual Revenue for Abortion Provider // Output Calculated Values to Form form.P.value = decimalFP(P, 2); form.R.value = decimalFP(R, 2); } // End volPriceAbort2008 function. // //-------|---------|---------|---------|---------|---------|---------|---------| // function accountingManipulations2010(form) { // This function differs from the original accountingManipulations function in that it incorporates // soft assets into the overall F-score calculation, the formula for which was modified in a 21 April 2010 // revision to the original paper "Predicting Material Accounting Misstatements". // Constants KNOWN = 494; // Number of Known Manipulating Firms-Years in Authors' Sample NONMAN = 133461; // Number of Non-Manipulating Firms-Years in Authors' Sample // F-Score Coefficients A = -7.893; B = 0.790; C = 2.518; D = 1.191; E = 1.979; F = 0.171; G = -0.932; H = 1.029; // Initial Default Values issue = 0; // Indicates firm has not issued new long-term debt, common stock, or preferred stock. // Convert Input Variables to Numeric Values // Note: Variable Naming Convention is based on Compustat Data Reference and Number of Years prior to the Year of Interest // i.e. Data 6 (Total Assets) is D06, one year prior to year of interest is Y1, resulting variable is: D06Y1 // D12Y0 = eval(form.D12Y00.value); // Sales (Revenues) - Year of Interest D12Y1 = eval(form.D12Y10.value); // Sales (Revenues) - One Year Prior D18Y0 = eval(form.D18Y01.value); // Net Income Before Extraordinary Items or Cumulative Effect of Accounting Changes - Year of Interest D18Y1 = eval(form.D18Y11.value); // Net Income Before Extraordinary Items or Cumulative Effect of Accounting Changes - One Year Prior D01Y0 = eval(form.D01Y02.value); // Cash and Cash Equivalents - Year of Interest D01Y1 = eval(form.D01Y12.value); // Cash and Cash Equivalents - One Year Prior D01Y0A = eval(form.D01Y0A3.value); // Short Term Investments - Year of Interest D01Y1A = eval(form.D01Y1A3.value); // Short Term Investments - One Year Prior D02Y0 = eval(form.D02Y04.value); // Receivables (Total) - Year of Interest D02Y1 = eval(form.D02Y14.value); // Receivables (Total) - One Year Prior D02Y2 = eval(form.D02Y24.value); // Receivables (Total) - Two Years Prior D03Y0 = eval(form.D03Y05.value); // Inventories (Total) - Year of Interest D03Y1 = eval(form.D03Y15.value); // Inventories (Total) - One Year Prior D06Y0 = eval(form.D06Y06.value); // Total Assets - Year of Interest D06Y1 = eval(form.D06Y16.value); // Total Assets - One Year Prior D06Y2 = eval(form.D06Y26.value); // Total Assets - Two Years Prior D08Y0 = eval(form.D08Y0.value); // Property, Plant and Equipment (Total - Net) - Year of Interest D130Y0 = eval(form.D130Y07.value); // Preferred Stock (Total) - Year of Interest D130Y1 = eval(form.D130Y17.value); // Preferred Stock (Total) - One Year Prior D216Y0 = eval(form.D216Y08.value); // Total Shareholder's (or Owner's) Equity - Year of Interest D216Y1 =

Source: http://politicalcalculations.blogspot.com/2012/07/the-tax-burden-of-obamacare.html

at last al green burger king delivery etta james at last john king obama sings al green heidi klum and seal

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.