// EventBroadcaster + Prototype Start
if (!Array.prototype.push)
{
    Array.prototype.push = function()
    {
        for (var i = 0, ii = arguments.length; i < ii; i++)
        {
            this[this.length] = arguments[i];
        }
        return this.length;
    };
}
var EventBroadcaster = new Object();
EventBroadcaster.init = function(obj)
{
    obj._listeners = new Array();
    obj.broadcastMessage = this._broadcastMessage;
    obj.addListener = this._addListener;
    return obj;
};
EventBroadcaster._broadcastMessage = function(method)
{
    var listeners = this._listeners;
    var i = listeners.length;
    while (i--)
    {
        var listener = listeners[i];
        if (listener[method])
        {
            listener[method]();
        }
    }
};
EventBroadcaster._addListener = function(obj)
{
    this._listeners.push(obj);
    return true;
};
window.onload = function()
{
    this.broadcastMessage('onload');
};
EventBroadcaster.init(window);
// EventBroadcaster + Prototype End
document.getElementsByClassName = function(className, tagName)
{
 var elementsByClassName = [];
 if (this.getElementsByTagName)
 {
  var elements = (tagName) ? this.getElementsByTagName(tagName) : this.all || this.getElementsByTagName('*');
  for (var i = 0, ii = elements.length; i < ii; i++)
  {
   var element = elements[i];
   var elementClassName = element.className;
   var elementHasClassName = false;
   if (className == elementClassName)
   {
    elementHasClassName = true;
   }
   else if (elementClassName.indexOf(' ') != -1)
   {
    var elementClassNames = elementClassName.split(' ');
    for (var k = 0, kk = elementClassNames.length; k < kk; k++)
    {
     if (className == elementClassNames[k])
     {
      elementHasClassName = true;
      break;
     }
    }
   }
   if (elementHasClassName)
   {
    elementsByClassName.push(element);
   }
  }
 }
 return elementsByClassName;
};
var BlurElements = new Object();
window.addListener(BlurElements);
BlurElements.onload = function()
{
    // Text- u. Grafik-Links
    lnks=document.getElementsByTagName('a');
    for(i=0;i<lnks.length;i++){
        lnks[i].onfocus=new Function("if(this.blur)this.blur()");
    }
    
    // ImageMaps
    lnks=document.getElementsByTagName('area');
    for(i=0;i<lnks.length;i++){
        lnks[i].onfocus=new Function("if(this.blur)this.blur()");
    }
    /*
    // Klick-Buttons
    lnks=document.getElementsByTagName('Verweis');
    for(i=0;i<lnks.length;i++){
        lnks[i].onfocus=new Function("if(this.blur)this.blur()");
    }
    */
};
swapPageSend = function(element) {
    this.Node = element;
    this.swapContents = document.getElementsByClassName('swapContent');
    for(i=0; i < this.swapContents.length; i++)
    {
        if(this.swapContents[i].parentNode==this.Node || this.swapContents[i].parentNode.parentNode==this.Node)
        {
            if(this.swapContents[i].className.indexOf('swapContentShow')==-1){
                this.swapContents[i].className+= " swapContentShow";
                if(document.getElementById && document.getElementById('pageSendEmail'))
                {
                    document.getElementById('pageSendEmail').focus();
                }
            } else {
                this.swapContents[i].className = this.swapContents[i].className.replace(new RegExp(" swapContentShow\\b"), "");
            }
        }
    }
}
/* Navigation Functions  */
var ScrollUpActiveNavElt = new Object;
window.addListener(ScrollUpActiveNavElt);
ScrollUpActiveNavElt.onload = function()
{
    scrolled = false;
    if (document.getElementById)
        {
        if(document.getElementById('navProdSearchScrollToTop'))
        {
            document.getElementById('navProdSearchScrollToTop').scrollIntoView(true);
            scrolled = true;
        }
        if(document.getElementById('navScrollToTop'))
        {
            document.getElementById('navScrollToTop').scrollIntoView(true);
            scrolled = true;
        }
        if(document.getElementById('faqScrollToTop'))
        {
            document.getElementById('faqScrollToTop').scrollIntoView(true);
            scrolled = true;
        }
        if(document.getElementById('glossaryScrollToTop'))
        {
            document.getElementById('glossaryScrollToTop').scrollIntoView(true);
            scrolled = true;
        }
        if (scrolled)
        {
            document.getElementById('viewport').scrollIntoView(false);
            document.getElementById('logo').scrollIntoView(false);
        }
    }
};

/* Select Search Term when input field is focused */
var FocusSearchTerm = new Object();
window.addListener(FocusSearchTerm);
FocusSearchTerm.onload = function() {
    if(document.getElementById && document.getElementById("searchTop") && (document.getElementById("searchTop").value != ""))
    {
        document.getElementById("searchTop").onfocus = function () { this.select() };
    }
};


/* Print Style Functions  */
/*
function addLoadEvent(func) {
  var oldonload = window.onload;
  if (typeof window.onload != 'function') {
    window.onload = func;
  } else {
    window.onload = function() {
      if (oldonload) {
        oldonload();
      }
      func();
    }
  }
}
addLoadEvent( function(){ add_print_link( 'header' ) } );
function add_print_link( id ){
  if( !document.getElementById ||
      !document.getElementById( id ) ) return;
  // add extra functions to page tools list
  var print_page = document.getElementById( id );
  // create print link
  var print_function = document.createElement('p');
  print_function.className = 'print-link';
  print_function.onclick = function(){ print_preview(); return false; };
  print_function.appendChild( document.createTextNode( 'Print the Page' ) );
}
*/

var pic_small = new Array;

var printOnLoadIfVarIsSet = new Object();
window.addListener(printOnLoadIfVarIsSet);
printOnLoadIfVarIsSet.onload = function()
{
//    alert(document.location.URL);
    URLString = document.URL;
    QueryStringGiven = URLString.indexOf("?");
    if (QueryStringGiven != -1)
    {
//        alert(URLString);
        querystring = URLString.substring(QueryStringGiven,URLString.length);
//        alert(querystring);
        printThisPage = querystring.indexOf("printThisDoc=true");
//        alert(printThisPage);
        if(printThisPage != -1)
        {
            print_preview();
        } else 
        {
            return false;
        }
    }
}


function print_preview_loader() {
    if(document.getElementsByClassName('submittedData','p').length==1)
    {
        window.print();
    } else {
        if(document.location.search && (document.location.search!="")) {
            popupPath = document.location.href+'&printThisDoc=true';
        } else {
            popupPath = document.location.href+'?printThisDoc=true';
        }
        popup = window.open(popupPath,'popup',"width=650,height=600,scrollbars=yes,resizable=yes");
    }    
}


function print_preview() {
    // Switch the stylesheet
    setActiveStyleSheet('Print Preview');
    
    // Create preview message
    add_preview_message();
    // Print the page
    setTimeout("window.print()",750);
    // window.print();
    
    // show big images
    changeImages('toBig');    

}


function add_preview_message(){
var main_content = document.getElementById('header');
var main_body = main_content.parentNode;
    if (document.getElementById){
        
        var preview_message = document.createElement('div');
        preview_message.id = 'preview-message';
    
        // Create Heading
        var preview_header = document.createElement('h3');
        var preview_header_text = document.createTextNode('This is a print preview of this page');
        preview_header.appendChild(preview_header_text);     
   
        // Create paragraph
        var preview_para = document.createElement('p');
//        var preview_para_text = document.createTextNode('Without this message of course.');
        var preview_para_text = document.createTextNode(' ');
        
        var cancel_function_link = document.createElement('a');
            cancel_function_link.onclick = function(){ cancel_print_preview(); return false; };
            cancel_function_link.setAttribute('href', '#');
            cancel_function_link.setAttribute('id', 'printPreviewCancel');
        var cancel_function_link_text = document.createTextNode('Close this window.');
        
        var create_span_tag_as_spacer = document.createElement('span');
        var create_span_tag_as_spacer_text = document.createTextNode('  ');
        
        var print_this_document_link = document.createElement('a');
            print_this_document_link.onclick = function(){ print_this_document_now(); return false; };
            print_this_document_link.setAttribute('href', '#');
            print_this_document_link.setAttribute('id', 'printPreviewPrintNow');
        var print_this_document_link_text = document.createTextNode('Print this page.');
        
        cancel_function_link.appendChild(cancel_function_link_text);
        create_span_tag_as_spacer.appendChild(create_span_tag_as_spacer_text);
        print_this_document_link.appendChild(print_this_document_link_text);
        
        // for adding printPreviewMessage remove this line
        // preview_para.appendChild(preview_para_text);
        preview_para.appendChild(cancel_function_link);
        // preview_para.appendChild(create_span_tag_as_spacer);
        // preview_para.appendChild(print_this_document_link);
        
        // Put it all toegether
        // for adding printPreviewMessage remove this line
        // preview_message.appendChild(preview_header); 
        preview_message.appendChild(preview_para);
        main_body.insertBefore(preview_message, main_content);
    }
}
function cancel_print_preview() {
    // Destroy the preview message
    if(opener!=null) {
        window.close();
    } else {
        var print_preview = document.getElementById('preview-message');
        var main_body = print_preview.parentNode;
        main_body.removeChild(print_preview);
        
        // Switch back stylesheet
        setActiveStyleSheet('default');

        // Switch back big images
        changeImages('toSmall');

    }
}
function print_this_document_now() {
    window.print();
}
function setActiveStyleSheet(title) {
   var i, a, main;
   for(i=0; (a = document.getElementsByTagName("link")[i]); i++) {
     if(a.getAttribute("rel").indexOf("style") != -1
        && a.getAttribute("title")) {
       a.disabled = true;
       if(a.getAttribute("title") == title) a.disabled = false;
     }
   }
}

function changeImages(title)
{
   var i, a, pic1, pic2;
   
   // Change small images to big ones
   if(title == "toBig") {
     if(document.getElementsByClassName('imageZoomer')) {
       for(i=0; (a = document.getElementsByClassName('imageZoomer','a')[i]); i++) {
         pic2 = a.getAttribute("href");
         pic1 = a.childNodes[0];
         // save attributes of small pic in temp var
         pic_small[i] = a.childNodes[0].cloneNode(true);
         pic1.src = pic2;
         pic1.removeAttribute("width");
         pic1.removeAttribute("height");                            
       }
     }
   }  
   // Switch back big images    
   if(title == "toSmall") {
      if(document.getElementsByClassName('imageZoomer')) {
        for(i=0; (a = document.getElementsByClassName('imageZoomer','a')[i]); i++) {
           pic1 = a.childNodes[0];
           // load attributes from temp var
           pic1.src = pic_small[i].getAttribute("src");
           pic1.width = pic_small[i].getAttribute("width");
           pic1.height = pic_small[i].getAttribute("height");
        }
     }   
   }
}


/* FAQ Scripting */
var ActiveNaviItems = new Array();
var Navi = new Object;
window.addListener(Navi);
Navi.onload = function()
{
 if (document.getElementById && document.getElementsByTagName)
 {
  if(document.getElementsByClassName('faqThemeList', 'div')[0]){
   var item;
   var items = document.getElementsByClassName('faqThemeList', 'div')[0].getElementsByTagName('li');
   for (var i = 0, ii = items.length; i < ii; i++)
   {
    if(items[i].getElementsByTagName('a')[0].className.indexOf("active")!=-1) {
        FaqActivate(items[i].getElementsByTagName('a')[0]);
    }
    if((window.location.hash!="") && (window.location.hash.indexOf("faqItem")!=-1) && (document.getElementById(window.location.hash.substr(1)))) {
        var byHashLinkedFaq = document.getElementById(window.location.hash.substr(1));
        FaqActivate(byHashLinkedFaq);
        byHashLinkedFaq.parentNode.scrollIntoView(true);
        document.getElementById('viewport').scrollIntoView(false);
        document.getElementById('logo').scrollIntoView(false);
    }
    if(items[i].parentNode.parentNode.className!='faqThemeList') {
     item = new NaviItem(items[i].getElementsByTagName('a')[0]);
    }
   }
  }
 }
};
var NaviItem = function(element)
{
 this.Node = element;
 this.Node.obj = this;
 this.Node.css = this.Node.parentNode.className;
 this.Node.subList = this.Node.parentNode.getElementsByTagName('ul')[0];
 if (this.Node.css.indexOf('active') == -1)
 {
  if(this.Node.subList){
   this.Node.subList.className += " hiddenList";
  }
  this.Node.onclick = this.activate;
  this.Node.onmouseover=function() {
  this.className+=" mfghover";
  }
  this.Node.onmouseout=function() {
   this.className=this.className.replace(new RegExp(" mfghover\\b"), "");
  }
 }else{
  this.Node.onclick = this.deactivate;
 }
};
NaviItem.prototype.activate = function()
{
 var newActiveItem = ActiveNaviItems.push(this);
 var compareParentNode = this.parentNode.parentNode;
 var siblingsToDeactivate = this.parentNode.parentNode.getElementsByTagName('a');
 var sibling;
 for (var i = 0, ii = siblingsToDeactivate.length; i < ii; i++)
 {
  sibling = siblingsToDeactivate[i];
  if(sibling.parentNode.parentNode==compareParentNode){
   sibling.deactivate;
   sibling.parentNode.className = sibling.parentNode.className.replace(new RegExp("active\\b"), "");
   sibling.onclick = sibling.obj.activate;
  }
 }
 this.highLight = FaqActivate;
 this.highLight(this);
 
 
 if(this.href){
  return true;
 }else{
  this.onclick = this.obj.deactivate;
  return false;
 }
};
NaviItem.prototype.deactivate = function()
{
 this.parentNode.className = this.parentNode.className.replace(new RegExp("active\\b"), "");
 this.onclick = this.obj.activate;
 return false;
};
FaqActivate = function(element){
 this.Node = element;
 if(this.Node.parentNode.className.indexOf("Theme")==-1){
  this.Node.parentNode.className = "active";
  if(this.Node.parentNode.parentNode.className.indexOf("faqThemeList")==-1){
   FaqActivate(this.Node.parentNode.parentNode);
  }else{
   return false;
  }
 }
}
/* FAQ swap */
var FaqSwap = new Object;
window.addListener(FaqSwap);
FaqSwap.onload = function()
{
    if(document.getElementsByClassName('faqQuestion','h4') && document.getElementsByClassName('faqQuestion','h4').length > 0)
    {
        if(document.getElementsByClassName('faqThemeList', 'div')[0]){
            var item;
            var FaqsToSwap = document.getElementsByClassName('faqQuestion','h4');
            for (var i = 0, ii = FaqsToSwap.length; i < ii; i++)
            {
                item = new FaqSwapItem(FaqsToSwap[i]);
            }
        }
    }
};
var FaqSwapItem = function(element)
{
    this.Node = element;
    this.Node.onclick = this.activate
};
    FaqSwapItem.prototype.activate = function()
    {
        this.setAct = FaqSwapShow;
        this.setAct(this);
    }
FaqSwapShow = function(element){
    this.Node = element;
    if(this.Node.parentNode.className.indexOf("Active")==-1)
    {
        this.Node.parentNode.className += " faqBlockActive";
    } else {
        this.Node.parentNode.className = this.Node.parentNode.className.replace(new RegExp(" faqBlockActive\\b"), "");        
    }
}

/* URL-Switch for dropdown navigation elements */
switchLocation = function(element){
    this.Node = element;
    this.Node.obj = this;
    this.Node.forwardURL = this.Node.options[this.Node.options.selectedIndex].value;
    if(this.Node.forwardURL && this.Node.forwardURL!="") {
        // checkParentNodeTag(this.Node, "form").submit();
        this.Node.form.submit();
    }
}

// this function is obsolete, but keep it a while ;o)
checkParentNodeTag = function(element, tag)
{
    this.Node = element;
    if(this.Node.parentNode.tagName.toLowerCase() != tag.toLowerCase())
    {
        return checkParentNodeTag(this.Node.parentNode, tag);
    }else
    {
        return this.Node.parentNode;
    }
}



/* Browser Check function */
browserChk = function(){
 if(document.ids)x='nc4';
 else if( document.all && !document.getElementById )x='ie4';
 else if( window.opera && !document.createElement )x='op5';
 else if( window.opera && window.getComputedStyle )  {
     if(document.createRange)x='op7.6'; 
    else if(window.navigate)x='op7.5';
         else x='op7.2';                   }
 else if( window.opera && document.compatMode )x='op7';
 else if( window.opera && document.releaseEvents )x='op6';
 else if( document.contains && !window.opera )x='kq3';
 else if( window.getSelection && window.atob )x='nn7';
 else if( window.getSelection && !document.compatMode )x='nn6';
 else if( window.clipboardData && document.compatMode )x='ie6';
 else if( window.clipboardData ){x='ie5';
   if( !document.createDocumentFragment ) x+='.5';
   if( document.doctype && !window.print ) x+='m';}
 else if( document.getElementById && !document.all ) x='op4';
 else if( document.images && !document.all ) x='nn3';
 else x='???';  
 return x;
}


/* Genious Image Layer Function */
var zoomCanvas;
var ShowLayersForBigImages = new Object;
window.addListener(ShowLayersForBigImages);
ShowLayersForBigImages.onload = function()
{
    var imagesToZoom = document.getElementsByClassName('imageZoomer','a');
    if(imagesToZoom.length > 0) 
    {
        var mainContent = document.getElementById('header');
        var mainBody = mainContent.parentNode;
        zoomCanvas = document.createElement('div');
        zoomCanvas.setAttribute('id', 'zoomCanvas');
//        var zoomCanvasText = document.createTextNode('');
        
//        zoomCanvas.appendChild(zoomCanvasText); 
//        zoomCanvas.style.display = "none";
        
        mainBody.insertBefore(zoomCanvas, mainContent);
        
        var item;
        for (var i = 0, ii = imagesToZoom.length; i < ii; i++)
        {
            item = new zoomImage(imagesToZoom[i]);
        }
    }
}
zoomImage = function(element){
    this.Node = element;
    this.Node.obj = this;
    this.Node.onclick = function() { this.obj.zoom(); return false; };
}
zoomImage.prototype.zoom = function(){
    // get path
    this.Node.zoomImage = this.Node.href;
    
    // setting Width for Images by classname
    var regExpWidth = /imgXB([0-9]+)imgXE/;
    regExpWidth.exec(this.Node.className);
    this.Node.zoomImageWidth = RegExp.$1;
    var regExpHeight = /imgYB([0-9]+)imgYE/;
    regExpHeight.exec(this.Node.className);
    this.Node.zoomImageHeight = RegExp.$1;
    
    this.Node.zoomImageWidth = parseInt(this.Node.zoomImageWidth);
    this.Node.zoomImageHeight = parseInt(this.Node.zoomImageHeight);
    // get Canvas
    this.Node.zoomCanvas = zoomCanvas;
    this.Node.zoomCanvasDragable = new Draggable('zoomCanvas', {revert:false});
    // set canvas position by cursor position
    this.Node.zoomCanvas.style.left = curPosX + 10 + "px";
    this.Node.zoomCanvas.style.top = curPosY + 10 + "px";
    
    zoomCanvas.childNodeNumber = zoomCanvas.childNodes.length;
    if(zoomCanvas.childNodeNumber>=1)
    {
        for (i = 0; i < zoomCanvas.childNodeNumber; i++){
            zoomCanvas.removeChild(zoomCanvas.firstChild);
        }
    }
    
    
    // create IMG, set ID and SRC
    this.Node.zoomCanvasImage = document.createElement('img');
        this.Node.zoomCanvasImage.setAttribute('id', 'zoomCanvasImage');
        this.Node.zoomCanvasImage.setAttribute('src', this.Node.zoomImage);
    // create Canvas tools
    this.Node.zoomCanvasClose = document.createElement('a');
    this.Node.zoomCanvasClose.setAttribute('id', 'zoomCanvasClose');
    this.Node.zoomCanvasClose.style.width = (this.Node.zoomImageWidth+20) + 'px';
    this.Node.zoomCanvasClose.onclick = function() { 
        if(browserChk().indexOf("op")==-1)
        {
            new Effect.DropOut(this.parentNode); 
            if(zoomCanvas.childNodeNumber>=1)
            {
                for (i = 0; i < zoomCanvas.childNodeNumber; i++){
                    setTimeout("zoomCanvas.removeChild(zoomCanvas.firstChild)", 500);
                }
            }
            setTimeout("new Effect.Opacity(zoomCanvas, { sync: false, to: 1.0 } )", 750);
    //        return false; 
        } else
        {
            zoomCanvas.style.display = 'none';
        }
    };
    this.Node.zoomCanvasCloseText = document.createTextNode(' ');
    this.Node.zoomCanvasClose.appendChild(this.Node.zoomCanvasCloseText);
    
    this.Node.zoomCanvas.appendChild(this.Node.zoomCanvasClose);
    this.Node.zoomCanvas.appendChild(this.Node.zoomCanvasImage);
    zoomCanvas.style.display = "block";
    zoomCanvas.style.width = this.Node.zoomImageWidth;
    return false;
}
var curPosX = 0;
var curPosY = 0;
function getPosition(e) {
    e = e || window.event;
    var cursor = {x:0, y:0};
    if (e.pageX || e.pageY) {
        cursor.x = e.pageX;
        cursor.y = e.pageY;
    } 
    else {
        var de = document.documentElement;
        var b = document.body;
        cursor.x = e.clientX + 
            (de.scrollLeft || b.scrollLeft) - (de.clientLeft || 0);
        cursor.y = e.clientY + 
            (de.scrollTop || b.scrollTop) - (de.clientTop || 0);
    }
    curPosY = cursor.y;
    curPosX = cursor.x;
    return cursor;
}
var setCursorPosOnMouseDown = new Object;
window.addListener(setCursorPosOnMouseDown);
setCursorPosOnMouseDown.onload = function()
{
    document.onmousedown = getPosition;
}


/* Highlight focussed inputs and texareas */
var sfFocus = new Object;
window.addListener(sfFocus);
sfFocus.onload = function()
{
    sfEls = document.getElementsByClassName("activeField");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onfocus=function() {
            this.className+=" activeFieldFocus";
        }
        sfEls[i].onblur=function() {
            this.className=this.className.replace(new RegExp(" activeFieldFocus\\b"), "");
        }
    }
}



/* redirect User via Javascript within x second */
var redirectUser = new Object;
window.addListener(redirectUser);
redirectUser.onload = function()
{
    this.Node = document.getElementById('redirectURL');
    if(this.Node){
        this.counter         = 10;
        this.spacer         = "&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;...";
        this.display         = this.Node.innerHTML;
        this.targetURL         = this.Node.href;
        this.active = window.setInterval("redirectCountdown()", 1000);
    }
}
redirectUser.write = function()
{
    if(this.Node.innerHTML.indexOf(this.spacer)==-1)
    {
        this.Node.innerHTML += this.spacer + this.counter;
    }else{
        newTmp = this.spacer + (this.counter); 
        oldTmp = this.spacer + (this.counter+1); 
        this.Node.innerHTML = this.Node.innerHTML.replace(oldTmp,newTmp);
    }
}
redirectCountdown = function()
{
    redirectUser.counter--;
    redirectUser.write();
    if(redirectUser.counter==0)
    {
        clearInterval(redirectUser.active);
        window.location.href = redirectUser.targetURL;
    }
}


/* Show Dropdown in full length in IE */
/* disabled at request 07-06-12 */
var switchOn = true;
setAbsAndOnTop = function(element,switcher,caller)
{
    if("Work" == "Work")
    {
        // can I add an onclick when ocl is called? so the doubleclicking could be avoided..
        if(browserChk().indexOf("ie")!=-1)
        {
            this.Node = element;
            if(switcher && switchOn)
            {
                document.getElementById(this.Node.id).parentNode.className="setAbsOnTop";
                document.getElementById(this.Node.id).style.width = 'auto';
                switchOn = false;
            }else
            {
                document.getElementById(this.Node.id).parentNode.className="";
                document.getElementById(this.Node.id).style.width = '13em';
                switchOn = false;
            }
            if(caller=='och') this.Node.blur();
            if(caller=='ocl' || this.Node.blur) switchOn = true;
        }
    }
}
if (!Array.prototype.forEach)
{
  Array.prototype.forEach = function(fun /*, thisp*/)
  {
    var len = this.length;
    if (typeof fun != "function")
      throw new TypeError();
    var thisp = arguments[1];
    for (var i = 0; i < len; i++)
    {
      if (i in this)
        fun.call(thisp, this[i], i, this);
    }
  };
}
var hideDownloadDescriptions = new Object;
window.addListener(hideDownloadDescriptions);
hideDownloadDescriptions.onload = function()
{
    // jump in if DL-Center is given
    if(document.getElementById('downloadCenterTable'))
    {
        this.Node = document.getElementById('downloadCenterTable');
        
        // search links by classname
        this.Node.linkDescriptionLayers = document.getElementsByClassName('linkWithLayer', 'a');
        // set onmouseover- and onmouseout-function
        this.Node.linkDescriptionLayers.forEach(setMouseOver);
    }
}
var setCursorPosOnMouseMove = new Object;
window.addListener(setCursorPosOnMouseMove);
setCursorPosOnMouseMove.onload = function()
{
    document.onmousemove = getPosition;
}
function setMouseOver(element, index, array) {
    this.Link = element;
    this.Link.Description = element.parentNode.getElementsByTagName('div')[0];
    if(this.Link.Description)
    {
        this.Link.onmouseover = function() 
        {
            element.parentNode.getElementsByTagName('div')[0].style.left = Math.round(curPosX/15) + "em";
            element.parentNode.getElementsByTagName('div')[0].className += " descriptionVisible";
        }
        this.Link.onmouseout = function() 
        {
            element.parentNode.getElementsByTagName('div')[0].className = element.parentNode.getElementsByTagName('div')[0].className.replace(new RegExp(" descriptionVisible\\b"), "");
        }
    }
}


/* Download-Center automatically start the download action! */
function createRequestObject() {
    var ro;
    var browser = navigator.appName;
    if(browser == "Microsoft Internet Explorer") {
        try {
            ro = new ActiveXObject("Microsoft.XMLHTTP");
        }
        catch(e) {
            return false;
        }
    } else {
        ro = new XMLHttpRequest();
    }
    httpCreated = true;
    return ro;
}
var httpCreated = false;
var http = createRequestObject();

function sndReq(path, action) {
    if((path.indexOf("vID") == -1) || (!httpCreated)) {
        window.location = path;
    } else 
    {
        http.open('get', path + '&vJS='+action);
        http.onreadystatechange = handleResponse;
        http.send(null);
    }
}
function handleResponse() {
    if(http.readyState == 4){
        var response = http.responseText;
        var update = new Array();
        if(response.indexOf('|' != -1)) {
            update     = response.split('|');
            state     = update[1].split('///');
            update[1] = state[1];
            switch(state[0])
            {
                case "true":
                    setTimeout("window.location = document.getElementById('fileLink').href",200);
                break;
                case "false":
                    document.getElementById(update[0]).innerHTML = update[1];
                    document.getElementById(update[0]).href="";
                    document.getElementById(update[0]).className="fileLinkError";
                break;
                default:
                    alert(update[0]);
                break;
            }
        }
    }
}
var addAutoLoaderFunctionToDownloadLink = new Object;
window.addListener(addAutoLoaderFunctionToDownloadLink);
addAutoLoaderFunctionToDownloadLink.onload = function()
{
    if(document.getElementById("fileLink") && document.getElementById("fileLink").href!="")
    {
        setTimeout("sndReq(document.getElementById('fileLink').href, true)",1200);
        document.getElementById('fileLink').onclick = function() { sndReq(document.getElementById('fileLink').href, true); return false; };
        return false;
    }
}





/* Download Center - functions for product pre-selection after product family selection */
/*                   checkListByPattern() is a sub function of markProducts() */

function checkListByPattern( docID, searchPattern )
{
    var validContent = new Array();
    var invalidContent = new Array();
    var selected = "null";
    
    for( var n=0; n<document.getElementById( docID ).options.length ; n++ )
    {
        if( n==0 || searchPattern.exec( document.getElementById( docID ).options[n].text ))
            validContent.push( new Array( document.getElementById( docID ).options[n].value , document.getElementById( docID ).options[n].text ));
        else
            invalidContent.push( new Array( document.getElementById( docID ).options[n].value , document.getElementById( docID ).options[n].text ));
        if( document.getElementById( docID ).options[n].selected == true )
            selected = document.getElementById( docID ).options[n].value;
    }
    var content = validContent.concat(invalidContent);
    for( var n=0; n<document.getElementById( docID ).options.length ; n++ )
    {
        document.getElementById( docID ).options[n].value = content[n][0];
        document.getElementById( docID ).options[n].text = content[n][1];
        if( n<validContent.length )
        {
            document.getElementById( docID ).options[n].style.backgroundColor="#1E539E" ;
            document.getElementById( docID ).options[n].style.color="#FFFFFF" ;
        }
        else
        {
            document.getElementById( docID ).options[n].style.backgroundColor="#FFFFFF" ;
            document.getElementById( docID ).options[n].style.color="#000000" ;
        }
        if( document.getElementById( docID ).options[n].value == selected )
            document.getElementById( docID ).options[n].selected = true;
    }
    return true;
}
    

function markProducts( family ) 
{        
    switch( family ) 
    {
        case "153A4BC254BB4884968DF6909C969E6A": // Analyzers
            checkListByPattern( 'selectorProduct', /^MTS/ );
        break;    
        case "688F49CFC52B42C1B62E4419A923AAEF": // ASCET
            checkListByPattern( 'selectorProduct', /^ASCET/ );
        break;            
        case "F9D75AE26CD84B5FAD72FA0DA22635B2": // ES400
            checkListByPattern( 'selectorProduct', /^ES4\d\d$/ );
        break;
        case "188E34D2B92446FF8DBBAAFFA9EC9245": // ES500
            checkListByPattern( 'selectorProduct', /^ES5\d\d$/ );
        break;
        case "2FDD775AEDBE423795F2F145271EE350": // ES600
            checkListByPattern( 'selectorProduct', /^(ES6\d\d)( .*)?$/ );
        break;
        case "6DB5840D2C2F4D06892C29A60F08A513": // ES700
            checkListByPattern( 'selectorProduct', /^ES7\d\d.*$/ );
        break;
        case "5A3DB73FA1CB4AA6882BBD6D6B4E7EF3": // ES900
            checkListByPattern( 'selectorProduct', /^ES9\d\d$/ );
        break;
        case "5F68C6A895CB4DCE8E11098155777EC9": // ES1000-4000
            checkListByPattern( 'selectorProduct', /^(ES|PB)(1|4)\d\d\d$/ );
        break;
        case "A91F526CE7014ACCBB5CF603E1D2FC8A": // ETK
            checkListByPattern( 'selectorProduct', /ETK/ );
        break;
        case "A6071F1789E14136B90BF8C9CD0E8492": // INCA
            checkListByPattern( 'selectorProduct', /^(INCA|ODX|CaliAV)/ );
        break;
        case "19E5EE7D72434A41929019E0B6246F04": // INTECRIO
            checkListByPattern( 'selectorProduct', /^INTECRIO/ );
        break;
        case "1D873F4FB2AE457C80F72A8C4BA1BE30": // LABCAR SW
            checkListByPattern( 'selectorProduct', /LABCAR/ );
        break;
        case "5F6317EE59CD497B9F17E3E9EB383540": // RTA
            checkListByPattern( 'selectorProduct', /^RTA/ );
        break;
        case "430F51A81CE242F88E0C5747CD7379DA": // Lambda
            checkListByPattern( 'selectorProduct', /^(AWS2|LA4)/ );
        break;
        case "AE764BB5FC544E3E99A84524C7761771": // Scan Testers
            checkListByPattern( 'selectorProduct', /^Tech 2$/ );
        break;
        case "58F04E539C7E4AFD98315B4925C8BBE6": // Standards
            checkListByPattern( 'selectorProduct', /^(FlexRay|AUTOSAR)$/ );
        break;
        case "5C05150998F846028DDB1FF4A87A20CA": // VIM
            checkListByPattern( 'selectorProduct', /^ES65\d\d$|J2534/ );
        break;
        case "C10A21D6C66E486185F509242CFAF889": // EHOOKS
            checkListByPattern( 'selectorProduct', /^EHOOKS/ );
        break;

    }                
}

/* End Download Center - functions for product pre-selection after product family selection */




document.write('<style type="text/css"> .swapContent { display: none; } #navPageTools li#pagePrint { display:inline; } .faqQuestion { cursor: pointer; } .faqThemeList ul li ul { display:none; } #faqQuestionAnswerHeadline, .faqAnswer { display: none; }  /* #directProductAccessSelect { width: 14.8em; }*/ #directProductAccessSubmit { display: none; }  #regionalInfoSubmit { display:none; } #regionLanguageSelector {width: 14em;} #regionLanguageSelectorSubmit {display: none;} #downloadCenterTable .linkDescription { display: none; }</style>');

 document.write('<style type="text/css"> .descriptionVisible { padding: 1em; border: 0.09em solid #92A6B9; width: 23em; } </style>');