/* ------------------------------------------------------------------------------------------- */
/* otelo.global.js - VERSION 0.0.2 - DATE 2010/09/01 */
/* ------------------------------------------------------------------------------------------- */
/* PUBLISHING DATE Mittwoch, 1. September 2010 15:06 */
/* ------------------------------------------------------------------------------------------- */
// GLOBAL VARS - BEGIN
if(!window.VF) {
  VF = new Object();
}
VF.randomNumber = Math.floor(Math.random()*1000000000000000000);
VF.includeLoginLoaded = false;

// GLOBAL VARS - END 

// OMNITURE MICROPAGE SETTING SCRIPT - BEGIN
function omnitureSetContentToMicropage() {
    if(s.prop23 && s.prop22 && s.prop21) {
        s.prop23 = s.prop22;
        s.prop22 = s.prop21;
        s.prop21 = s.channel;
    }
    if(!s.prop23 && s.prop22 && s.prop21) {
        s.prop23 = s.prop22;
        s.prop22 = s.prop21;
        s.prop21 = s.channel;
    }
    if(!s.prop23 && !s.prop22 && s.prop21) {
        s.prop22 = s.prop21;
        s.prop21 = s.channel;
    }
    if(!s.prop23 && !s.prop22 && !s.prop21) {
        s.prop21 = s.channel;
    }
    if(s.channel) {
        s.channel = "Mircopages";
    }
    if(s.hier1) {
        s.hier1 = "Micropages/" + s.hier1;
    }
    if(s.pageName) {
        s.pageName = "Micropages:" + s.pageName;
    }
}
// OMNITURE MICROPAGE SETTING SCRIPT - END
// OMNITURE TEASER TRACKING SCRIPT - BEGIN
$(window).load(function() {
    $("a[class*='trackingTeaser']").click(function(){
        if (window.s) {
            varClassNames = $(this).attr("class");
            varHref = $(this).attr("href");
            varTeaserID = varClassNames.substring(varClassNames.indexOf("trackingTeaser") + 14, varClassNames.indexOf("Click"));
            varClickType = varClassNames.substr(varClassNames.indexOf("Click") + 5, 1);
            if (varHref.indexOf("?") != -1) {
                varHref = varHref + "&";
            }
            else {
                varHref = varHref + "?";
            }
            varHref = varHref + "icmp=" + s.pageName + ":" + varTeaserID + "::" + varClickType;
            $(this).attr("href", varHref);
        }
    });
    $("div[class*='trackingTeaser']").each(function(){
        if (window.s) {
            varClassNames = $(this).attr("class");
            varTeaserID = varClassNames.substr(varClassNames.indexOf("trackingTeaser") + 14, 6);
            if (s.prop30) {
                s.prop30 += "," + s.pageName + ":" + varTeaserID;
            }
            else {
                s.prop30 = s.pageName + ":" + varTeaserID;
            }
        }
    });
});
// OMNITURE TEASER TRACKING SCRIPT - END
// FLASH LOADER - BEGIN
function flash_detect() {
  var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
  var isWin = (navigator.appVersion.indexOf("Windows") != -1) ? true : false;
  var flashVer = 0;
  flash2Installed = false;
  flash3Installed = false;
  flash4Installed = false;
  flash5Installed = false;
  flash6Installed = false;
  flash7Installed = false;
  flash8Installed = false;
  flash9Installed = false;
  flash10Installed = false;
  flash11Installed = false;
  flash12Installed = false;
  if(isIE && isWin) {
    document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
    document.write('on error resume next \n');
    document.write('flash2Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.2"))) \n');
    document.write('flash3Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.3"))) \n');
    document.write('flash4Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.4"))) \n');
    document.write('flash5Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.5"))) \n');
    document.write('flash6Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.6"))) \n');
    document.write('flash7Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.7"))) \n');
    document.write('flash8Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.8"))) \n');
    document.write('flash9Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.9"))) \n');
    document.write('flash10Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.10"))) \n');
    document.write('flash11Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.11"))) \n');
    document.write('flash12Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.12"))) \n');
    document.write('</SCR' + 'IPT\> \n');
  }
  if(navigator.plugins) {
    if(navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
      var isVersion2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
      var flashDescription = navigator.plugins["Shockwave Flash" + isVersion2].description;
      var flashVersion = parseInt(flashDescription.substr(flashDescription.indexOf(".")-1, 1 ));
      if (flashVersion == 0) {
        var flashVersion = parseInt(flashDescription.substr(flashDescription.indexOf(".")-2, 2 ));
      }
      flash2Installed = flashVersion == 2;
      flash3Installed = flashVersion == 3;
      flash4Installed = flashVersion == 4;
      flash5Installed = flashVersion == 5;
      flash6Installed = flashVersion == 6;
      flash7Installed = flashVersion == 7;
      flash8Installed = flashVersion == 8;
      flash9Installed = flashVersion == 9;
      flash10Installed = flashVersion == 10;
      flash11Installed = flashVersion == 11;
      flash12Installed = flashVersion == 12;
    }
  }
  for(var i = 2; i < 13; i++) {
    if (eval("flash" + i + "Installed") == true) flashVer = i;
  }
  return flashVer;
}
function flash_show(requiredFlashVer, film_name, film_breite, film_hoehe, ersatz_grafik, alt_tag, fallback_link, fallback_link_target) {
  flashVer = flash_detect();
  if(flashVer < requiredFlashVer || !film_name) {
    if(fallback_link != "") {
      document.write('<a href="'+fallback_link+'" target="'+fallback_link_target+'"><img src="'+ersatz_grafik+'" alt="'+alt_tag+'" width="'+film_breite+'" height="'+film_hoehe+'"></a>');
    } else {
      document.write('<img src="'+ersatz_grafik+'" alt="'+alt_tag+'" width="'+film_breite+'" height="'+film_hoehe+'">');
    }
  } else {
    if(flash_show.arguments && flash_show.arguments.length >= 7 && (typeof(flash_show.arguments[6])!='undefined')) {
      var param = '?'+flash_show.arguments[6];
    } else {
      var param = '';
    }
    document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"         codebase="https://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,0,0" width="'+film_breite+'" height="'+film_hoehe+'">');
    document.write('<param name=movie value="'+film_name+param+'">');
    document.write('<param name=quality value=high>');
    document.write('<param name=wmode value=opaque>');
    document.write('<embed src="'+film_name+param+'" quality=high pluginspage="https://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" wmode="opaque" width="'+film_breite+'" height="'+film_hoehe+'"></embed>');
    document.write('</object>');
  }
}
// FLASH LOADER - END
// IE6 Notice
var oldBrowserHintUrl = 'http://www.vodafone.de/privat/service/vodafone-internet-explorer-8.html';

$(window).load(function() {               
    var isDebug = false;                
        
    if (($.browser.msie === true && $.browser.version == 6) || navigator.userAgent.toLowerCase().match(/(msie 6.0)/) || isDebug) {                         
      showOldBrowserHint();      
    }
});
          
function showOldBrowserHint(){            
  
  if(!$.cookie('oldBrowserHintShown')){
  
    var div = document.createElement('DIV');
    div.id = 'divOldBrowserHint';
    div.style.cssFloat = 'left';
    div.style.styleFloat = 'left';    
    div.style.paddingTop = '30px';    
    //div.style.marginTop = '-10px';
    //div.style.marginBottom = '15px';      
    div.style.paddingLeft = '2px';                

    var map = document.createElement('MAP');
    map.name = 'mapIE6Notice';
    map.id = 'mapIE6Notice';
    document.body.appendChild(map);

    var areaIE8 = document.createElement('AREA');
    areaIE8.shape = 'rect';
    areaIE8.coords = '678,6,733,55';
    areaIE8.href = oldBrowserHintUrl;
    $('#mapIE6Notice')[0].appendChild(areaIE8);

    var areaFF = document.createElement('AREA');
    areaFF.shape = 'rect';
    areaFF.coords = '745,5,800,59';
    areaFF.href = 'http://www.mozilla-europe.org/de/firefox/';
    areaFF.target = '_blank';
    areaFF.onclick = function(){ oldBrowserHintUrl=''; }
    $('#mapIE6Notice')[0].appendChild(areaFF);

    var areaSafari = document.createElement('AREA');
    areaSafari.shape = 'rect';
    areaSafari.coords = '813,6,858,55';
    areaSafari.href = 'http://www.apple.com/de/safari/';
    areaSafari.target = '_blank';
    areaSafari.onclick = function(){ oldBrowserHintUrl=''; }
    $('#mapIE6Notice')[0].appendChild(areaSafari);

    var areaChrome = document.createElement('AREA');
    areaChrome.shape = 'rect';
    areaChrome.coords = '864,5,922,58';
    areaChrome.href = 'http://www.google.com/chrome';
    areaChrome.target = '_blank';
    areaChrome.onclick = function(){ oldBrowserHintUrl=''; }
    $('#mapIE6Notice')[0].appendChild(areaChrome);

    


                       
      var img = document.createElement('IMG');
      img.id = 'imgOldBrowserHint';
      img.style.cursor = 'pointer';
      img.src = '/images/otelo/ie6er.gif';
      img.useMap = '#mapIE6Notice';
      div.appendChild(img);      
      
      var divBtn = document.createElement('DIV');
      divBtn.style.position = "absolute";
      divBtn.style.top = '80px';
      divBtn.style.left = '934px';      
      divBtn.style.width = '19px';
      divBtn.style.height = '20px';
      divBtn.style.backgroundColor = 'yellow';
      
      divBtn.style.backgroundImage = 'url(/images/otelo/iE6-Hinweis_2a-3-x.jpg)';
        
      div.appendChild(divBtn);

      $($('.divContent')[0]).prepend(div);
                    
      div.onclick = function(){       
        if(oldBrowserHintUrl != '') location.href = oldBrowserHintUrl;      
      }          

      divBtn.onclick = function(){
        oldBrowserHintUrl = '';
        $.cookie('oldBrowserHintShown', '1');          
        div.style.display = 'none';                  
      }
  }
}
// IE6 Notice End