// Mac IE Float fix
// <!--
function fixmacie(classname){  
	/* I'm assuming the containers are div */  
	var divs=document.getElementsByTagName("DIV"); 
	/* Loop through all the div's */  
	for(var d=0; d < divs.length;d++){ 
		/* Compare class names and insert clearing div*/ 
		(divs[d].className==classname)?divs[d].innerHTML+= "<div class='cb'> </div>":""; 
	} 
} 

function init(){ 
	/* Check if the browser is IE5 Mac */  
	if( navigator.appVersion.indexOf('Mac')!=-1 && document.all){ 
		/* Pass the class name of the container to fixmacie */  
		fixmacie("floatcontainer"); 
	} 
}
// !-->
// End of Mac IE Float fix

// ----------------------------------------------------------------

// 'external' to '_blank' target fix
// <!--
function externalLinks() {
  if (!document.getElementsByTagName) return;
  var anchors = document.getElementsByTagName("a");
  for (var i=0; i<anchors.length; i++) {
    var anchor = anchors[i];
    if (anchor.getAttribute("href") &&
        anchor.getAttribute("rel") == "external")
      anchor.target = "_blank";
    }
}
// -->
// End of 'external' to '_blank' target fix

// ----------------------------------------------------------------

// IE Background png fix
// <!--
function alphaBackgrounds(){
	var rslt = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '');
	var itsAllGood = (rslt != null && Number(rslt[1]) >= 5.5);
	for (i=0; i<document.all.length; i++){
		var bg = document.all[i].currentStyle.backgroundImage;
		if (itsAllGood && bg){
			if (bg.match(/\.png/i) != null){
				var mypng = bg.substring(5,bg.length-2);
				document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='image')";
				document.all[i].style.backgroundImage = "url(/images/interface/blank.gif)";
			}
		}
	}
}
// -->
// End of IE Background png fix

// ----------------------------------------------------------------

// Fire all events onload
function multipleOnload(){
	init();
	externalLinks();
	// Fix for pc ie transparent bg's
	if (navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
		alphaBackgrounds();
	}
}
window.onLoad = multipleOnload();