//---------------------------------------------------------------
// Opacity Displayer, Version 1.0
// Copyright Michael Lovitt, 6/2002.
// Distribute freely, but please leave this notice intact.
//---------------------------------------------------------------

//---------------------------------------------------------------
// OPACITY DISPLAY FUNCTION
// Outputs the image as a div with the AlphaImageLoader, or with
// a standard image tag.
function od_displayImage(strId, strPath, strClass, strStyle) {
	if (pngAlpha) {
		document.write('<div class="'+strClass+'" style="'+strStyle+'filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'\', sizingMethod=\'scale\');" id="'+strId+'"></div>');
	} else if (pngNormal) {
		document.write('<img src="'+strPath+'" name="'+strId+'" border="0" class="'+strClass+'" style="'+strStyle+'" />');
	}
};
//---------------------------------------------------------------

var browser = new browserDetect(); // Instantiate the browser object, to determine usability.

// Initialize variable defaults.
var pngAlpha = false; // Default is not to have to apply a PNG alpha filter (>=IE7 or DOM-compatible).
var pngNormal = true; // Default to display PNG24 images.

// The browser either display PNGs normally (list of compatible browsers follows), or if it was not IE and cannot support PNGs, GIF is the default.
//		- Gecko Engine: Netscape 6 or Mozilla, Mac or PC
//		- Safari
//		- IE7+ PC
//		- IE5+ Mac (note: OpacityObject applies the background image at 100% opacity)
//		- Opera 6+ PC or Linux 
//		- Omniweb 3.1+
//		- Icab 1.9+ 
//		- WebTV
if(!browser.isGecko && !browser.isSafari && !browser.isIE7up && !browser.isWebtv) {
	var compatible = false;

	if(browser.isOpera) {
		if((browser.isWin || browser.isUnix) && browser.versionMajor >= 6) { compatible = true; }
	}
	if(browser.isIE5up && browser.isMac) { compatible = true; }
	if(browser.isOmniweb && browser.versionMinor >= 3.1) { compatible = true; }
	if(browser.isIcab && browser.versionMinor >= 1.9) { compatible = true; }
	if(browser.isWin32 && browser.isIE55up) { pngAlpha = true; }
	
	if(!compatible) { // This is either a completely PNG-incompatible browser, or needs an AlphaImageLoader() script applied.
		pngNormal = false;
	}
}