﻿$(document).ready(function() {
    /* rounded corner infobox module */
    // $("div.infoboxred").corner("bottom 5px");
    // $("div.infoboxgrey").corner("bottom 5px");
    /* /rounded corner infobox module */

    /* sIFR font replacement */
    if(typeof sIFR == "function"){
        sIFR.replaceElement(named({sSelector:"blockquote p", sFlashSrc:"/cms/graphics/common/polo22kr.swf", sColor:"#969696", sBgColor:"#FFFFFF"}));
        sIFR.replaceElement(named({sSelector:"blockquote cite", sFlashSrc:"/cms/graphics/common/polo22kr.swf", sColor:"#969696", sBgColor:"#FFFFFF"}));
    };
    /* /sIFR font replacement */
    /* infobox accordion */    
    if ($('#col_marginal .ui-accordion').length) {
        jQuery('#col_marginal_content').Accordion({
            header: 'div.infobox_header',
            alwaysOpen: false,
            animated: true,
            showSpeed: 200,
            hideSpeed: 600
        });
    }
    /* /infobox accordion */     
    /* add infoneedles to a map */
    if ($('#flashcontent_589').length && $('#col_marginal .ui-accordion').length) {
        var aLocation = $('#col_marginal .ui-accordion .infobox_content .location');
        var aPosX = $('#col_marginal .ui-accordion .infobox_content .mapPosX');        
        var aPosY = $('#col_marginal .ui-accordion .infobox_content .mapPosY');        
        var tNeedle = "";
        
        for (var i=0; i<aLocation.length; i++) {
            tNeedle = '<div class="needle" id="needle_'+i+'" style="position:relative; left:'+aPosX[i].innerHTML+'px; top:'+aPosY[i].innerHTML+'px;"><img src="/cms/graphics/common/red_dot.gif" alt="'+aLocation[i].innerHTML+'" \/><span>'+aLocation[i].innerHTML+'<\/span><\/div>';
            $("#flashcontent_589").after(tNeedle);
        }
        $(".needle").hide();
        $("#needle_0").show();
        $('.infobox_header').click(function () {
            $(".needle").hide();
            var index = $(".infobox_header").index(this);
            if ($("#needle_" + index).length) {
                $("#needle_" + index).show();
            }
        });
    }
    /* /add infoneedles to a map */

});

/* E.ON Countersystem */ 
function count_page() {  
  if (typeof _eBU == 'undefined' || _eBU == 'BU_EINSETZEN') {
    _eBU = window.location.hostname;
  }
  if (typeof _ePAGE == 'undefined') {
    _ePAGE = window.location.pathname;
  }
  _eTRACKER = '//count.eon.com/cgi-bin/count/';
  _ePROT = window.location.protocol;
  _eTAG = '' + _ePROT + _eTRACKER + _eBU + _ePAGE; 
  if (parent.location == document.referrer) {
    _eTAG += '?ref=' + escape(parent.document.referrer);
  } else {
    _eTAG += '?ref=' + escape(document.referrer);
  };
  _eTAG += window.location.search.replace(/\?/,"&");
  if (typeof _ePARAMEXT !== 'undefined') { _eTAG += '&' + _ePARAMEXT; };
  _eI = new Image();
  _eI.src= _eTAG;
  return true;
}
function count_file(OBJ) {
   var _eDATEI = OBJ.pathname;
   _eI = new Image();
   _eI.src = _ePROT+_eTRACKER+_eBU+"/"+_eDATEI+"?ref="+escape(document.URL);
   return true;
}
function count_extlink(OBJ) {
   var _eEXTLINK = escape(OBJ.href);
    _eI = new Image();
    _eI.src = _ePROT+_eTRACKER+_eBU+"/linktrack?"+_eEXTLINK;
    return true;
}
/* /E.ON Countersystem */
