﻿// -------------------------------------------------------------------------------------------
// CONTENT CLASS: JS Container - Vodafone Global ESCHBORN - Strategic Design II - (vodafone.global.js)
// PAGENAME: JS Container - Vodafone Global ESCHBORN - Strategic Design II - (vodafone.global.js)
// PAGEID: 179312
// FILENAME: vodafone.global.js
// PATH: /scripts/vodafone.global.js
// PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA
// STATUS: PUBLISH READY---MANUAL BUILD
// -------------------------------------------------------------------------------------------
// VERSION: 5.0.0
// LAST CHANGES: 2011-06-08
// PUBLISHING DATE: 2011-06-08 
// -------------------------------------------------------------------------------------------

// -[SNIPPETS >>>]----------------------------------------------------------------------------

/* CONTENT CLASS: JS Snippet - GlobalVars- Strategic Design II - (for include only!) PAGENAME: JS Snippet - GlobalVars- Strategic Design II - (for include only!)  PAGEID: 180927 STATUS: PUBLISH Ready!
VERSION: 1.0.0 LAST CHANGES: 2011-3-20 PUBLISHING DATE: 2011-05-09 08:44:37 Global Vars*/
if (typeof window.VF === 'undefined') { VF = {}; }VF.wwwHost = config.wwwHost; VF.shopHost = 'shop.vodafone.de';if(typeof VF.toolBarEnabled === 'undefined') { VF.toolBarEnabled=true;}var arrayUrlParameter = []; VF.randomNumber = Math.floor(Math.random()*1000000000000000000);VF.includeLoginLoaded = false; VF.lastPublishInfo='2011-05-09 08:44:37';
if(typeof VF.displayedOffer === 'undefined') { VF.displayedOffer = 0;}if(typeof VF.SubscriptionsCount === 'undefined') { VF.SubscriptionsCount = 0;}if(typeof VF.isLoggedIn === 'undefined') { VF.isLoggedIn = (false);}if(typeof VF.isAngebotePage === 'undefined') { VF.isAngebotePage = false;}
if(!document.location.host === VF.wwwHost){ $('head').append('<style type="text/css">ul.ulNavigationTop { visibility: hidden;}</style>'); }

/* -------------------------------------------------------------------------------------------*/

/* CONTENT CLASS: JS Snippet - vodafone.global.js Basic - Strategic Design II - (for include only!)  PAGENAME: JS Snippet - vodafone.global.js Basic - Strategic Design II - (for include only!) PAGEID: 177757
VERSION: 5.0.1 PUBLISH READY!! LAST CHANGES: 2011-03-19*/
/*OMNITURE MICROPAGE SETTING SCRIPT - BEGIN*/
function omnitureSetContentToMicropage() { s.prop23 = s.prop22||null;  s.prop22 = s.prop21||null; s.prop21 = s.channel||null; s.channel = (s.channel)?"Mircopages":null;  s.hier1 = (s.hier1)?"Micropages/" + s.hier1:null;  s.pageName =(s.pageName)? "Micropages:" + s.pageName:null;}
/*OMNITURE MICROPAGE SETTING SCRIPT - END*/
/* OMNITURE TEASER TRACKING SCRIPT - BEGIN*/
//var attachTeaserTracking = function() { $("a[class*='trackingTeaser']").click(function(){if(window.s){varClassNames=$(this).attr("class");varHref=$(this).attr("href");if(document.location.host==='shop.vodafone.de'||document.location.host==='service.vodafone.de'){varHref=(varHref.search(/^\/\w+/)!==-1)?"//"+VF.wwwHost+varHref:varHref;}varTeaserID=varClassNames.substring(varClassNames.indexOf("trackingTeaser")+14,varClassNames.indexOf("Click"));varClickType=varClassNames.substr(varClassNames.indexOf("Click")+5,1);varHref+=(varHref.indexOf("?")!=-1)?'&':'?';s.pageName=s.pageName.replace(/ for shop#200/g,"");varHref+="icmp="+escape(s.pageName+":"+varTeaserID+"::"+varClickType);$(this).attr("href",varHref);}});};
var attachTeaserTracking=function(){$("a[class*='trackingTeaser']").live('click',function(){if(window.s){arrClassNames=$(this).attr("class").split(" ");for(i=arrClassNames.length-1;i>=0;i--){if(arrClassNames[i].indexOf('trackingTeaser')>-1){varClassNames=arrClassNames[i];break;}}varHref=$(this).attr("href");if(document.location.host==='shop.vodafone.de'||document.location.host==='service.vodafone.de'){varHref=(varHref.search(/^\/\w+/)!==-1)?"//"+VF.wwwHost+varHref:varHref;}varTeaserID=varClassNames.substring(varClassNames.indexOf("trackingTeaser")+14,varClassNames.indexOf("Click"));varClickType=varClassNames.substr(varClassNames.indexOf("Click")+5,1);if(varClassNames.indexOf("ProdId")>-1){varProdId=varClassNames.substr(varClassNames.indexOf("ProdId")+6,varClassNames.length);}else{varProdId="";}varHref+=(varHref.indexOf("?")!=-1)?'&':'?';s.pageName=s.pageName.replace(/ for shop#200/g,"");varHref+="icmp="+escape(s.pageName+":"+varTeaserID+":"+varProdId+":"+varClickType);$(this).attr("href",varHref);}});};
//var attachATGTeaserTracking = function() {$("a[class*='triggerAtg']").click(function(){if(window.s){varClassNames=$(this).attr("class");varHref=$(this).attr("href");varTeaserID=varClassNames.substring(varClassNames.indexOf("triggerAtg")+10,varClassNames.indexOf("Slot"));varSlot=varClassNames.substring(varClassNames.indexOf("Slot")+4,varClassNames.indexOf("Prod"));varProdID=varClassNames.substring(varClassNames.indexOf("Prod")+4,varClassNames.indexOf("Cat"));varCat=varClassNames.substr(varClassNames.indexOf("Cat")+3,1);s.pageName=s.pageName.replace(/ for shop#200/g,"");varCompSring=s.pageName+":"+varTeaserID+":"+varProdID+":"+varCat;varHref+=(varHref.indexOf("?")!==-1)?'&':'?';varHref+="icmp="+escape(varCompSring);$(this).attr("href",varHref);}});};
var attachATGTeaserTracking=function(){$("a[class*='triggerAtg']").live('click',function(){if(window.s){var arrClassNames=$(this).attr("class").split(" ");for(i=arrClassNames.length-1;i>=0;i--){if(arrClassNames[i].indexOf('triggerAtg')>-1){varClassNames=arrClassNames[i];break;}}var varHref=$(this).attr("href");var varTeaserID=varClassNames.substring(varClassNames.indexOf("triggerAtg")+10,varClassNames.indexOf("Slot"));var varSlot=varClassNames.substring(varClassNames.indexOf("Slot")+4,varClassNames.indexOf("Prod"));var varProdID=varClassNames.substring(varClassNames.indexOf("Prod")+4,varClassNames.indexOf("Cat"));var varCat=varClassNames.substring(varClassNames.indexOf("Cat")+3,varClassNames.indexOf("OfferId"));var varOfferId=varClassNames.substring(varClassNames.indexOf("OfferId")+7,varClassNames.indexOf("OfferCampCode"));var varOfferCampCode=varClassNames.substring(varClassNames.indexOf("OfferCampCode")+13,varClassNames.indexOf("OfferCellCode"));var varOfferCellCode=varClassNames.substring(varClassNames.indexOf("OfferCellCode")+13,varClassNames.length);s.pageName=s.pageName.replace(/ for shop#200/g,"");var varCompSring=s.pageName+":"+varTeaserID+":"+varProdID+":"+varOfferId+":"+varCat;varHref+=(varHref.indexOf("?")!==-1)?'&':'?';varHref+="icmp="+escape(varCompSring);$(this).attr("href",varHref);}});};
var attachTeaserTrackingTabBox=function(){$('div[class*="trackingTeaser"] > .divSubjectModule > .divTabbedNavigationSmall > div > a').each(function(){pid=$(this).parent().attr('id').replace(/[a-zA-Z]/g,"");tid=$(this).parents('div[class*="trackingTeaser"]').attr('id').replace(/[a-zA-Z]/g,"");$(this).addClass('trackingTeaser'+tid+'Click2ProdId'+pid)});$('div[class*="trackingTeaser"] > .divSubjectModule > .divTabbedNavigationSmall > div > div > div > a ').each(function(){pid=$(this).parents('div[class*="divTab"]').attr('id').replace(/[a-zA-Z]/g,"");tid=$(this).parents('div[class*="trackingTeaser"]').attr('id').replace(/[a-zA-Z]/g,"");$(this).addClass('trackingTeaser'+tid+'Click3ProdId'+pid)});};
/*OMNITURE TEASER TRACKING SCRIPT - END*/
// FLASH LOADER - BEGIN
function flash_detect() {
    var minSupported=2;    var maxSupported = 10; var i;
    if($.browser.msie &&  (navigator.appVersion.indexOf("Windows") !== -1)) {
        document.write('<scr' + 'ipt type="text/javascript" \> \n');
           for(i=minSupported;i<=maxSupported;i++){ document.write( 'var fl'+i+'Installed = false;'); }
        document.write('</scr' + 'ipt\> \n');
        document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n');
        document.write('on error resume next \n');
            for(i=minSupported;i<=maxSupported;i++){    document.write('fl'+i+'Installed = (IsObject(CreateObject("ShockwaveFlash.ShockwaveFlash.'+i+'"))) \n'); }
        document.write('</SCR' + 'IPT\> \n');
        i = maxSupported ; 
       while(i>=minSupported) {    if (eval("fl" + i +"Installed") === true){ return  i;}i--; }
   }  
  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 ),10);
      if (flashVersion === 0) {
         flashVersion = parseInt(flashDescription.substr(flashDescription.indexOf(".")-2, 2 ),10);
      }
      return flashVersion;
    }
  }
  return 0;
};
function flash_show(requiredFlashVer, film_name, film_breite, film_hoehe, ersatz_grafik, alt_tag, fallback_link, fallback_link_target) {
 var browserInfo = GetBrowserInfo();
 var param = '';
 var writeLns = '';
 var grafikLn = '<img src="'+ersatz_grafik+'" alt="'+alt_tag+'" width="'+film_breite+'" height="'+film_hoehe+'">';
 if(flash_detect() < requiredFlashVer || !film_name) {
 if(fallback_link !== "") { writeLns = '<a href="'+fallback_link+'" target="'+fallback_link_target+'">'+grafikLn+'</a>'; } else { writeLns = grafikLn; }
 } else {
 if(flash_show.arguments && flash_show.arguments.length >= 7 && (typeof(flash_show.arguments[6])!=='undefined')) { param = '?'+flash_show.arguments[6]; }
 writeLns ='<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+'">';
 writeLns +='<param name=movie value="'+film_name+param+'">';
 writeLns +='<param name=FlashVars value="browserType='+browserInfo.type+'&browserVersion='+browserInfo.version+'">';
 writeLns +='<param name=quality value=high>';
 writeLns +='<param name=wmode value=opaque>';
 writeLns +='<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>';
 writeLns +='</object>';
 }
 document.write(writeLns);
}
function ParseUserAgentForBrowserName(browserName, separator){  var info = null;  var userAgent = navigator.userAgent;   var pos = userAgent.indexOf(browserName);    try {if(pos >= 0){ info = {}; info.type = browserName;  var buf = userAgent.substr(pos + browserName.length +1);  var endPos = buf.indexOf(separator); info.version = buf.substr(0, endPos); return info; } return null;  } catch(e){  return null;  }}
function GetBrowserInfo(){var ret;  var pos = -1; var info = {};  var userAgent = navigator.userAgent;  var browserNameFirefox = 'Firefox';  var browserNameIE = 'MSIE';  var browserNameOpera = 'Opera';  var browserNameChrome = 'Chrome';  var browserNameSafari = 'Safari';  info.type = userAgent;  info.version = '0';    
  if(ret = ParseUserAgentForBrowserName(browserNameFirefox, ' ')){ return ret;} if(ret = ParseUserAgentForBrowserName(browserNameIE, ';')){ return ret; }   if(ret = ParseUserAgentForBrowserName(browserNameOpera, ' ')){ return ret; }   if(ret = ParseUserAgentForBrowserName(browserNameChrome, ' ')){ return ret;}          
  try {  if(userAgent.indexOf(browserNameSafari) !==-1){ if(userAgent.indexOf('Version')!==-1){  info.type = browserNameSafari; var buf = userAgent.substr(userAgent.indexOf('Version')+ ('Version').length +1);  var endPos = buf.indexOf(' '); info.version = buf.substr(0, endPos);  return info;  }  }  } catch(e){  return info;  }   return info; }
// FLASH LOADER - END
// INFODOK SEARCH - BEGIN
function createXHR() {  var request = false; try { request = new ActiveXObject('Msxml2.XMLHTTP'); } catch (err2) { try { request = new ActiveXObject('Microsoft.XMLHTTP'); } catch (err3) { try { request = new XMLHttpRequest(); } catch (err1) { request = false; } }} return request;}
function searchInfoDok(numberInfoDok, pageId) {  var xhr= createXHR(); var url = "/infofaxe/" + numberInfoDok + ".pdf";  xhr.open("HEAD", url, true);  xhr.onreadystatechange=function() {    document.getElementById("messageInfoDok" + pageId).style.display = "";    document.getElementById("loadInfoDok" + pageId).style.display = "none";    document.getElementById("messageInfoDok" + pageId).innerHTML = "<strong>Suche nach InfoDok " + numberInfoDok + "...</strong>";if(xhr.readyState === 4) { var value; if(xhr.status === 200) {  value = " InfoDok " + numberInfoDok + " vorhanden."; document.getElementById("messageInfoDok" + pageId).style.display = "none";   document.getElementById("loadInfoDok" + pageId).style.display = ""; document.getElementById("linkInfoDok" + pageId).href = url;  document.getElementById("linkInfoDok" + pageId).innerHTML = "InfoDok " + numberInfoDok + " jetzt downloaden"; } else {  if(xhr.status===404) { document.getElementById("messageInfoDok" + pageId).style.display = ""; value = "<strong>InfoDok " + numberInfoDok + " nicht vorhanden!</strong>"; document.getElementById("loadInfoDok" + pageId).style.display = "none";  }} document.getElementById("messageInfoDok" + pageId).innerHTML=value; } }; xhr.send(null); }
function resetSearchInfoDok(pageId) { document.getElementById("messageInfoDok" + pageId).style.display = "none"; document.getElementById("loadInfoDok" + pageId).style.display = "none";  document.getElementById("inputInfoDok" + pageId).value = "";}
// INFODOK SEARCH - END
//Helper for explode and organize Querystring in URL--BEGIN
function returnEncodedAndPreparedQuery(str,encodeMode){ switch(encodeMode){ case 'decodeURI':  case 'unescape':str = decodeURI(str);  break; } return str.replace(/[+]/g,"-").replace(/\?/,"").replace(/\?/,"&"); }
//Helper for explode and organize Querystring in URL--END
// URL-PARAMETERS - BEGIN
function setGlobalArrayUrlParams(array){  var varValue = "";  for (i=0;i<array.length;i++) {varValue = array[i].split("="); arrayUrlParameter[varValue[0]] = varValue[1]; } }
function getUrlParameters() {  if(window.location.search !== "") { setGlobalArrayUrlParams( returnEncodedAndPreparedQuery(window.location.search,'none').split('&')); } }
function changePreSelect() { if(arrayUrlParameter.TarifID) { document.getElementById(arrayUrlParameter.TarifID).click(); } }
// URL-PARAMETERS - END
// URL-PARAMETERS DECODE-URI - BEGIN
function getUrlParametersDecodeURI() {  if(window.location.search !== "") { setGlobalArrayUrlParams( returnEncodedAndPreparedQuery(window.location.search,'decodeURI').split('&')); }}
// URL-PARAMETERS DECODE-URI - END
// URL-PARAMETERS UNESCAPE - BEGIN
function getUrlParametersUnescape() {   if(window.location.search !== "") { setGlobalArrayUrlParams(returnEncodedAndPreparedQuery(window.location.search,'unescape').split('&'));}}
// URL-PARAMETERS UNESCAPE - END
// WEB2.0 - BEGIN
function jah(url,target) { window.status = "loading ...";  if(window.XMLHttpRequest) {var req = new XMLHttpRequest();  req.onreadystatechange = function() {jahDone(target);}; req.open("GET", url, true); req.send(null);   } else if(window.ActiveXObject) { req = new ActiveXObject("Microsoft.XMLHTTP");  if(req) {  req.onreadystatechange = function() {jahDone(target);};  req.open("GET", url, true); req.send(); } } }
function launchJavascript(responseText) {  var ScriptFragment = '(?:<scr'+'ipt.*?>)((\n|.)*?)(?:</scr'+'ipt>)';  var match = new RegExp(ScriptFragment, 'img');  var scripts = responseText.match(match); if(scripts) { var js = ''; for(var s = 0; s < scripts.length; s++) { var match = new RegExp(ScriptFragment, 'im'); js += scripts[s].match(match)[1]; } eval(js); } }
function jahDone(target) { if(req.readyState === 4) { if(req.status === 200) {var results = req.responseText; document.getElementById(target).innerHTML = results; launchJavascript(results); window.status = ""; } else { window.status = "error: " + req.statusText; } } }
// WEB2.0 - END
// ACCORDION SEARCH - BEGIN
function changeSE(varIDLink, varIDForm, varFunction) { if(varFunction === "close") {document.getElementById(varIDForm).style.display = "none"; document.getElementById(varIDLink).className = "aAccordion closed"; document.getElementById(varIDLink).href = "javas"+"cript:void(changeSE('idSE1', 'searchExtended', 'open'))"; }  if(varFunction === "open") { document.getElementById(varIDForm).style.display = "block"; document.getElementById(varIDLink).className = "aAccordion open"; document.getElementById(varIDLink).href = "java"+"script:void(changeSE('idSE1', 'searchExtended', 'close'))"; } }
// ACCORDION SEARCH - END
// COOKIE LESEN - BEGIN
function getCookie(NameOfCookie) {if(document.cookie.length > 0){  var begin = document.cookie.indexOf(NameOfCookie+"=");  if(begin !== -1) { begin += NameOfCookie.length+1;var end = document.cookie.indexOf(";", begin);  if(end === -1) { end = document.cookie.length; } return unescape(document.cookie.substring(begin, end)); } }return null; }
// COOKIE LESEN- END 
// ALLE COOKIES FUER STARS LESEN - BEGIN
function catch_cookie_stars() { return null;}
// ALLE COOKIES FUER STARS LESEN - END 
// COOKIE-FARBE ERMITTELN - BEGIN
function catch_cookie_color(vodafone_status) { switch(vodafone_status) {  case "10005": case "10004": return"rot";  case "10003": return"silber"; case "10002": return"gold"; case "10001": return"platin"; default: return""; }}
// ALLE COOKIES FUER STARS LESEN - END
// ANZAHL DER BONUSPUNKTE ANZEIGEN - BEGIN
function show_cookie_points(cookie_text) { var vodafone_login=getCookie("VODAFONELOGIN");var vodafone_status=getCookie("VODAFONESTATUS");var vodafone_points=getCookie("VODAFONEPOINTS");var vodafone_expiredpoints=getCookie("VODAFONEEXPIREDPOINTS"); if(!vodafone_points) { vodafone_points="0"; } if(!vodafone_expiredpoints) { vodafone_expiredpoints="0";}  if(vodafone_login === "1") { if(cookie_text === "t") {document.write("Sie haben "); } document.write(vodafone_points); if(cookie_text === "t") { document.write(" Punkte."); if(vodafone_expiredpoints === "0") {document.write("<br /><br />"); } else {  expiredPoints = vodafone_expiredpoints.split("|");  expired = " Am<br />"+expiredPoints[0]+ "<br />verfallen "+expiredPoints[1]+" Punkte.<br /><br />"; document.write(expired); } } else { document.write(" "); } } else {  if(cookie_text === "t") {document.write("Sie sind nicht eingeloggt.<br /><br />"); } else {  document.write("0 ");  } }}
// ANZAHL DER BONUSPUNKTE ANZEIGEN - END
// STARS-STATE TO OMNITURE - BEGIN
function getStarsState() { switch(getCookie("VODAFONESTATUS")) { case "10004": return "Red"; case "10003":return "Silver"; case "10002": return "Gold"; case "10001": return "Platinum"; default: return "None"; } }
// STARS-STATE TO OMNITURE - END
// OPEN WINDOW - BEGIN
function openWindow (varLink, varName, varOptions) {var varWindow = window.open(varLink, varName, varOptions);varWindow.focus(); }
// OPEN WINDOW - END
// SEND A FRIEND - BEGIN
function sendafriend() { var url = "https://" + window.location.hostname + "/taf/start?url="+escape(document.location); openWindow(url, "SendAFriend", "height=780,width=594,location=no,menubar=no,resizable=yes,toolbar=no"); }
// SEND A FRIEND - END
// SEND A FRIEND UNIVERSAL - BEGIN
function sendafriend2() { var url = "/taf/start?url="+escape(document.location);  openWindow(url, "SendAFriend", "height=780,width=594,location=no,menubar=no,resizable=yes,toolbar=no");}
// SEND A FRIEND UNIVERSAL - END
// CHECK FORM - BEGIN
function checkForm() {if(!document.getElementById("pushform").checkbox.checked) {  alert("Ohne Best�tigung der Versandbedingungen d�rfen wir Ihre Empfehlung nicht versenden!");   return false; }  return true;}
// CHECK FORM - END
// DO FORM - BEGIN
function doForm() { if (checkForm()) {document.getElementById("pushform").submit();} }
// DO FORM - END
// CHECKLOGIN - BEGIN 
function checkLogin(NameOfCookie) { var cookieValue = null;  if(document.cookie.length > 0) { var begin = document.cookie.indexOf(NameOfCookie+"=");   if(begin !== -1) { begin += NameOfCookie.length+1; var end = document.cookie.indexOf(";", begin); if(end === -1) { end = document.cookie.length; } cookieValue = unescape(document.cookie.substring(begin, end)); return (cookieValue === "1") ;    } else {  return false;    }  }  return false;}
// CHECKLOGIN - END
// SET PERSONALISED-MODE - BEGIN
function setPersonalisedMode() { /* DEPRECATED*/}
// SET PERSONALISED-MODE - END
// AVS LOGINBOX - BEGIN
function switchPinInput(varID) { if(varID === "pin") { $('#pininfo').attr('style','display :none'); $('#pin').attr('style','display :block'); $('#pin').focus(); } }
function initPinLogin() {$('#pininfo').attr('style','display :block'); $('#pin').attr('style','display :none'); }
// AVS LOGINBOX - END
// ESEARCH R17- BEGIN
/**
$Id: vodafone.global.js,v 1.14 2011/06/09 08:23:55 ott Exp $
 Modifies form behaviour when user changes search target.
**/
function changeSelect(searchFormId) { var form = document.forms[searchFormId];  if(typeof form.elements.fromShopOrGoogle!=='undefined'){
        var targetSelector = form.elements.fromShopOrGoogle;     var successURL = form.elements.successURL;
     for ( i = 0; i < targetSelector.length; i++) {
            if (targetSelector[i].checked) {
                if (targetSelector[i].value === "Google") {
                    $("#question").autocompleteEnabled(false); form.action = VF.websearchURL;  successURL.value = ""; form.method = "get";
                    if (form.elements.question) {form.elements.question.name = "q";}
                } else {
                $("#question").autocompleteEnabled(true); form.action = VF.eSearchURL; successURL.value = "/Suche/searchResult.jsp"; form.method = "post";
                if (form.elements.q) {form.elements.q.name = "question"; }
            }
        }
    }
  }
  return true;
}
/*** Removes leading and tailing spaces from the search field**/
function TrimSearchField(){ $('#top-search-field')[0].value = $('#top-search-field')[0].value.replace (/^\s+/, '').replace (/\s+$/, '');}
/*** Removes certain characters from search string to avoid errors.**/
function fixSpecialCharacter(input) { input.value = input.value.replace(/[^a-zA-Z0-9\u00E4\u00F6\u00FC\u00C4\u00D6\u00DC\u00DF\u0022\&\+\-\:\? ]/g, " ");}
/*** Removes input field inline label when user focuses 'empty' input field.**/
function fixFocusQuestion(input) { if (input.value === 'Suche') { input.value = ''; }}
/*** Sets input field inline label when user leaves input field and did not enter any search keyword.**/
function fixBlurQuestion(input) { if (input.value) { return; }else { input.value = 'Suche'; }}
/*** Checks whether the user entered a valid searchstring.**/
function checkInput(input) { TrimSearchField(); var subVar = (input.q ? input.q : input.question); return(subVar.value !== "Suche" && subVar.value !== "");}
/*** Submits search form if it contains valid data.**/
function submitForm(alink) { if (checkInput(document.formGlobalSearch)) { document.forms.formGlobalSearch.submit(); }}
/*** Safely tries to submit search form and performs all necessary actions before doing so.
*
*     searchFormId    Search from DOM element
*    checkOnly        If this is set to TRUE, the form
*                    is not submitted, only TRUE/FALSE is returned.
**/
function submitSearchForm(searchFormId, checkOnly) { var searchFormNode = document.getElementById(searchFormId); changeSelect(searchFormId); if (checkInput(searchFormNode)) {if (!checkOnly) {searchFormNode.submit();}return true;} else { return false;}}
/**
* Initializes the suggest feature of the search form.
*
*        $                jQuery object
*        inputObj        input object autosuggest should apply to
*        myWidth            inital width of autosuggest box
*        myTopOffset        inital top offset of autosuggest box
*
**/
function snSetup($, inputObj, myWidth, myTopOffset, onShow, onHide) {
    function myCallback(event, data, formatted) {  window.location.href = data.URL; }
    if(typeof inputObj !=='undefined'&& $.fn.exists(inputObj)){ $(inputObj).result(myCallback);}
    function getInputValue() { return $(inputObj).val();   }
    function formatRow(row) { var inHtml = row.SN_value;  var varReplace = row.Category;  var varTriggerClass = "replaceColumn1" + varReplace.replace(/ /g, ""); if (row.SN_type.split("_")[0] === "item") { inHtml = "<a href='" + row.URL + "' class='col1 TT_1000_0204 " + varTriggerClass + "'>" + row.SN_value + "</a>"; }  return inHtml; }
    // add functionality for footer
    function formatFooter() { var inHtml = "<span><a href=\"#\" onclick=\"submitSearchForm(\'formGlobalSearch\'); return false;\">Alle Suchergebnisse</a></span>"; return inHtml; }
    // calculate left offset for a given width
    var myLeftOffset = (parseInt($(inputObj).css("width"),10)-parseInt(myWidth,10) ) / 2;
    // firefox needs extra treatment
    if ($.browser.mozilla) {myLeftOffset = Math.floor(myLeftOffset); }
    if($.fn.exists(inputObj)){ $(inputObj).snAutocomplete("/Suche/mmsn", { max: 10,   extraParams: { Bias: 100, Keywords: "5-0-5-" },  formatItem: formatRow,  formatFooter: formatFooter, highlight: false, showLogo: false,  width: myWidth, leftOffset: myLeftOffset,  topOffset: myTopOffset, onShow: onShow, onHide: onHide  });}
}
// ESEARCH - END
// INTRO HIDDEN FUNCTION - BEGIN
function closeIntro(varID) { document.getElementById(varID).className = "displayNone"; }
function setIntro(varID, varAction) { if(varAction === "open") { document.getElementById(varID).className = "divIntroOpen showOverlay"; }  if(varAction === "close") {  document.getElementById(varID).className = "divIntroClose showNormal";  }}
// INTRO HIDDEN FUNCTION - END
// NPS UMFRAGE POPUP - BEGIN
function loadNPS(valPath) { if($.cookieASCII('vfnps') === null) { var valResultRandom = Math.floor(Math.random()*10); if(valResultRandom === 7) {window.open(valPath, 'VodafoneUmfage', 'width=610, height=650, scrollbars=auto, toolbar=no, status=no, resizable=yes, menubar=no, location=no, directories=no, top=50, left=50');}}}
// NPS UMFRAGE POPUP - END
// IMD 2010
// IE6 MDD li:hover by css solution
jQuery(document).ready(function($){
 if (navigator.userAgent.toLowerCase().match(/(msie 6.0)/)) {
  $('ul#menu li.menuLayer').mouseenter(function() {
    $(this).addClass('sfHover');  
  });
  $('ul#menu li.menuLayer').mouseleave(function() {
    $(this).removeClass('sfHover');               
  });
  $('ul#menu li.menuLayer ul li div.subnav-wrap').each(function() {
     $(this).addClass("subnav" + $(this).children("div").length + "col");     
  });
 }
});
// Mobile Platform Navigation Support V1.0
// Delays the main navigation Links on touchscreens (= touch event)
// Delay function for jquery 1.3.x, ToDo: use delay() if jquery 1.4.x is in use
$.fn.fakedelay = function(time, callback){ jQuery.fx.step.delay = function(){};  return this.animate({delay:1}, time, callback);};
// delay main links to allow touch functionality
var unsetMenulinkBind = function(obj){$(obj).parent().unbind(); $(obj).unbind(); };
var isBrowseriPadOriPhone =  function(){userAgent = navigator.userAgent.toLowerCase(); return(userAgent.indexOf('ipad')!==-1||userAgent.indexOf('iphone')!==-1);};
var menuLayerFunc =function(){ if(isBrowseriPadOriPhone()){$('li.menuLayer').mouseenter(function(event) { $(this).children('a.menuLayerLink').each(function(){$(this).bind('click', function(obj){ unsetMenulinkBind($(obj.currentTarget));return false; });});  });}};
 
function switchInput(varID) {  if(varID === "pwd") {  document.getElementById("inetinfo").style.display = "none"; document.getElementById("inetpassword").style.display = ""; }else if(varID === "pwd1") { document.getElementById("inetinfo1").style.display = "none"; document.getElementById("inetpassword1").style.display = "";  document.getElementById("inetpassword1").focus(); }}
function initLogin(toggle) { if(parseInt(toggle,10)===1){document.getElementById("inetinfo1").style.display = "";document.getElementById("inetpassword1").style.display = "none"; }else{document.getElementById("inetinfo").style.display = "";document.getElementById("inetpassword").style.display = "none"; }}
// close Search Preview Layer if MDD is hovered EGARAGE.eGarage - BUG # 16942
$("#imheader ul#menu li.menuLayer").bind("mouseover", function(){  $(".snac_box").hide();} );
// -------------------------------------------------------------------------------------------
var redirectLogout =function(){if(document.location.pathname==='/templates/meinvodafone/logout_cp.html'){  window.setTimeout(function(){window.location.href='/templates/meinvodafone/meinvf_logout.html';},2000);}};
var isMobileBrowser = function(){if ( $.browser.safari || $.browser.webkit||$.browser.opera ) { var browserAgent = navigator.userAgent.toLowerCase();var stringRegExp = /mobile/g;return(stringRegExp.test(browserAgent));}else {return false;}};
var areWeOnShopDomain = function(){ var testString = ['/Shop/','/service/','/Suche/']; var result = false; for(i=0;i<testString.length;i++){if(document.location.href.indexOf(testString[i])!==-1){result=true; break; }else{continue;}}return result; };
// -------------------------------------------------------------------------------------------
// EOF

/* CONTENT CLASS: JS Snippet - jQuery cookie - Strategic Design II - (for include only!) PAGENAME: JS Snippet - jQuery cookie - Strategic Design II - (for include only!) PAGEID: 179202 STATUS: PUBLISH READY 
VERSION: 0.0.2 LAST CHANGES: 2010-09-24  PUBLISHING DATE: 2011-05-09 08:44:37
 Cookie plugin* Copyright (c) 2006 Klaus Hartl (stilbuero.de) * Dual licensed under the MIT and GPL licenses: * http://www.opensource.org/licenses/mit-license.php * http://www.gnu.org/licenses/gpl.html * */
;jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}
return cookieValue;}};jQuery.cookieASCII=function(name,value,options){if(typeof value!='undefined'){options=options||{};if(value===null){value='';options.expires=-1;}
var expires='';if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){var date;if(typeof options.expires=='number'){date=new Date();date.setTime(date.getTime()+(options.expires*24*60*60*1000));}else{date=options.expires;}
expires='; expires='+date.toUTCString();}
var path=options.path?'; path='+(options.path):'';var domain=options.domain?'; domain='+(options.domain):'';var secure=options.secure?'; secure':'';document.cookie=[name,'=',value,expires,path,domain,secure].join('');}else{var cookieValue=null;if(document.cookie&&document.cookie!=''){var cookies=document.cookie.split(';');for(var i=0;i<cookies.length;i++){var cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=cookie.substring(name.length+1);break;}}}
return cookieValue;}};
/* -------------------------------------------------------------------------------------------*/
/**
CONTENT CLASS: JS Snippet - LoginBox - Strategic Design II - (for include only!) --PAGENAME: JS Snippet - LoginBox - Strategic Design II - (for include only!)   --PAGEID: 179201 --PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA --STATUS: PUBLISH READY --VERSION: 1.0.5-- LAST CHANGES: 2010-11-23 PUBLISHING DATE: 2011-05-09 08:44:37*/
(function($){$.extend($.fn,{stringify:function(data){if(!$.fn.stringified){$.fn.stringified='';}
if(data.constructor.toString().indexOf("Object")===-1){return data;}
for(var elem in data){$.fn.stringified+=elem+':'+($.fn.stringify(data[elem]))+'||';}
return $.fn.stringified;},exists:function(selector){return $(selector).length>0;}});})(jQuery);var getRedirectUrlVfLogin=function(){if(VF.backToUrl)return VF.backToUrl;if(document.location.search.indexOf('/login/login.ftel')!==-1){if(document.location.search.indexOf('goto=')!==-1){var qStringArr=document.location.search.substr(1,document.location.search.length).split('&');for(i=0;i<qStringArr.length;i++){if(qStringArr[i].indexOf('goto=')!==-1){return qStringArr[i].substr(5,qStringArr[i].length);}}
return'https://'+VF.wwwHost+'/mvd/';}else{return'https://'+VF.wwwHost+'/mvd/';}}else if(document.location.href.indexOf('meinvodafone/meinvf_logout.html')!==-1){return'https://'+VF.wwwHost+'/mvd/';}else{return'https://'+document.location.hostname+document.location.pathname+document.location.search+(document.location.href.search('[\?]')>-1?'&':'?')+'loggedIn=1'}};(function($){$.extend($,{vodafoneLogin:{cookieDomain:config.cookieDomain,htmlOptions:{html:{containerTarget:'divLoginBox'}},pluginOptions:{errorString:{string:'Es sind Fehler aufgetreten Sie konnten nicht angemeldet werden!',id:'#elemErrorRow'},isLoggedInParam:'loggedIn',isFailureParam:'isFailure',signIn:'#signIn',signInBlankText:'Anmelden bei MeinVodafone',indexpos:0,userType:null,userNameString:null,phoneNumber:null,isIE:false,stringified:null,breakY:null,lastLogin:null,loginName:null,redirecturl:(VF.backToUrl)?VF.backToUrl:'https://'+document.location.hostname+document.location.pathname+(document.location.href.search('[\?]')>-1?'&':'?')+'loggedIn=1',vfLoginCookieName:'MDDKeks',triggerElem:'#idLink-ae7fe47b-f27e-4d27-b8e7-b212bcd27da0',containerElem:'#top-quicklinks',logoutBtnText:'logout!',userNameDisplayGreeting:'Hallo ',phoneNumberDisplayInfo:'Ihre aktuell ausgew�hlte  Nummer',logoutDoUrl:'https://'+VF.wwwHost+'/ussa/logout',htmlStrBeforeLogin:'<li class="my-account" id="idLink-ae7fe47b-f27e-4d27-b8e7-b212bcd27da0"><a id="signIn" class="account-sign-in" href="#" title="" style="font-size:0.9em"></a>'+'<div id="divLoginBox" class="account-dropdown" style="display:none;margin-left:0px">'+'<form action="https://'+VF.wwwHost+'/ussa/login" id="loginForm" name="loginForm" method="post" autocomplete="off">'+'<div  class="dropdown-wrapper" >'+'<input type="text" id="inetaccount1" name="name" value="Benutzername / Rufnummer" onfocus="if (this.value===\'Benutzername / Rufnummer\') this.value=\'\';" onblur="if (this.value===\'\')this.value=\'Benutzername / Rufnummer\';"/>'+'<input name="info" id="inetinfo1" value="Ihr Internet-Kennwort" onclick="switchInput(\'pwd1\');" onfocus="switchInput(\'pwd1\');" style="display: block;" type="text">'+'<input type="password" tabindex="2" id="inetpassword1" name="password" value="" onkeypress="if(event.keyCode === 13 && $(\'#inetpassword1\').length > 0) $(\'#loginForm\')[0].submit();" onfocus="if (this.value===\'\') this.value=\'\';" onblur="if (this.value===\'\'){ this.value=\'\';initLogin(1);}" style="display: none;" />'+'<style type="text/css">div.divLoginTarget {height: auto; width: 180px; margin: 10px 0px 10px 0px;color: rgb(82, 82, 82);clear: both; }p.divLoginTargetItem  {padding: 0px 0px 0px 0px;margin: 0px 0px 3px 0px;}p.divLoginTargetItem input {padding: 0px 0px 0px 0px;margin: 0px 0px 0px 0px;}p.divLoginTargetItem label {padding: 0px 0px 0px 2px;}</style>'+'<div class="divLoginTarget"><p class="divLoginTargetItem" ><input id="loginTargetUrl1" type="radio" checked="true" value="https://'+VF.wwwHost+'/mvd/" name="url" style="border: none; background: none;height: 15px;width: 15px;margin-bottom:0px;vertical-align:middle;"><label style="vertical-align:middle;">Weiter mit MeinVodafone</label></p>'+'<p class="divLoginTargetItem" ><input id="loginTargetUrl2" type="radio" value="'+getRedirectUrlVfLogin()+'" name="url" style="border: none; background: none;height: 15px;width: 15px;margin-bottom:0px;vertical-align:middle;"><label style="vertical-align:middle;">Weiter mit der jetzigen Seite</label></p>'+'</div><a title="" href="#" class="aButton buttonDark" id="loginBtn"><span>LogIn</span></a>'+'<p class="register"><a href="https://'+VF.wwwHost+'/proxy42/ussa/registration/Register.vf" title="" >&gt; Jetzt registrieren</a></p>'+'<p class="register"><a href="https://'+VF.wwwHost+'/proxy42/portal/forgottenPasswordLogin.po" title="">&gt; Kennwort vergessen?</a></p>'+'<p class="register" style="display:block;"><a href="' + config.helpUrl + '" target="_self">&gt; Fragen zum Internet-Kennwort</a></p>'+'</div> <div class="dropdown-wrapper-foot"></div>'+'</form>  '+'</div>'+'</li>',htmlStrAfterLogin:'<li class="log-out"><a class="buttonLoggedIn" id="logoutBtn" href="' + config.logoutUrl + '" title=""><span>logout!'+'</span></a></li>'+'<li class="my-account-logged-in" id="idLink-ae7fe47b-f27e-4d27-b8e7-b212bcd27da0"><a  class="account-signed-in" href="#" title="" onclick="return false;"style="font-size:0.9em"><span id="signIn" ></span></a>'+'<div id="divLoginBox" class="account-dropdown-loggedIn" style="display:none;width:203px;margin-left:0px">'+'<div class="dropdown-wrapper"><p class="loggedIn"><span id="userNameDisplayGreeting"></span>'+'<br /><span id="userNameDisplay"></span></p><p class="loggedIn"><span id="phoneNumberDisplayInfo"></span>'+'<br /><span id="phoneNumberDisplay"></span></p>'+'<p class="loggedIn"><span id="LoginName">Sie sind angemeldet als: </span></p>'+'<p class="loggedIn"><span id="lastLoginInfo">Ihr letzter Login war am: </span></p>'+'</div>'+'<div class="dropdown-wrapper-foot"></div></div>'+'</li>',xmlBaseLink:'<a class="replaceClass" href="replaceLink" target="replaceTarget" title="replaceTitle"><span>replaceLinkText</span></a>',xmlUlBox:'<ul class="left"><li><div class="subnav-wrap subnavIndexPOScol imclearfix">ReplaceList</div></li></ul>',xmlLiItem:'<div class="subnav appendClass"> replaceImage <p class="megamenu-heading">replaceDisplayName</p> replaceLinklist </div>'},create:function(){return $.fn.vodafoneLogin;},initData:function(){if(null!=$.cookie(this.pluginOptions.vfLoginCookieName)){this.setUserResponseVars(JSON.parse($.cookie(this.pluginOptions.vfLoginCookieName)));}else{this.buildHtml();}},loginShow:function(){$('#'+$.vodafoneLogin.htmlOptions.html.containerTarget).slideDown('fast');},loginHide:function(){$('#'+$.vodafoneLogin.htmlOptions.html.containerTarget).slideUp('fast');},initTrigger:function(){$($.vodafoneLogin.pluginOptions.triggerElem).hover($.vodafoneLogin.loginShow,$.vodafoneLogin.loginHide);$('#inetpassword1').keydown(function(e){if(e.keyCode===13){if($('#inetpassword1').val()!==''&&$('#inetaccount1').val()!=='Benutzername / Rufnummer'&&$('#inetaccount1').val()!==''){$('form#loginForm').submit();}};});$('a#loginBtn').click(function(){if($('#inetpassword1').val()!==''&&$('#inetaccount1').val()!=='Benutzername / Rufnummer'&&$('#inetaccount1').val()!==''){$('form#loginForm').submit();}});$('a#logoutBtn').click(function(){$($.vodafoneLogin.pluginOptions.triggerElem).remove();$.fn.remove('.log-out');$.cookie('MDDKeks',null);$.cookie('authHint',null);});},buildHtml:function(){if($.fn.exists(this.pluginOptions.triggerElem)&&(!$.fn.exists('#'+this.htmlOptions.html.containerTarget))){$('li a'+this.pluginOptions.triggerElem).remove();};if(this.pluginOptions.userType==null){$('head').append('<style type="text/css">#top-links ul#top-quicklinks li.my-account a.buttonDark {margin-bottom: 3px; float: left;padding: 0 10px !important;}</style>');$($.vodafoneLogin.pluginOptions.containerElem).prepend(this.pluginOptions.htmlStrBeforeLogin);$(this.pluginOptions.signIn).append(this.pluginOptions.signInBlankText);}else{$($.vodafoneLogin.pluginOptions.containerElem).prepend(this.pluginOptions.htmlStrAfterLogin);$('a#logoutBtn').attr('href',$.vodafoneLogin.pluginOptions.logoutDoUrl+(($.vodafoneLogin.pluginOptions.redirecturl.indexOf('/proxy42')===-1&&$.vodafoneLogin.pluginOptions.redirecturl.indexOf('/pif')===-1)?((document.location.href.indexOf('/Shop/')!==-1)?'?targetUrl='+$.vodafoneLogin.pluginOptions.redirecturl:''):''));$(this.pluginOptions.signIn).append((this.pluginOptions.userNameString.length<=1?this.pluginOptions.connectTrough:this.pluginOptions.userNameString));$('#userNameDisplayGreeting').append(this.pluginOptions.userNameDisplayGreeting);$('#userNameDisplay').append((this.pluginOptions.userNameString.length<=1?this.pluginOptions.connectTrough:this.pluginOptions.userNameString));$('#LoginName').append(this.pluginOptions.connectTrough);$('#lastLoginInfo').append(this.pluginOptions.lastLogin.slice(6,8)+'.'+this.pluginOptions.lastLogin.slice(4,6)+'.'+this.pluginOptions.lastLogin.slice(0,4)+' um:'+this.pluginOptions.lastLogin.slice(8,10)+':'+this.pluginOptions.lastLogin.slice(10,12)+':'+this.pluginOptions.lastLogin.slice(12));if(this.pluginOptions.numMobileObjects>0){$('#phoneNumberDisplay').append(this.pluginOptions.connectTrough);$('#phoneNumberDisplayInfo').append(this.pluginOptions.phoneNumberDisplayInfo);}
$('#logoutBtn.span').append(this.pluginOptions.logoutBtnText);this.getMddData();}
$.vodafoneLogin.initTrigger();},logoutDo:function(initData){$(this.pluginOptions.triggerElem).remove();$.fn.remove('.log-out');$.cookie('MDDKeks',null);$.cookie('notShowLoggedInInfo',null);if(initData){document.location.href=this.pluginOptions.logoutDoUrl+(($.vodafoneLogin.pluginOptions.redirecturl.indexOf('/proxy42')===-1&&$.vodafoneLogin.pluginOptions.redirecturl.indexOf('/pif')===-1)?((document.location.href.indexOf('/Shop/')!==-1)?'?goto='+$.vodafoneLogin.pluginOptions.redirecturl:''):'');return false;}},setUserResponseVars:function(data){if(!data){this.pluginOptions.lastLogin=null;this.pluginOptions.userNameString=null;this.pluginOptions.connectTrough=null;this.pluginOptions.userType=null;}else{if((!$.cookie('notShowLoggedInInfo'))){$.cookie('notShowLoggedInInfo',1,{path:"/",domain:$.vodafoneLogin.cookieDomain});$('body').append('<iframe id="loginTrace" src="//'+VF.shopHost+'/Shop/tracing/?pageId=ext_login_page_id&eventId=ext_login_event_id"   style="width:1px;height:1px;display:none" ></iframe>')};this.pluginOptions.userNameString=data.userFirstname+' '+data.userLastname;this.pluginOptions.connectTrough=data.loginName;this.pluginOptions.userType=data.customerType;this.pluginOptions.lastLogin=data.lastLoginDate;this.buildHtml();}},getMddData:function(){$.get(config.xmlUrl+this.pluginOptions.userType+'.xml',{},function(data){$('#idLink-c7b0e395-a158-40e0-ae83-212041396047').parent().attr('id','meinVF');$('#meinVF').children().remove();var list='';var rootNode=$.vodafoneLogin.getChildren(data,'rootNode');var raw=$.vodafoneLogin.parseXmlToLink(rootNode,null);var childs=$.vodafoneLogin.getChildren(rootNode,'childNodes');for(i=0;i<childs.childNodes.length;i++){list=list+$.vodafoneLogin.parseXmlItemToListItem(childs.childNodes[i]);}
raw=raw+$.vodafoneLogin.pluginOptions.xmlUlBox.replace('ReplaceList',list).replace('IndexPOS',$.vodafoneLogin.pluginOptions.indexpos);$('#meinVF').html(raw);if($.browser.msie6){$('div.subnav-wrap').bgiframe();}},"xml");},getNodeValue:function(node){if(node){if($.browser.mozilla===true||$.browser.safari===true||$.browser.opera){if(!node.firstChild){return'';}else{if(node.firstChild.wholeText!=='undefined'){if(typeof node.firstChild.nodeValue!=='undefined'||node.firstChild.nodeValue!==null){if(node.childNodes.length>1){for(var i=0;i<node.childNodes.length;i++){if(node.childNodes[i].isElementContentWhitespace){continue;};return node.childNodes[i].nodeValue;}}
return node.firstChild.nodeValue;}
return node.firstChild.wholeText;}else{return node.firstChild;}}}
return node.text;}
return'';},getNodeByName:function(node,nodeName){if(typeof node==='object'){if(nodeName==node.nodeName){return node;}
if(typeof node.childNodes==='undefined'){for(var i=0;i<node.length;i++){if(nodeName===node[i].nodeName){return node[i];}}}else{for(var i=0;i<node.childNodes.length;i++){if(nodeName===node.childNodes[i].nodeName){return node.childNodes[i];}}}}
return false;},parseXmlToLink:function(children,imageStr,item){var raw=this.pluginOptions.xmlBaseLink;if((typeof children!=='undefined')){if(imageStr){raw=raw.replace('<span>replaceLinkText</span>',imageStr);}else{var nodevalue=this.getNodeValue(this.getNodeByName(children,'displayName'));if(typeof nodevalue!=='undefined'){if(item==='item'){raw=raw.replace('<span>replaceLinkText</span>',nodevalue);}else raw=raw.replace('replaceLinkText',nodevalue);}}
var linkNode=this.getNodeByName(children,'link');if(linkNode&&linkNode.childNodes.length>0){raw=raw.replace('replaceLink',this.getNodeValue(this.getNodeByName(linkNode,'url'))).replace('replaceTarget',(this.getNodeValue(this.getNodeByName(linkNode,'tagAttr_target'))||'_self')).replace('replaceTitle',this.getNodeValue(this.getNodeByName(linkNode,'tagAttr_title'))).replace('replaceClass',this.getNodeValue(this.getNodeByName(linkNode,'tagAttr_class'))).replace('replaceId',this.getNodeValue(this.getNodeByName(linkNode,'tagAttr_id')));return raw;}}
return'';},getChildren:function(node,nodeName){if(nodeName){return $(node).find(nodeName)[0];}else{return node;}},parseXmlItemToListItem:function(node){var liItem=this.pluginOptions.xmlLiItem;var linkList='';if(node.childNodes.length>0){this.pluginOptions.indexpos++;liItem=liItem.replace('replaceDisplayName',this.parseXmlToLink(node,null,'item'));if(liItem.indexOf('Hilfe')!==-1){liItem=liItem.replace('appendClass','support')}else{liItem=liItem.replace('appendClass','')}
var links=this.getChildren(node,'childNodes');var image=this.getNodeByName(node,'image');if(image){replaceImgStr=this.parseImageToHtml(image);}else{replaceImgStr='';}
for(var i=0;i<links.childNodes.length;i++){if(typeof links.childNodes[i]!=='undefined'){linkList=linkList+this.parseXmlToLink(links.childNodes[i],null,'item');}else continue;}
liItem=liItem.replace('replaceLinklist',linkList).replace('replaceImage',this.parseXmlToLink(image,replaceImgStr));return liItem;}
return'';},parseImageToHtml:function(node){var replaceImgStr='<img src="replaceImage" alt="replaceImgTitle" replaceId  class="replaceClass"/>';var imgId=this.getNodeValue(this.getNodeByName(node,'tagAttr_id'));if(imgId){replaceImgStr=replaceImgStr.replace('replaceId','id="'+imgId+'"');}else{replaceImgStr=replaceImgStr.replace('replaceId','');}
replaceImgStr=replaceImgStr.replace('replaceImage',this.getNodeValue(this.getNodeByName(node,'url')));replaceImgStr=replaceImgStr.replace('replaceImgTitle',this.getNodeValue(this.getNodeByName(node,'tagAttr_alt')));replaceImgStr=replaceImgStr.replace('replaceClass',this.getNodeValue(this.getNodeByName(node,'tagAttr_class')));return replaceImgStr;}}});})(jQuery);(function($){$.extend($.fn,{stringify:function(data){if(!$.fn.stringified){$.fn.stringified='';}
if(data.constructor.toString().indexOf("Object")===-1){return data;}
for(var elem in data){$.fn.stringified+=elem+':'+($.fn.stringify(data[elem]))+'||';}
return $.fn.stringified;},exists:function(selector){return $(selector).length>0;}});})(jQuery);var prepareLoginBox=function(){if(typeof isServermode==='undefined'){window.isServermode=false;}
if(typeof VF.backToUrl==='undefined'){VF.backToUrl=false;}
if($.fn.exists($.vodafoneLogin.pluginOptions.containerElem)&&(!$.fn.exists($.vodafoneLogin.pluginOptions.triggerElem+'.my-account'))&&($.fn.exists($.vodafoneLogin.pluginOptions.triggerElem))){$.vodafoneLogin.initData();}
$.vodafoneLogin.initTrigger();};
/* EOF--JS Snippet - LoginBox - Strategic Design II - (for include only!)*/
/* CONTENT CLASS: JS Snippet - Netigate World Manuals - Strategic Design II - (for include only!) PAGENAME: JS Snippet - Netigate World Manuals - Strategic Design II - (for include only!) 181167 PAGEID: 181167 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA STATUS:PUBLISH VERSION: 1.0.2 LAST CHANGES: 2011-03-20 PUBLISHING DATE: 2011-05-09 08:44:37
SNSetup (WWW)*/
var initManualNetigate=function(){if(typeof s === 'object') { if(VF.varPageId === 181006){$.cookie('vfmanual','samgals',{expires:1,path:'/',domain:config.cookieDomain,secure:false});}}
if($.cookie('vfmanual')!==null&&VF.varPageId !== 181006){switch($.cookie('vfmanual')){case('samgals'):$('body').append('<scr'+'ipt type="text/javasc'+'ript">window.open("//www.netigate.se/s.asp?s=49405X4341","Survey", "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=0, width=790,height=700,left = 600,top = 200");</scr'+'ipt>');break;case('htcdeshd'):$('body').append('<scr'+'ipt type="text/javasc'+'ript">window.open("//www.netigate.se/s.asp?s=49413X7319","Survey", "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=0, width=790,height=700,left = 600,top = 200");</scr'+'ipt>');break;default:break;}
$.cookie('vfmanual',null,{expires:1,path:'/',domain:config.cookieDomain,secure:false});}};
var initHelpAndSupportNetigate=function(){if($.cookie('vfhelpandsupport')!==null){if(Math.floor(Math.random()*(10)+1)===1){if(Math.floor(Math.random()*(2))===0){$('body').append('<scr'+'ipt type="text/javasc'+'ript">window.open("//www.netigate.se/s.asp?s=51459X4154","Survey", "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=0, width=790,height=700,left = 600,top = 200");</scr'+'ipt>');}else{$('body').append('<scr'+'ipt type="text/javasc'+'ript">window.open("//www.netigate.se/s.asp?s=51458X3105","Survey", "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=0, width=790,height=700,left = 600,top = 200");</scr'+'ipt>');}}$.cookie('vfhelpandsupport',null,{expires:1,path:'/',domain:config.cookieDomain,secure:false});}}

/* CONTENT CLASS: JS Snippet - INQ Netigate - Strategic Design II - (for include only!) PAGENAME: JS Snippet - INQ Netigate - Strategic Design II - (for include only!)  PAGEID: 179248 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA STATUS:PUBLISH VERSION: 1.0.2 LAST CHANGES: 2011-03-20 PUBLISHING DATE: 2011-05-09 08:44:37
SNSetup (WWW)*/
var initInqNetigate = function(){
function hasNoInq() {var scriptTags = $('body sc'+'ri'+'pt');for(var i=0;i<scriptTags.length;i++) {if( scriptTags[i].src.indexOf('/chatskins/launch/inqChatLaunch')!==-1) return  false;}return true;};
    function checkForSupportPage(){ var arrTest = ['service.','hilfe','support','proxy42','meinvodafone','vodafonestars','vfksc','STARSTEASERREGISTRATION','kontakt.html']; for (var i=0;i<arrTest.length;i++){if(document.location.href.indexOf(arrTest[i])!==-1)return true; } return false;  };
    var clientId =(checkForSupportPage())?'348':'302';   var jsUrl  =((checkForSupportPage())?'vodafone-de-care.inq.com':'vodafone.inq.com')+'/chatskins/launch/inqChatLaunch'+clientId+'.js'; 
    if( ($("#inqC2CImgContainer").length>0) && hasNoInq() ){jQuery.ajaxSetup({ cache:true}); window.inqDOMReady =true;$('body').append('<' + 'sc' +'ript type="text/javas'+ 'cri'+ 'pt" charset="utf-8" src="//'+jsUrl+'" '+ '>' + '</s' +'cr'+'ipt'+'>');jQuery.ajaxSetup({ cache:false}); }if (Math.random() >= 0.999){$('body').append('<scr' + 'ipt type="text/javasc'+'ript">window.open("//www.netigate.se/s.asp?s=42103X8057","Survey", "toolbar=0, scrollbars=1, location=0, statusbar=0, menubar=0, resizable=0, width=790,height=700,left = 600,top = 200");</scr' + 'ipt>');}};

/* CONTENT CLASS: JS Snippet - Omniture Tracking- Strategic Design II - (for include only!) PAGENAME: JS Snippet - Omniture Tracking- Strategic Design II - (for include only!) PAGEID: 179256 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA 
STATUS: PUBLISH VERSION: 1.0.1 LAST CHANGES: 2011-03-20 PUBLISHING DATE: 2011-05-09 08:44:37Omniture Tracking(WWW)*/
function checkRatingCockies() {if(typeof $.cookie === 'function') { if($.cookie('cWriteRating')) { s.events=s.apl(s.events, 'event47', ',', 1); $.cookie('cWriteRating', null, { path: '/', domain: config.cookieDomain}); } if($.cookie('cReadRating')) { s.events=s.apl(s.events, 'event46', ',', 1); $.cookie('cReadRating', null, { path: '/', domain: config.cookieDomain}); } } }
function teaserView() { if($("div[class*='trackingTeaser']").length) {if(s.events) { if (s.events.indexOf("event20") === -1) {s.events += ",event20"; }} else { s.events = "event20"; } $("div[class*='trackingTeaser']").each(function(){ varClassNames = $(this).attr("class"); varTeaserID = varClassNames.substr(varClassNames.indexOf("trackingTeaser") + 14, 6); (s.prop30) ? s.prop30 += "," + s.pageName + ":" + varTeaserID : s.prop30 = s.pageName + ":" + varTeaserID;});}}
function omniture() { if (typeof s === 'object') { teaserView(); checkRatingCockies(); var s_code = s.t(); if (s_code) { document.write(s_code); return;}} else { return;}} 
/* -------------------------------------------------------------------------------------------*/

/*CONTENT CLASS: JS Snippet - Omniture Tracking Seachposition- Strategic Design II - (for include only!)// PAGENAME: JS Snippet - Omniture Tracking Seachposition- Strategic Design II - (for include only!)// PAGEID: 179254// PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA// STATUS: PUBLISH READY// VERSION: 1.0.2// LAST CHANGES: 2010-10-28// PUBLISHING DATE: 2011-05-09 08:44:37*/
/* -------------------------------------------------------------------------------------------*/
function omnitureSearchpositionTracking(){}; 

/* CONTENT CLASS: JS Snippet - SN Setup  - Strategic Design II - (for include only!) PAGENAME: JS Snippet - SN Setup- Strategic Design II - (for include only!) PAGEID: 179236 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA STATUS: NO PUBLISH VERSION: 1.0.2 LAST CHANGES: 2010-09-24 PUBLISHING DATE: 2011-05-09 08:44:37
SNSetup (WWW)*/
var setupSearchBox = function() {
   if($.fn.exists('#top-search-field_')){
    snSetup($, '#top-search-field', 245, 12, function() { var varTriggerRow = 0; $("a[class*='replace']").each(function (i) { varTriggerRow = (varTriggerRow + 1); varTriggerClass = "triggerAutoRow" + varTriggerRow;  varClassNames = $(this).attr("class");  $(this).removeClass(varClassNames); $(this).addClass(varClassNames.replace(/replace/g, varTriggerClass));});
            $("a[class*='triggerAuto']").click(function(){ varClassNames = $(this).attr("class"); varHref = $(this).attr("href"); varAutoRow = varClassNames.substring(varClassNames.indexOf("Row") + 3, varClassNames.indexOf("Column"));  varAutoColumn = 1; varAutoCategory = varClassNames.substr(varClassNames.indexOf("Column") + 6 + varAutoColumn);
                     s.linkTrackVars='eVar44'; s.eVar44= s.pageName + ":" + varAutoRow + ":" + varAutoColumn + ":" + varAutoCategory; s.tl(this,'o','Search Result Teaser');
                     if(!$.cookie('strSearchTerm')) {$.cookie('strSearchTerm', $.URLEncode($('#top-search-field').val()), { expires: 0.0005, path: '/', domain: config.cookieDomain, secure: false}); }
                 });},function() {/* onHide code goes here */}
    );
   };
 }


/* CONTENT CLASS: JS Snippet - Nugg ad- Strategic Design II - (for include only!) PAGENAME: JS Snippet - Nugg ad- Strategic Design II - (for include only!) PAGEID: 179261 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA STATUS: PUBLISH VERSION: 1.0.1 LAST CHANGES: 2011-03-20 PUBLISHING DATE: 2011-05-09 08:44:37
Nugg Add(WWW)*/
var nuggrid = encodeURIComponent(top.location.href) || 0; var n_pbt='';var setnugg="1";
function initNuggAd(typeOfHost) { if(typeOfHost == 'vodafone' && (location.host === 'cmsdevel-preview.vfd2-testnet.de' || location.host == VF.wwwHost )) { document.write('<scr'+'ipt type="text/javasc'+'ript" src="//emsguj.nuggad.net/rc?nuggn=1886380617&nuggsid=736704339&nuggrid=' + nuggrid + '"><\/scr'+'ipt>'); return; } }
function getAdTags(typeOfAd, typeOfDomain) {
     if (location.host === 'cmsdevel-preview.vfd2-testnet.de' || location.host === VF.wwwHost ) {
         switch(typeOfAd) {
             case "rubriken": document.write('<'+'sc'+'ript type="text/javasc'+'ript" src="//ad.de.doubleclick.net/adj/'+typeOfDomain+'-rubriken/'+VF.doubleClickAdTag+';pg=homepage;!category=stop;ind=no;sz=468x60;tile=1;'+ n_pbt + ';ord='+VF.randomNumber+'?"><\/scr'+'ipt>');  break;
             case "scrollSky": document.write('<script type="text/javascript" src="//ad.de.doubleclick.net/adj/'+typeOfDomain+'-scroll_sky/'+VF.doubleClickAdTag+';pg=homepage;!category=stop;res='+((screen.width >= 1000)?'yes':'no')+';ind=no;sz=1x1;dcopt=ist;tile=2;'+ n_pbt + ';ord='+VF.randomNumber+'?"><\/scr'+'ipt>'); break;
             case "maxiad": document.write('<'+'scr'+'ipt type="text/javascr'+'ipt" src="//ad.de.doubleclick.net/adj/'+typeOfDomain+'-maxiad/'+VF.doubleClickAdTag.toLowerCase()+';pg=homepage;!category=stop;ind=no;sz=1x1;tile=3;'+ n_pbt + ';ord='+VF.randomNumber+'?"><\/scr'+'ipt>'); break;
         }
     }
}

/* CONTENT CLASS: JS Snippet - IE6 Notice- Strategic Design II - (for include only!) PAGENAME: JS Snippet - IE6 Notice- Strategic Design II - (for include only!)  PAGEID: 179239 STATUS: NO PUBLISH 
VERSION: 1.0.1 LAST CHANGES: 2010-09-24 PUBLISHING DATE: 2011-05-09 08:44:37
IE6 Notice*/
var oldBrowserHintUrl = '//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.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 = '677,0,727,82'; areaIE8.href = oldBrowserHintUrl; $('#mapIE6Notice')[0].appendChild(areaIE8);
    var areaFF = document.createElement('AREA');  areaFF.shape = 'rect';  areaFF.coords = '728,0,800,82';  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 = '801,0,866,82'; 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 = '867,0,936,82'; 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/iE6-Hinweis_3.jpg'; img.useMap = '#mapIE6Notice'; div.appendChild(img); 
    var divBtn = document.createElement('DIV'); divBtn.style.position = "absolute"; divBtn.style.top = '20px'; divBtn.style.left = '934px'; divBtn.style.width = '19px'; divBtn.style.height = '20px'; divBtn.style.backgroundColor = 'yellow';divBtn.style.backgroundImage = 'url(/images/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'; };
  }
}
/* -------------------------------------------------------------------------------------------*/

/* CONTENT CLASS: JS Snippet - Checkout Survey- Strategic Design II - (for include only!) PAGENAME: JS Snippet - Checkout Survey- Strategic Design II - (for include only!)  PAGEID: 179231 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA STATUS: NO PUBLISH VERSION: 1.0.1 LAST CHANGES: 2010-09-24 PUBLISHING DATE: 2011-05-09 08:44:37
 -------------------------------------------------------------------------------------------*/
getExitsShoppingBasket = function(){};fakeNavigation= function(){};

/* CONTENT CLASS: JS Snippet - Shop fixes - Strategic Design II - (for include only!) PAGENAME: JS Snippet - Shop fixes - Strategic Design II - (for include only!) PAGEID: 179207 PROJECT VARIANT: 0E29326CCA2C422FB194CA8A0C33ACCA STATUS: NO PUBLISH VERSION: 1.0.1 LAST CHANGES: 2010-09-24 PUBLISHING DATE: 2011-05-09 08:44:37
 -------------------------------------------------------------------------------------------*/
getExitsShoppingBasket = function(){};fakeNavigation= function(){};
function getCartCount() {
    if ($.cookie('CARTCOUNT')) {
        return parseInt($.cookie('CARTCOUNT'));
    } else return 0;
}
var buildCartCount=function() {
        var idCartLink = ['idLink-f5c82124-d7e5-45f3-bb2f-c1fbde16bd21', 'idLink-246064d3-9297-4f73-bb89-cc0107798fc6', 'idLink-9cdb084a-f770-4898-a2ef-431fd25749da'];
        for (var i = 0; i < idCartLink.length; i++) {
            if ($.fn.exists('#' + idCartLink[i])) {
                var val = $('#' + idCartLink[i]).html();
                if($('#' + idCartLink[i]).html().indexOf('(')===-1){
                $('#' + idCartLink[i]).html(val + ' (' + getCartCount() + ')');
                }
            }
        }
};

/* CONTENT CLASS: Include - JS ToolbarGet PAGENAME: JS Snippet - ToolbarGet - Strategic Design II - (for include only!)  PAGEID: 178840
VERSION: 5.0.0 LAST CHANGES: 2011-02-02
 jQuery.toolbarBasic Include * Snipet to include Toolbar * SD2 02/2011 by ME * Requires jQuery 1.4.x **/
var injectToolbarCSS =function(){};
var hasWrongCss = function(){
cssLinks = $('head link[type="text/css"]');
for(i=0;i<cssLinks.length;i++){
if(cssLinks[i].href.indexOf('v2.')!==-1){return true;}
}
return false;
};
var getGlobalToolbar= function(){
if((!navigator.userAgent.toLowerCase().match(/(msie 6.0)/))&&(!hasWrongCss())&& (!isMobileBrowser())&& (document.location.href.indexOf('/ussa')===-1)&&(document.location.href.indexOf('/proxy42')===-1)&&(document.location.href.indexOf('/dashboard')===-1)){
    $.get('/styles/xtoolbarBar.css',function(data){$('body').append(data);});
}
}

// -------------------------------------------------------------------------------------------

// -[SNIPPETS <<<]----------------------------------------------------------------------------

// -[DOCUMENT ON LOAD >>>]--------------------------------------------------------------------
$(window).load(function() {
attachTeaserTracking();attachATGTeaserTracking();attachTeaserTrackingTabBox();
fakeNavigation();
//comment
});
// -[DOCUMENT ON LOAD <<<]-------------------------------------------------------------------- 
 
// -[DOCUMENT READY >>>]----------------------------------------------------------------------
$(document).ready(function() {
try { redirectLogout();}catch(e){}; menuLayerFunc();
});
$(document).ready(function() {
prepareLoginBox();
});
$(document).ready(function() {
initManualNetigate();initHelpAndSupportNetigate();
});
$(document).ready(function() {
initInqNetigate();
});
$(document).ready(function() {
omnitureSearchpositionTracking();
});
$(document).ready(function() {
setupSearchBox();
});
$(document).ready(function() {
getExitsShoppingBasket();
buildCartCount();

if (document.location.host.indexOf('www')===-1){$('ul.ulNavigationTop').attr('style','height:0px');}
});
$(document).ready(function() {
if(VF.toolBarEnabled) {getGlobalToolbar();}
});
// -[DOCUMENT READY <<<]----------------------------------------------------------------------
