﻿//Online Application
function online_application(URL) { 
  F1 = open(URL,"Application","width=800,height=600,hotkeys=no,locationbar=no,menubar=no,status=no,resizable=yes,scrollbars=yes,toolbar=no,personalbar=no"); 
  F1.focus();
}

function DisplayAdvert(ElementID, ActionID){
var SkyscraperID = ElementID + "_Skyscraper";
    if (ActionID == 'show'){
        document.getElementById(SkyscraperID).style.display = 'inline';
        document.getElementById(ElementID).style.display = 'inline';
    }else{
        document.getElementById(SkyscraperID).style.display = 'none'; 
        document.getElementById(ElementID).style.display = 'none';
    }
}

/********************************************************************************/
/*
/*           Author: Frank Reckers
/* letzte Aenderung: 05.03.2004
/*
/********************************************************************************/
/* Patent-No.: 10 2004 027 616.1 - Messe Düsseldorf GmbH.
/********************************************************************************/
chars = new Array("a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","1","2","3","4","5","6","7","8","9","0","@","_","-",".",":"," ");
function decrypt(address) {
  var org_address = "";
  var new_address = address.toLowerCase();
  for (var i=0;i<new_address.length;i++) {
    for (var j=0;j<chars.length;j++) {
      if (new_address.substr(i,1)==chars[j]) {
        org_address += chars[j-1]; break;
      }
    }
  }
  return org_address;
}
/********************************************************************************/

function SearchEvents(language) {
  az_win = window.open('http://www.messe-duesseldorf.de/uptodate/cgi/uptodate/pub/a_z_opener.cgi?lang='+language, 'az', 'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=400,height=180,screenX=5,screenY=5,alwaysRaised=yes');
}
function Reminder(language) {
  win = window.open('http://www.messe-duesseldorf.de/uptodate/cipp/uptodate/pub/reminder,menu,main.reminder/lang,'+language, 'Reminder', 'toolbar=yes,location=yes,directories=yes,status=yes,menubar=yes,scrollbars=yes,resizable=yes,width=800,height=600,screenX=5,screenY=5,alwaysRaised=yes');
}

function main_item_check(link_headline){
  var link_status_akt = "";
  link_status_akt = get_main_item(); 
  if (link_headline == link_status_akt) {
    return 1;
  } else {
    return 0;
  }    
}

function status_scan(img_id, link_img_aktiv, link_headline, sub_id){
  var status_akt = main_item_check(link_headline);
  if (status_akt == 1) {
    document.getElementById(img_id).src=link_img_aktiv;
    if (sub_id != ''){
      document.getElementById(sub_id).style.display = "inline";
    }
  } else {
    if (sub_id != '') {
      document.getElementById(sub_id).style.display = "none";
    }
  }
}

function img_change(link_status,img_id,link_img, link_headline){
  if (link_status == 1) {
    document.getElementById(img_id).src=link_img;
  } else {
    var status_akt = main_item_check(link_headline);
    if (status_akt != 1){
      document.getElementById(img_id).src=link_img;
    }
  }
}

var aktuellerReiter = "reiter_0";
var aktuelleKarte   = "reiter_content_0";
function ReiterWechsel(neuerReiter, neueKarte){
  if(aktuellerReiter != neuerReiter){
    var Reiter = document.getElementById(neuerReiter);
    var Karte  = document.getElementById(neueKarte);
    var resetReiter = document.getElementById(aktuellerReiter);
    var resetKarte  = document.getElementById(aktuelleKarte);
    resetReiter.style.backgroundImage = "url(http://www.messe-duesseldorf.de/central_data/xml_files/content_pool/central_images/Reiter_Pressebereich/press_reiter.gif)";
    resetKarte.style.display = "none";
    Reiter.style.backgroundImage = "url(http://www.messe-duesseldorf.de/central_data/xml_files/content_pool/central_images/Reiter_Pressebereich/press_reiter_aktiv.gif)";
    Karte.style.display = "block";
    aktuellerReiter = neuerReiter;
    aktuelleKarte   = neueKarte;
    document.cookie = aktuellerReiter + ":" + aktuelleKarte;
  }
}

/* Platzhalter */
function ContentRider(rider_id, con_id){
    var ContentRider_Container_ID = "ContentRider_Container";
    var ContentRider_ID = "ContentRider";
    var FlagBody      = document.getElementById(ContentRider_Container_ID);
    var FlagChild    = FlagBody.firstChild; //Fdes Reiterinhaltes
    var FlagID        = document.getElementById(rider_id);
    
    var RiderChild    = document.getElementById(ContentRider_ID).firstChild;
  
    //Schleife, um die Div-Elemente auf none zu schalten
      while (FlagChild != null){
        if (FlagChild.nodeName == "DIV"){FlagChild.style.display = "none";}
        FlagChild = FlagChild.nextSibling;
      }
    while (RiderChild != null){
        if (RiderChild.nodeName == "LI"){RiderChild.className = "";}
        RiderChild = RiderChild.nextSibling;
      }    
      
      rider_id.parentNode.className = "active";
      document.getElementById(con_id).style.display = "block";
}
var currentConItem = "con-nav-0";
var currentContent   = "reiter_content_0";
function ContentSelector(neuerReiter, neueKarte){
  if(currentConItem != neuerReiter){
    var Reiter = document.getElementById(neuerReiter);
    document.getElementById(neuerReiter).setAttribute("class", "on");
    var Karte  = document.getElementById(neueKarte);
    var resetReiter = document.getElementById(currentConItem);
    document.getElementById(currentConItem).setAttribute("class", "off");
    var resetKarte  = document.getElementById(currentContent);    
    resetKarte.style.display = "none";
    Karte.style.display = "block";
    currentConItem = neuerReiter;
    currentContent   = neueKarte;
    document.cookie = currentConItem + ":" + currentContent;
  }
}
/* Platzhalter */
 
function display_switch(id) {
  if (document.getElementById(id).style.display == "none" ) {
    document.getElementById(id).style.display = "block";
  } else {
    document.getElementById(id).style.display = "none";
  }
}

function flagbar(flag_id, con_id){
  var MainTag   = flag_id.parentNode.parentNode;
  var FlagBody  = document.getElementById(con_id).parentNode;
  var FlagChild    = FlagBody.firstChild;
  while (FlagChild != null){
    if (FlagChild.nodeName == "DIV"){FlagChild.style.display = "none";}
    FlagChild = FlagChild.nextSibling;
  }
  for(var i_counter = 0; i_counter < MainTag.childNodes.length; i_counter++){
    if (MainTag.childNodes[i_counter].nodeName == "LI"){
       MainTag.childNodes[i_counter].style.backgroundImage = "url(http://www.messe-duesseldorf.de/central_data/xml_files/content_pool/central_images/reiter_bg.gif)";
    }
  }
  flag_id.parentNode.style.backgroundImage = "url(http://www.messe-duesseldorf.de/central_data/xml_files/content_pool/central_images/reiter_bg_sel.gif)";
  document.getElementById(con_id).style.display = "block";
}

// FLV Player (z. B. Service-ABC - Außenwerbung)
function switch_PlayListItem(ref_Item){
    $(ref_Item).up(1).getElementsBySelector('li').each(
        function (item){
            item.removeClassName('on');
        }
    );
    $(ref_Item).up(0).addClassName('on');
}
var class_FlvPlayer = Class.create();
class_FlvPlayer.prototype = {
    initialize: function(int_PlayerWidth, int_PlayerHeight){
        //Init FlashVars
        this.obj_FlashVars = {};
        this.obj_FlashVars.playerpath = "http://www.messe-duesseldorf.de/app/flvplayer";
        this.obj_FlashVars.skinscalemaximum = "1";
        this.obj_FlashVars.autoscale = "false";
        this.obj_FlashVars.skincolor = "0x265691";
        //Init Params
        this.obj_Params = {};
        this.obj_Params.scale = "noscale";
        this.obj_Params.allowfullscreen = "true";
        this.obj_Params.salign = "tl";
        //Init Attributes
        this.obj_Attributes = {};
        this.obj_Attributes.align = "center";
        //Init HtmlElementId
        this.str_HtmlElementId = "flvplayer";
        //Init Player Size
        this.obj_PlayerSize = {};
        this.obj_PlayerSize.width = int_PlayerWidth;
        this.obj_PlayerSize.height = int_PlayerHeight;
        //Init Player Source
        this.str_PlayerSource = "http://www.messe-duesseldorf.de/app/flvplayer/flvplayer.swf";
    },
    setPlayerPath: function(str_PlayerPath){
        this.obj_FlashVars.playerpath = str_PlayerPath;
    },
    setPlayerSource: function(str_PlayerSource){
        this.str_PlayerSource = str_PlayerSource;            
    },
    setSkin: function(str_Skin){
        this.obj_FlashVars.skin = str_Skin;
    },
    setHtmlElementId: function(str_EltId){
        this.str_HtmlElementId = str_EltId;            
    },
    setVideoSize: function(int_VideoWidth, int_VideoHeight){
        this.obj_FlashVars.videowidth = int_VideoWidth;
        this.obj_FlashVars.videoheight = int_VideoHeight;
    
    },
    setVideoFormat: function(str_VideoFormat){
        if(str_VideoFormat != "4:3"){
            this.obj_FlashVars.videoheight = parseInt((parseInt(this.obj_FlashVars.videowidth) / 16) * 9);
        }else{
            this.obj_FlashVars.videoheight = parseInt((parseInt(this.obj_FlashVars.videowidth) / 4) * 3);
        }
        this.obj_PlayerSize.height = this.obj_FlashVars.videoheight + 27;
    },
    loadFlvPlayer: function(str_FlvSrc, str_FlvPreview){
        this.obj_FlashVars.video = str_FlvSrc;
        this.obj_FlashVars.preview = str_FlvPreview;
        swfobject.embedSWF(this.str_PlayerSource, this.str_HtmlElementId, this.obj_PlayerSize.width, this.obj_PlayerSize.height, "9.0.28", "http://www.messe-duesseldorf.de/app/flvplayer/expressInstall.swf", this.obj_FlashVars, this.obj_Params, this.obj_Attributes);
    },
    playFlvVideo: function(str_FlvSrc, str_FlvPreview, str_FlvFormat){
        this.obj_FlashVars.autoplay = "true";
        this.obj_FlashVars.video = str_FlvSrc;
        this.obj_FlashVars.preview = str_FlvPreview;
        this.setVideoFormat(str_FlvFormat);
        swfobject.embedSWF(this.str_PlayerSource, this.str_HtmlElementId, this.obj_PlayerSize.width, this.obj_PlayerSize.height, "9.0.28", "http://www.messe-duesseldorf.de/app/flvplayer/expressInstall.swf", this.obj_FlashVars, this.obj_Params, this.obj_Attributes);            
    }
}

// Toggle Boxes (z. B. Service-ABC - Außenwerbung)
var bool_ToggleStatus = false;
function toggleContentTopicList(ref_ListItem){
    if (bool_ToggleStatus == false){
        if ($(ref_ListItem).getElementsByClassName('description')[0].style.display != 'block'){
              $A($(ref_ListItem).up(0).getElementsByClassName('description')).each(
                function(item){
                    if (item.style.display != "none"){
                        Effect.BlindUp(item, {
                        beforeStart: function(){
                            bool_ToggleStatus = true;
                        },                                                                
                        afterFinish: function(){
                            item.previous(0).className = "inactive";
                            item.style.display = "none";
                            ref_ListItem.down(0).className = "active";
                            Effect.BlindDown($(ref_ListItem).getElementsByClassName('description')[0], {
                                afterFinish: function(){
                                    $(ref_ListItem).getElementsByClassName('description')[0].style.display = "block";
                                    bool_ToggleStatus = false;
                                }                            
                            });                        
                        }});
                    }
                }
            
            );
        }
    }
}

// Toggle FactBox (z.B. Service-ABC - Außenwerbung im Sekundärinhalt einer Detailseite)
var bool_ToggleStatus = false;
function toggleFactBox(ref_Element){
    if (bool_ToggleStatus == false){
    bool_ToggleStatus = true;
    if ($(ref_Element).next(0).style.display == 'block'){
        Effect.BlindUp($(ref_Element).next(0), {duration:0.5, afterFinish: function(){
            $(ref_Element).next(0).hide();
            $(ref_Element).className = "inactive";
            bool_ToggleStatus = false;
        }});
    }else{
        Effect.BlindDown($(ref_Element).next(0),{duration:0.5, afterFinish: function(){
            $(ref_Element).next(0).show();
            $(ref_Element).next(0).style.display = 'block';
            $(ref_Element).className = "active";
            bool_ToggleStatus = false;
        }});                        
    }
    }
    
}

function startPlayer(FileURL, ElementID) 
{
    if (!ElementID){ElementID = 'FLV_Player';}
    var FO = {
        movie:"http://video.messe-duesseldorf.de/player/flash_flv_player/flvplayer.swf", 
        width:"390px",
        height:"293px", 
        majorversion:"7", 
        build:"0", 
        bgcolor:"#000000",
        allowfullscreen:"true",
        flashvars:"file="+FileURL+"&showdigits=false&autostart=true&repeat=false&fullscreenpage=http%3A%2F%2Fvideo.messe-duesseldorf.de%2Fplayer%2Ffullscreen.html&fsreturnpage="+escape(document.URL)+"&linkfromdisplay=false"
    };
    UFO.create(FO, ElementID);
}

function playSound(file, comment, ElementID) 
{
    if (!ElementID){ElementID = 'MP3_Player';}
    var FO = {
        movie:"http://video.messe-duesseldorf.de/player/flash_mp3_player/mp3player.swf",
        width:"390px",
        height:"40px",
        majorversion:"7",
        build:"0",
        bgcolor:"#000000",
        flashvars:"file="+file+"&title="+comment+"&repeat=false&lightcolor=0x6CCCCCC&autostart=true"
    };
    UFO.create(FO, ElementID);
}

// Son of suckerfish Menu
sfHover = function() {
    var sf = document.getElementById("navigation");
        if (!sf) {
          return;
        }
        
    var sfEls = sf.getElementsByTagName("LI");
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }
    
        var headnav = document.getElementById("suckerf");
        if (!headnav) return;
    var sfEls = headnav.getElementsByTagName("LI");
        if (!sfEls) return;
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" sfhover";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
        }
    }

        var headnav = document.getElementById("header");
        if (!headnav) return;
    var sfEls = headnav.getElementsByTagName("LI");
        if (!sfEls) return;
    for (var i=0; i<sfEls.length; i++) {
        sfEls[i].onmouseover=function() {
            this.className+=" over";
        }
        sfEls[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" over\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", sfHover);function close_ContentWindow(CW_ID){
     if (document.getElementById(CW_ID)){
        document.getElementById(CW_ID).style.display="none";
    }
}
function ContentWindow(){
    this.title        = "New Window";
    this.X_align     = 0;
    this.Y_align     = 0;
    this.L_time        = "normal";
    
    this.height        = 0;
    this.weight        = 0;
    this.Move_height        = 0;
    this.Move_weight        = 0;
    this.Z_index        = 2000;
    var Array_CW_Index    = new Array();
    var y;
    var x;
    this.create_ContentWindow = function(CW_ID, CW_Content, CW_POS_TAG){
    y = CW_POS_TAG.offsetTop;
    x = CW_POS_TAG.offsetLeft;
     
         if (!document.getElementById(CW_ID)){
         Array_CW_Index.push(CW_ID);
         this.Z_index++;
        var BodyTagID = document.getElementsByTagName("body")[0];
        var ContentWindow = document.createElement("div");
//            ContentWindow.setAttribute("class", "ContentWindow");
            ContentWindow.className = "ContentWindow";
            ContentWindow.setAttribute("id", CW_ID);
        var CW_TagHeader = document.createElement("span");
//            CW_TagHeader.setAttribute("class", "CW_Head");
            CW_TagHeader.className = "CW_Head";
        var CW_TagTitle =  document.createElement("span");
//            CW_TagTitle.setAttribute("class", "CW_Title");
            CW_TagTitle.className = "CW_Title";
            CW_TagTitle.innerHTML = this.title;
        var CW_TagClose =  document.createElement("span");
//            CW_TagClose.setAttribute("class", "CW_Close");
            CW_TagClose.className = "CW_Close";
            CW_TagClose.innerHTML = '';
        var CW_TagContent = document.createElement("span");
            CW_TagContent.setAttribute("class", "CW_Content");
            CW_TagContent.innerHTML = CW_Content;
            CW_TagHeader.appendChild(CW_TagTitle);
            CW_TagHeader.appendChild(CW_TagClose);
            
            ContentWindow.appendChild(CW_TagHeader);
            ContentWindow.appendChild(CW_TagContent);
            
            BodyTagID.appendChild(ContentWindow);
            document.getElementById(CW_ID).style.zindex = this.Z_index;
            if (this.height != 0){
                document.getElementById(CW_ID).style.height=parseInt(this.height)+'px';                                    
            }
            if (this.width != 0){
                document.getElementById(CW_ID).style.width=parseInt(this.width)+'px';                                    
            }
            if (this.X_align != 0){
                document.getElementById(CW_ID).style.left=this.X_align+"px";                                
            }else{
                    parseInt(this.Move_width);
                    document.getElementById(CW_ID).style.left=x+this.Move_width+"px";
                    if (parseInt(document.getElementById(CW_ID).style.left) < 10){
                        document.getElementById(CW_ID).style.left=10+"px";                        
                    }
                
            }
            if (this.Y_align != 0){
                document.getElementById(CW_ID).style.left=this.Y_align+"px";                                
            }else{
                    parseInt(this.Move_height);
                    document.getElementById(CW_ID).style.top=y+this.Move_height+"px";
                    if(parseInt(document.getElementById(CW_ID).style.top) < 10){
                        document.getElementById(CW_ID).style.top=10+"px";                        
                    }            
            }
        }else{
            if (this.X_align != 0){
                document.getElementById(CW_ID).style.left=this.X_align+"px";                                
            }else{
                    parseInt(this.Move_width);
                    document.getElementById(CW_ID).style.left=x+this.Move_width+"px";
                    if (parseInt(document.getElementById(CW_ID).style.left) < 10){
                        document.getElementById(CW_ID).style.left=10+"px";                        
                    }
                
            }
            if (this.Y_align != 0){
                document.getElementById(CW_ID).style.left=this.Y_align+"px";                                
            }else{
                    parseInt(this.Move_height);
                    document.getElementById(CW_ID).style.top=y+this.Move_height+"px";
                    if(parseInt(document.getElementById(CW_ID).style.top) < 10){
                        document.getElementById(CW_ID).style.top=10+"px";                        
                    }            
            }         
            document.getElementById(CW_ID).style.display="inline";            
        }
    
    if (this.L_time == "radio"){
        for (var i = 0; i < Array_CW_Index.length; i++){
            if (Array_CW_Index[i] != CW_ID){
                document.getElementById(Array_CW_Index[i]).style.display="none";                            
            }
        }
    }
    
    }
}
    
var isFF = (navigator.appName.indexOf("Netscape") !=-1);
// Funktion für die Positionierung der DefinitionBox an der Maus
function WindowPos(e){
x = (isFF) ? e.pageX : event.clientX + document.body.scrollLeft;
y = (isFF) ? e.pageY : event.clientY + document.body.scrollTop;
}
if (isFF){document.captureEvents(Event.MOUSEMOVE);}
document.onmousemove = WindowPos;//Begin
var ContactWindow = new ContentWindow();
ContactWindow.title = "Ihr Ansprechpartner";
//ContactWindow.X_align = 200;
ContactWindow.width = 350;
ContactWindow.height = 150;
ContactWindow.Move_height = +85;
ContactWindow.Move_width = -60;
ContactWindow.L_time = "radio";
