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) && (version < 7)) 
   {
      $("DIV.acol_navi_content").each(function(i){
        var sHtml = "<div style='overflow:hidden;height:"+(this.offsetHeight+2)+"px;position:absolute;left:-3px;top:-2px;z-Index:100;'>";
            sHtml += "<img src=/promo/images/themen_bg_mid2l.png width=12 height=356 /></div>";
         $(this).append(sHtml);
         
         var sHtml2 = "<div style='overflow:hidden;height:"+(this.offsetHeight+2)+"px;position:absolute;right:0px;top:-2px;z-Index:100;'>";
            sHtml2 += "<img src=/promo/images/themen_bg_mid2r.png width=12 height=356 /></div>";
         $(this).append(sHtml2);
      });
      
      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;" + 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
         }
      }
   }
}

function correctTopNavHover()
{
    $("DIV#top_nav > UL > LI").each(function(i){
        var sClassName = "";
        if (($(this).attr("class") != null) && 
            ($(this).attr("class").indexOf("green") >= 0))
        {
            sClassName = "over_green";
        }
        else
        {
            sClassName = "over";
        }
        
        $(this).hover(
            function(){$(this).addClass(sClassName)},
            function(){$(this).removeClass(sClassName)}
        );
      });
}

function correctIt()
{
    correctPNG();
    //correctTopNavHover();
}

function getAbsPos(o, p)
{
    var i = 0;
    while (o != null)
    {
        i += o["offset" + p];
        o = o.offsetParent;
    }
    return i;
}

function openItem(id)
{
	$('ul#subnavigation ul').css('display', 'none');
	if($('ul#subnavigation a#' + id).next().css('display') == 'none') {
		$('ul#subnavigation a#' + id).next().css('display', 'block');
	} else {
		$('ul#subnavigation a#' + id).next().css('display', 'none');
	}
}

//window.attachEvent("onload", correctIt);
$(document).ready(function(){
    if(($.browser.msie) && (parseInt(jQuery.browser.version) <= 7)){
    	//$('#fw_headcol').css('width', '744px');
    }
    $('#pnav ul li a.current').removeClass('neighborGreen');
    $('#pnav ul li a.current').removeClass('iEneighborGreen');
    $('#pnav ul li a.current').removeClass('nonactive');
    $('#pnav ul li a.current').css('color', '#003473');
    correctIt();
    if($(".acol_navi .acol_navi_content .acol_navi_content_inner #subnavigation").html() == "") { 
    	$(".acol_navi .acol_navi_content .acol_navi_content_inner #subnavigation").parents(".acol_navi").css('display', 'none')
    }
    if($('.acol_navi .acol_navi_content .acol_navi_content_inner').children('img').size() > 0) {
    	$($('.acol_navi .acol_navi_content .acol_navi_content_inner').children('img')[$('.acol_navi .acol_navi_content .acol_navi_content_inner').children('img').size() - 1]).remove();
    	$('div.ccol_block_offer').css('display', 'block');
    }
    //if(!$.browser.msie) {
    	addStaticAgentParamDOM(' ');
    //}
    if(($.browser.msie) && ($.browser.version == 7)) {
        jQuery('.acol_navi_big, .acol_navi_big .acol_navi_top, .acol_navi_big .acol_navi_content, .acol_navi_big .accol_block_bottom').css('width', '454px');
        jQuery('.acol_navi_big .acol_navi_top img, .acol_navi_big .accol_block_bottom img').attr('width', '454');
    }
});

function openLink(url)
{
    window.location.href = addUrlParameter(url, 'agent', agent);
}