// JavaScript Documentfunction $(obj) { return document.getElementById(obj); }

//########################################################################
//	browserCheck
//########################################################################

function browserCheck() {
	var agent = navigator.userAgent;
	if (agent.indexOf("MSIE") > -1) {
		var anfang = agent.indexOf("MSIE");
		var ende = agent.lastIndexOf(";");
		var version = parseInt(agent.substring(anfang+5,ende-2));
		return "IE" + version;
	}
	else { return "MO"; }
}

//########################################################################
//	correctPNG
//########################################################################

function correctPNG() {
	// Correctly handle PNG transparency in Win IE 5.5 or higher.
	for(var i=0; i<document.images.length; i++) {
		var img = document.images[i];
		var imgName = img.src.toUpperCase();
		var sizMethod = null;
		// sizingMethod for IE
		if (img.className == "stretchBoxHGB") { sizMethod = "scale"; }
		else { sizMethod = "image"; }
		
		if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
		{
			var imgID		= (img.id) ? "id='" + img.id + "' " : "";
			var imgName		= (img.name) ? "name='" + img.name + "' " : "";
			var imgClass	= (img.className) ? "class='" + img.className + "' " : "";
			var imgTitle	= (img.title) ? "title='" + img.title + "' " : "";
			var imgOver		= (img.onmouseover) ? "onmouseover='hossa(this);' " : ""
			var imgStyle	= "display:inline-block;" + img.style.cssText;
			
			if (img.align == "left")	imgStyle = "float:left;" + imgStyle;
			if (img.align == "right")	imgStyle = "float:right;" + imgStyle;
			
			if (img.parentElement.href) imgStyle = "cursor:hand;" + imgStyle;
			var strNewHTML = "<span " + imgOver + imgID + imgName + imgClass + imgTitle
			+ " style=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
			+ "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
			+ "(src=\'" + img.src + "\', sizingMethod='" + sizMethod + "');" + "\"></span>" 
			img.outerHTML = strNewHTML
			i = i-1
		}
	}
}

start = function() {
	browser = browserCheck();
	if (browser == "IE6"){ correctPNG(); }	
}

//====================================================================================================

window.onload=start;

//====================================================================================================
