if(navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	
version = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '\\1');

if(version[1] >= 5.5 && version[1] < 7) window.attachEvent("onload", alphaBackgrounds);

}

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) {
    if(bg.match(/button/i) == null && bg.match(/image/i) == null) {
     var sizingMethod = 'crop';
     var mypng = bg.substring(5,bg.length-2);
     document.all[i].style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='"+mypng+"', sizingMethod='"+sizingMethod+"')";
     document.all[i].style.backgroundImage = "url('gfx/transparent.gif')";
    }
   }
  }
 }
 // setting obj styles
 document.getElementById('menu').style.visibility = "hidden";
 document.getElementById('menu').style.margin = "-12px 0px 0px -3px";
 document.getElementById('div_menu_left').style.margin = "0px 0px 0px 5px";
 document.getElementById('div_menu_right').style.margin = "0px 0px 0px 0px";
 document.getElementById('menu').style.visibility = "visible";
 document.getElementById('menu_pos').style.visibility = "visible";
 
 if(document.getElementById('content_left')) document.getElementById('content_left').style.padding = "14px 8px 8px 8px";
 if(document.getElementById('content')) document.getElementById('content').style.padding = "14px 8px 8px 8px";

 if(document.getElementById('content_right')) {
  if(document.getElementById('div_content')) document.getElementById('div_content').style.marginLeft = "190px";
  document.getElementById('content_right').style.padding = "14px 8px 0px 8px";
  //document.getElementById('content_right').style.height = "383px";
 } else if(document.getElementById('div_content')) document.getElementById('div_content').style.marginLeft = "197px";

 if(document.getElementById('right_image')) {
  document.getElementById('right_image').style.visibility = "hidden";
  document.getElementById('right_image').style.marginTop = "-15px";
  document.getElementById('right_image').style.marginRight = "-10px";
  document.getElementById('right_image').style.visibility = "visible";
 }

/* IE grey backgrounds hack
 * displaying divs after filter conversion of backgrounds
 * set in css file
 */
 document.getElementById('logo').style.visibility = "visible";
 document.getElementById('header_t3box').style.visibility = "visible";
 document.getElementById('header_left').style.visibility = "visible";
 if(document.getElementById('header_right')) document.getElementById('header_right').style.visibility = "visible";
 document.getElementById('header_content').style.visibility = "visible";

 document.getElementById('left').style.visibility = "visible";
 if(document.getElementById('info')) document.getElementById('info').style.visibility = "visible";
 document.getElementById('div_content').style.visibility = "visible";

}

function toggleSubDiv(obj) {
 // reset all and display selected
 for(i=0;i<4;i++) {
  document.getElementById('sm'+i).style.display='none';
 }

 document.getElementById(obj).style.display='block';
}

function divCorrect() {
 var contentLeft = document.getElementById('content_left');
 var content = document.getElementById('content');
 var contentRight = document.getElementById('content_right');


 // for the references
 if(!contentRight) {

  document.getElementById('div_content').style.visibility = "hidden";
  
  document.getElementById('div_content').style.width = content.offsetWidth + 245 + "px";

  var contentLeftHeight = contentLeft.offsetHeight;
  var contentHeight = content.offsetHeight;

  if(contentLeftHeight > contentHeight) var highest = contentLeftHeight;
  else var highest = contentHeight;

  contentLeft.style.height = highest + "px";
  content.style.height = highest + "px";
  
  document.getElementById('div_content').style.visibility = "visible";

 // normal page
 } else {

  var contentLeftHeight = contentLeft.offsetHeight;
  var contentHeight = content.offsetHeight;
  var contentRightHeight = contentRight.offsetHeight;

  if(contentLeftHeight > contentHeight) var highest = contentLeftHeight;
  else var highest = contentHeight;
  if(highest < contentRightHeight) highest = contentRightHeight;

  contentLeft.style.visibility = "hidden";
  content.style.visibility = "hidden";
  contentRight.style.visibility = "hidden";
  if(navigator.platform == "Win32" && navigator.appName == "Microsoft Internet Explorer" && window.attachEvent) {
	
   version = navigator.appVersion.match(/MSIE (\d+\.\d+)/, '\\1');

   if(version[1] >= 5.5 && version[1] < 7) {
    contentLeft.style.height = highest + 18 + "px";
    content.style.height = highest + 18 + "px";
    contentRight.style.height = (highest - 40) + "px";
   }

  } else {
   contentLeft.style.height = highest + "px";
   content.style.height = highest + "px";
   contentRight.style.height = highest + "px";
  }
  contentLeft.style.visibility = "visible";
  content.style.visibility = "visible";
  contentRight.style.visibility = "visible";

 }
}

if(typeof window.addEventListener != 'undefined') {
 window.addEventListener("load", divCorrect, false);
}
else if(typeof document.addEventListener != 'undefined') {
 document.addEventListener("load", divCorrect, false);
}
else if(typeof window.attachEvent != 'undefined') {
 window.attachEvent("onload", divCorrect);
}