function bandwidthTest()
{
    /*
        Bandwidth testing function copyright 2003 by Peter Bailey
        Requires inclusion of StopWatch class and Number methods
    */
    
    // filesize in Kilobytes.  You need to hardcode this for the image you use, JS can't read filesize
    var filesize = 5;
    var img = new Image();
    var s   = new StopWatch();

    // Start timing the download
    s.start();
    
    // When image loads, run this function
    img.onload = function()
    {
        // Stop timing download
        s.stop();

        // Get data
        var time = s.read().msToSec().round( 2 );
        var bw   = ( filesize / time ).round( 2 );
        
        // Set Cookie Accordingly
		if(bw > 20) {
			createCookie("bandwidth","high",1);
		} else {
			createCookie("bandwidth","low",1);
		}
        /* alert( filesize + "kb image loaded in " + time + " seconds for an estimated bandwith of " + bw + " kb/s" ); */

        s.reset();
    }
    // Set source file for image.  This image's filesize is what is used above
    img.src = "_images/bandwidth_test.gif";

	img.onerror = function()
	{
		alert( "didn't load" );
	}
}
