<!-- hide from old browsers...

// 

// Copyright 2003 AZC, Inc.  All rights reserved.  The following code is

// either for internal use, or on a royalty-free basis, for AZC's hosting

// customers only.  Redistribution in any form to a third party is

// prohibited without prior written permission from AZC, Inc.

//

// $Id: since.js,v 1.3 2003/10/21 19:07:43 fangchin Exp $

//

// starting_year : 4 digit year, e.g. 2003.

// starting_month: a number between 1 and 12 inclusive.

// starting_date : a number between 1 and 31 inclusive.



function print_since(starting_year, starting_month, starting_date, label)

{

    var now = new Date();

    var current_year = now.getFullYear();

    var current_month = now.getMonth();

    current_month++; // So that we count from 1 to 12 instead of 0 to 11.

    var current_date = now.getDate();

    if (starting_year == null) {

alert("Starting year not specified");

    }

    if (starting_month == null) {

alert("Starting month not specified");

    }

    if (starting_date == null) {

alert("Starting date not specified");

    }

    var year_diff = current_year - starting_year;

    var month_diff = current_month - starting_month;

    var date_diff = current_date - starting_date;

    if (date_diff < 0) {

date_diff = current_date;

    }

    if (month_diff < 0) {

year_diff--;

month_diff = current_month;

    }

    

    var ylabel = " year ";

    var mlabel = " month ";

    var dlabel = " day";

    if ( year_diff > 1 ) ylabel = " years ";

    if ( month_diff > 1 ) mlabel = " months ";

    if ( date_diff > 1 ) dlabel = " days";



    if (label == null) {

label = "In business for ";

    }



    // A style sheet can be used to control the look and feel of the

    // printed results below.  The argument 'label' is introduced to add

    // more flexibility to the printed results.



    return label +

   year_diff + 

           ylabel +

   month_diff +

   mlabel +

   date_diff + 

   dlabel +

           ".";

}

//-->

