function correctPNG() // correctly handle PNG transparency in Win IE 5.5 & 6.
{
   var arVersion = navigator.appVersion.split("MSIE")
   var version = parseFloat(arVersion[1])
   if ((version >= 5.5) && (document.body.filters)) 
   {
      for(var i=0; i<document.images.length; i++)
      {
         var img = document.images[i]
         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;z-index:12;" + 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
            i = i-1
         }
      }
   }    
}


//AJAX STUFF

//Create a generic browser specific XML Http object
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {// Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();}
  catch (e)
    { // Internet Explorer
    try
      {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch (e)
      {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
    }
  return xmlHttp;
}

//Use the data returned by the changeOB function
//place the XMLHttp results into the innerHTML if a specific table cell
function useCart()
{
	if (xmlHttp.readyState==4)
	{document.getElementById("cart").innerHTML = xmlHttp.responseText;}
}

function useData()
{
	if (xmlHttp.readyState==4)
	{document.getElementById("dynamic").innerHTML = xmlHttp.responseText;}
}


//Use the generic XML Http object to get the contents of a URL Using GET method
function changeOB(url)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
  		{
  		alert ("Your browser does not support AJAX!");
  		return;
  		} 
	//var url="test2.html";
	xmlHttp.onreadystatechange=useData;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}
function postOB(url)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
  		{
  		alert ("Your browser does not support AJAX!");
  		return;
  		} 
	//var url="test2.html";
	xmlHttp.onreadystatechange=useData;
	xmlHttp.open("POST",url,true);
	xmlHttp.send(null);
}
function doCart(url)
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
  		{
  		alert ("Your browser does not support AJAX!");
  		return;
  		} 
	//var url="test2.html";
	xmlHttp.onreadystatechange=useCart;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}


function useBlog()
{
	if (xmlHttp.readyState==4)
	{document.getElementById("cont").innerHTML = xmlHttp.responseText;}
}

function doBlog()
{
	xmlHttp=GetXmlHttpObject()
	if (xmlHttp==null)
  		{
  		alert ("Your browser does not support AJAX!");
  		return;
  		} 
	//var url="test2.html";
	url = 'http://whimsey.tumblr.com';
	xmlHttp.onreadystatechange=useBlog;
	xmlHttp.open("GET",url,true);
	xmlHttp.send(null);
}




