Back to NMSU-A Button
I Quit Smoking JavaScript
Version 2.2
Updates every second without reloading page.
Changed the calculations so 4 weeks does not equal 1 month. 
Added ability to change amount of life saved.
(some say 5 minutes, some say 10, so now you decide)
Reduced life saved display to weeks because of
the problem of calculating 4 weeks equal to 1 month. 
I seem to have gotten the decimal place bug fixed so should only display up to two decimal places now.
Fixed incorrect display of 0 minute and 0 second to read 0 minutes and 0 seconds.
 Fixed incorrect month calculation
Released into public domain by Stan McCann Nov. 24, 1998.
Free for use with special thanks to all the special people that frequent alt.support.stop-smoking!
 
 
Instructions for use and setup
Retrieve the basic script by visiting the I Quit Smoking page and saving it. 
 
To enter your quit information, open the I Quit Smoking page in a text editor, then find the following text near the top of the document:
//********************** Begin Script **************************** 
//**** Fill in the following values with your quit information **** 
//****************************************************************** 

You can change the text between the quotes to suit yourself. 

var quit_text = "I quit! I've now been smoke free for "; 
var not_smoked_text = ". I've chosen not to smoke "; 
var money_saved_text = " cigarettes, I've saved $"; 
var life_saved_text = " of my hard earned dollars and I've increased my life span by "; 
var end_quit_text = "! Ain't that great!?"; 

Change the numeric values to match your quit information. 

var quit_year = 98; 
var quit_month = 10; // Jan = 1, Dec = 12 
var quit_day = 24; 
var quit_hour = 21; 
var quit_min = 0; 
var quit_sec = 0; 
var cigs_per_day = 28; 
var cost_per_pack = 2.00; 
var cigs_in_pack = 20; 
 var amount_life_saved = 5;    //assuming ea. cig = 5 min. off your life 
 

There are clearly marked areas in the page above and below the code which creates the Quitting information where you may enter any other HTML code to personalize your page. 
 
After entering your quit information, save the page, then open it in your favorite browser to view the results. 
 
Back to Quit smoking page
 
Back to Stan's Home page button
 
This page is maintained by Stan McCann.  Last modified 
Send comments and suggestions to stan@nmsua.nmsu.edu