// JavaScript Document
//*********************************************************************************************
var browser     = '';
	var version     = '';
	var entrance    = '';
	var cond        = '';
	// BROWSER?
	if (browser == ''){
	if (navigator.appName.indexOf('Microsoft') != -1)
	browser = 'IE'
	else if (navigator.appName.indexOf('Netscape') != -1)
	browser = 'Netscape'
	else browser = 'IE';
	}
	if (version == ''){
	version= navigator.appVersion;
	paren = version.indexOf('(');
	whole_version = navigator.appVersion.substring(0,paren-1);
	version         = parseInt(whole_version);
	}
	if (browser == 'IE' && version >= 4) {
		document.write('<'+'link rel="stylesheet" href="css/ie.css" />');
	} else {
		document.write('<'+'link rel="stylesheet" href="css/mac.css" />');
	}
//*********************************************************************************************
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()
	  if (imgName.substring(imgName.length-3, imgName.length) == ".PNG" || imgName.indexOf(".PNG")!= -1)
	  {
		 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
		 i = i-1
	   }
      }
   }
 if (browser == 'IE'){
		window.attachEvent("onload", correctPNG);
 }


if(navigator.userAgent.toLowerCase().indexOf('msie')>0){ // detect for IE (could be more specific to PC and version, but this works for the test)
	is = document.getElementsByTagName('INPUT'); // get all images
	for(x=0; x<is.length; x++){ // cycle through those images
		if(is[x].src.indexOf('.png')){ // only do this to png files
			is[x].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+is[x].src+"', sizingMethod='scale')"; // apply the filter stuff that makes IE do it's magic
			is[x].src = "images/z.gif"; // replace the image with a clear gif so that the filter can show through
		}
	}
	
	
}