// determines whether a browser has image support or not.
// if there is image support, writes a dynamic class to the <body> element
// this class drives any image replacements in the CSS
// which allows users without images to see content that would ordinarily be positioned off-screen
// requires dhtml_lib.js to be loaded

EventHelper.AddEvent(window, 'load', hasImages, false);

function hasImages() {
		var test = new Image();
		var tmp = new Date();
		var suffix = tmp.getTime();
		
		
		
		//win.document.write('hasImages()<br>');
				//suffix ensures a unique image, so that IE won't use it's cached image but will instead look for a "new" image
		test.src = '/img/spacer.gif?'+suffix; 
		test.onload = function() {
			//win.document.write('image loaded<br>');			
			assignBodyClass();
		}
}

function assignBodyClass() {
	//win.document.write('assigning body class<br>');
	if (!document.getElementsByTagName) return;
	var theBody = document.getElementsByTagName('body')[0];
	
	if (!theBody.className.match(/\simages/)) { theBody.className += ' images'; } //win.document.write('added "images" classname to body<br>');} win.document.write('"images" classname not added<br>');}
}

