var isIE=navigator.userAgent.indexOf("compatible")>-1&&navigator.userAgent.indexOf("MSIE")>-1&&(navigator.appName!=="Oprea");
var isIE7=(isIE&&window.XMLHttpRequest)?true:false;
var isIE6=(isIE&&!window.XMLHttpRequest&&window.ActiveXObject)?true:false;
var isFirefox=navigator.userAgent.indexOf('Firefox')==-1?false:true;
var userAgent = navigator.userAgent.toLowerCase();
var is_opera = userAgent.indexOf('opera') != -1 && opera.version();
var is_moz = (navigator.product == 'Gecko') && userAgent.substr(userAgent.indexOf('firefox') + 8, 3);
var is_ie = (userAgent.indexOf('msie') != -1 && !is_opera) && userAgent.substr(userAgent.indexOf('msie') + 5, 3);

function showPng(o)
{
	if(isIE6)
	{
		try{
			var img = o;var imgName = o.src.toUpperCase();
			if (imgName.substring(imgName.length-3, imgName.length) == "PNG")
			{
				var imgID = (img.id) ? "id='" + img.id + "' " : "";
				var imgClass = (img.className) ? "class='" + img.className + "' " : "";
				var imgTitle = (img.title) ? "title='" + img.title + "' " : "title='" + img.alt + "' ";
				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 " + imgID + imgClass + imgTitle + " style=\"" + imgStyle + ";" + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader" + "(src=\'" + img.src + "\', sizingMethod='image');width:1px;\"></span>"; img.outerHTML = strNewHTML;			
			}
		}
		catch (e){}
	}
}


function autoSize(obj,w,h)
{
	var oIMG=new Image()
	oIMG.onload=function()
	{
		var oW=this.width;
		var oH=this.height;
		var tax=1;
		if(oW>w||oH>h)
		tax=(oW/oH) > (w/h)?(w/oW):(h/oH);
		obj.style.marginLeft=(w-Math.floor(oW*tax))/2+"px";
		obj.style.marginTop =(h-Math.floor(oH*tax))/2+"px";
		obj.width=oW*tax;
		obj.height=oH*tax;
	}
	oIMG.src=obj.src;
}
