function getGif() {
   var range = 10;
   var theDate = new Date();
   var result = theDate.getSeconds(); // Math.random();
// 05-07-2010 -- let's go back to selecting a random animated gif
// result2 = LZ(Math.floor(result % (range-1)) + 1); // LZ(Math.floor(result * range) + 1);
// 05-14-2010 -- Don't really like the way the white square looks before the image loads...
   result2 = '01';
   result2 = '/images/ccs_logo_' + result2 + '.gif';
// alert(result2);
   return result2;
}

function LZ(x) {
   return (x<0||x>=10?"":"0") + x
}

function write_links($x, $y) {

// echo "x = '" . $x . "'    y = '" . $y . "' <br><br>";

// var base = ''; //http://www.charlescrumesoftware.com';
   var base = 'http://www.charlescrumesoftware.com';
//   if ($x) base = ".."; //"http://www.charlescrumesoftware.com";

// this line is needed when testing on a local machine...
// base = '.';

   var title = "title goes here";
   title = $y;

   var foo = '** Logged in as: '; // + <?php echo $_SESSION['z_mall_id'] ?>;

   base2 = base + getGif();
// alert(base2);

   document.write (
      '<div style="float:left"><a href="http://www.charlescrumesoftware.com">',
        // '<img src="' + base + '/images/ccs_logo.gif"          alt="Antique Mall Software" border="0"></a>',
        // '<img src="' + base + '/images/ccs_logo_animated.gif" alt="Antique Mall Software" border="0"></a>',
           '<img src="' + base2+                              '" alt="Charles Crume Software Home Page" border="0"></a>',
      '</div>',

      '<div style="float:right">',
        // '<a href="http://cgi6.ebay.com/ws/eBayISAPI.dll?ViewSellersOtherItems&amp;userid=ccthecomputerguy&amp;include=0&amp;since=-1&amp;sort=3&amp;rows=50" target="_window">',
        // '<img src="http://pics.ebay.com/aw/pics/ebay_my_button.gif" alt="Antique Mall Software" width="88" height="31"></a>',
        // '<a href="http://half.ebay.com/account/functions/view_seller.cfm?member_name=ccthecomputerguy&amp;ad=54074" target="_window">',
        // '<img src="' + base + '/images/half_dot_com.gif" alt="Antique Mall Software" width="88" height="31"></a><br>',
//333           '<font color="white">',
//333           foo,
//333           '</font><br>',
//         '<img src="' + base + '/images/nil.gif" alt="Antique Mall Software" width="78" height="34" border="0"></a><br>',
           '<img src="' + base + '/images/nil.gif" alt="Antique Mall Software" width="78" height="8" border="0"></a><br>',
////////// '<a href="'  + base + '/forsale.php">',
////////// '<a href="'  + base + '/auction/index.php">',           /*?this_user=SuperChuck">', */
           '<a href="'  + base + '/shopping/index.php" target="_blank">',          /*?this_user=SuperChuck">', */
//88            <?php echo("z_mall_id = $_SESSION['z_mall_id'];"); ?>,
//88            <?php echo("z_user_id = $_SESSION['z_user_id'];"); ?>,



//         '<img src="' + base + '/images/shop@ccs.bmp"            alt="Antique Mall Software" width="102" height="47" border="0"></a>',
           '<img src="' + base + '/images/auction/au_cpyright.gif" alt="Charles Crume Software On-Line Store" width="100" height="82" border="0"></a>',
           '<img src="' + base + '/images/nil.gif" alt="Antique Mall Software"                 width="3"   height="82" border="0"></a><br>',


// ***     '<!-- Begin PayPal Logo --><A HREF="https://www.paypal.com/us/mrb/pal=932JTNXHMTPAC" target="_blank"><IMG SRC="http://images.paypal.com/en_US/i/bnr/paypal_mrb_banner.gif"    BORDER="0" ALT="Sign up for PayPal and start accepting credit card payments instantly." height="47"></A><!-- End PayPal Logo -->',
//         '<!-- Begin PayPal Logo --><A HREF="https://www.paypal.com/us/mrb/pal=932JTNXHMTPAC" target="_blank"><img src="https://www.paypal.com/en_US/i/bnr/horizontal_solution_PP.gif" BORDER="0" ALT="Sign up for PayPal and start accepting credit card payments instantly."></A><!-- End PayPal Logo -->',

      '</div>',

      '<h1>&nbsp;' + title + '</h1>',
      '<p>&nbsp;</p>',
//    '<div style="float:right"><img src="' + base + '/images/about_us_off.gif" alt="About Us"></div>',
//    '<div style="float:right"><img src="' + base + '/images/nil.gif" alt="Antique Mall Software"></div>',
//    '<div style="float:right"><font color="cyan">Last Updated: <?php echo date("F d Y H:i:s", getlastmod()); ?></font></div>',
//    '<div style="float:right"><font color="cyan">Last Updated: <?php print date("F d Y H:i:s", getlastmod()); ?></font></div>',
//    '<div style="float:right"><font color="cyan">Last Updated: <?php echo "Today"; ?></font></div>',

      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu.js"></script>',
      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_items.js"></script>',
      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_tpl.js"></script>',

      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_items_cms.js"></script>',
      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_tpl_cms.js"></script>',

      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_items_dms.js"></script>',
      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_tpl_dms.js"></script>',

      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_items_this.js"></script>',
      '<script language="JavaScript" type="text/javascript" src="' + base + '/menu_tpl_this.js"></script>'

   );

   var sPath = window.location.pathname;
   var sPage = sPath.substring(sPath.lastIndexOf('\\') + 1);
   var sPage_2 = sPage.substring(0,3);
// alert(sPage + "       " + sPage_2);
}
