function png_setBackground(Id,path,theme) {
	
	var oObject = document.getElementById(Id).style;

	if (pngAlpha) {
		oObject.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+theme+"/"+path+".png', sizingMethod='scale')";
	} else if (pngNormal) {
		oObject.backgroundImage = 'url('+theme+'/'+path+'.png)';
	} else {
		oObject.backgroundImage = 'url('+theme+'/'+path+'.gif)';
	}
}

function pngBackground(Id, path, sizingmethod) {
    var target = Id;
    if (typeof target == 'string') target = document.getElementById(target);
	var oObject = target.style;
	
	if(sizingmethod == ""){
		sizingmethod = "scale";
	}
	if (pngAlpha) {
		oObject.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+ path + "', sizingMethod='" + sizingmethod + "')";
	} else {
		oObject.backgroundImage = 'url('+ path + ')';
	}
}


function png_displayImage(strDiv1, strDiv2, strPath, intWidth, intHeight, strAlt) {
  var overlay = document.getElementById(strDiv1);
  var overlayImage = document.getElementById(strDiv2);
  var overlayImageSrc = strPath;					
  overlay.style.display = 'block';
  // MSIE 5.x/6.x must be treated specially in order to make them use the PNG alpha channel
  if (overlayImage.runtimeStyle) {
    overlayImage.runtimeStyle.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + overlayImageSrc + "', sizingMethod='scale')";
  } else {
    overlayImage.src = overlayImageSrc;
    overlayImage.height = intHeight;
    overlayImage.width = intWidth;
    overlayImage.alt = strAlt;
  }
}

function displayPNG(strPath, intWidth, intHeight, strAlt) {
	if (pngAlpha) 
	{
	   if( strAlt != "" )
	      strAlt = ' alt="' + strAlt;
	      
		document.write('<img src="/Themes/Default/en-us/Common/Public/Images/clearpix.gif" width="'+intWidth+'" height="'+intHeight+'" border="0"' + strAlt + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'\', sizingMethod=\'scale\')">');
	} 
	else 
	{
		document.write('<img src="'+strPath+'" width="'+intWidth+'" height="'+intHeight+'" border="0"' + strAlt +'" />');
	} 
}

function displayPNGAsString(strPath, intWidth, intHeight, strAlt) {
	if (pngAlpha) 
	{
	   if( strAlt != "" )
	      strAlt = ' alt="' + strAlt;
	      
		return '<img src="/Themes/Default/en-us/Common/Public/Images/clearpix.gif" width="'+intWidth+'" height="'+intHeight+'" border="0"' + strAlt + '" style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=\''+strPath+'\', sizingMethod=\'scale\')">';
	} 
	else 
	{
		return '<img src="'+strPath+'" width="'+intWidth+'" height="'+intHeight+'" border="0"' + strAlt +'" />';
	} 
}

function correctIndividualPNG(img){

  if ((browser.isIE55 || browser.isIE6x) && browser.isWin32) {
    var imgName = img.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=\"" + "width:" + img.width + "px; height:" + img.height + "px;" + imgStyle + ";"
      + "filter:progid:DXImageTransform.Microsoft.AlphaImageLoader"
      + "(src=\'" + img.src + "\', sizingMethod='scale');\"></span>";
      img.outerHTML = strNewHTML;
    }
  }else if(browser.isIE6up){
  
  }
 
}

//---------------------------------------------------------------

//---------------------------------------------------------------
// global variables

// if IE5.5+ on win32, then display PNGs with AlphaImageLoader
if ((browser.isIE55 || browser.isIE6up) && browser.isWin32) {
	var pngAlpha = true;
	var strExt = ".png";
// else, if the browser can display PNGs normally, then do that. that list includes:
	//     -Gecko Engine: Netscape 6 or Mozilla, Mac or PC
	//     -IE5+ Mac (OpacityObject applies the background image at 100% opacity)
	//     -Opera 6+ PC
	//     -Opera 5+ Mac (Doesn't support dynamically-set background images)
	//     -Opera 6+ Linux 
	//     -Omniweb 3.1+ 
	//     -Icab 1.9+ 
	//     -WebTV 
	//     -Sega Dreamcast
} else if ((browser.isGecko) || (browser.isIE5up && browser.isMac) || (browser.isOpera && browser.isWin && browser.versionMajor >= 6) || (browser.isOpera && browser.isUnix && browser.versionMajor >= 6) || (browser.isOpera && browser.isMac && browser.versionMajor >= 5) || (browser.isOmniweb && browser.versionMinor >= 3.1) || (browser.isIcab && browser.versionMinor >= 1.9) || (browser.isWebtv) || (browser.isDreamcast)) {
	var pngNormal = true;
	var strExt = ".png";
	// otherwise, we use plain old GIFs
} else {
	var strExt = ".gif";
}

var ns = (document.all)?false:true;
var browserVersion = parseFloat(navigator.appVersion );
//---------------------------------------------------------------
