Venda.namespace("Ebiz");Venda.Ebiz=function(){};Venda.Ebiz.deleteOptions=function(a){durationIds=new Array();j=0;if(a=="c_postpaid"){durationInput=document.getElementById("yourbasket").getElementsByTagName("input");for(i=0;i<durationInput.length;i++){if(durationInput[i].id.indexOf("formd_postpaid_option")==0&&durationInput[i].id.length>2){durationIds[j]=durationInput[i].id;document.getElementById(durationIds[j]).value="0";j++}}}if(a=="h_mobileinternet"){durationInput=document.getElementById("yourbasket").getElementsByTagName("input");for(i=0;i<durationInput.length;i++){if(durationInput[i].id.indexOf("formi_mobileinternet_option")==0&&durationInput[i].id.length>2){durationIds[j]=durationInput[i].id;document.getElementById(durationIds[j]).value="0";j++}}}};Venda.Ebiz.deleteOptions();Venda.Ebiz.existingPlan=function(a){Venda.Ebiz.existingPlan.tags=a;YAHOO.util.Event.addListener("addtobasket","submit",Venda.Ebiz.interceptForm)};Venda.Ebiz.interceptForm=function(b){var a=confirm(Venda.Ebiz.existingPlan.tags.confirmmessage);if(!a){YAHOO.util.Event.stopEvent(b)}};Venda.Ebiz.existingPlanProdList=function(d,a,c,b){Venda.Ebiz.existingPlanProdList.prepaidhooks=d;Venda.Ebiz.existingPlanProdList.postpaidhooks=a;Venda.Ebiz.existingPlanProdList.mobinthooks=c;Venda.Ebiz.existingPlanProdList.tags=b;if(Venda.Ebiz.existingPlanProdList.tags.prepaidmessage!=""){YAHOO.util.Event.addListener(d,"click",Venda.Ebiz.interceptAdd)}if(Venda.Ebiz.existingPlanProdList.tags.postpaidmessage!=""){YAHOO.util.Event.addListener(a,"click",Venda.Ebiz.interceptAdd)}if(Venda.Ebiz.existingPlanProdList.tags.mobileinternetmessage!=""){YAHOO.util.Event.addListener(c,"click",Venda.Ebiz.interceptAdd)}};Venda.Ebiz.interceptAdd=function(b){if((Venda.Ebiz.existingPlanProdList.prepaidhooks!="")&&(prodType=="a_prepaid")){var a=confirm(Venda.Ebiz.existingPlanProdList.tags.prepaidmessage);if(!a){YAHOO.util.Event.stopEvent(b)}}if((Venda.Ebiz.existingPlanProdList.postpaidhooks!="")&&(prodType=="c_postpaid")){var a=confirm(Venda.Ebiz.existingPlanProdList.tags.postpaidmessage);if(!a){YAHOO.util.Event.preventDefault(b)}}if((Venda.Ebiz.existingPlanProdList.mobinthooks!="")&&(prodType=="h_mobileinternet")){var a=confirm(Venda.Ebiz.existingPlanProdList.tags.mobileinternetmessage);if(!a){YAHOO.util.Event.preventDefault(b)}}};var countRefineRemove=0;var countCollate=0;var allData=new Array();var allHeader=new Array();Venda.Ebiz.checkFilter=function(a,d){var c=false;for(var b=0;b<d.length;b++){if(d[b]==a){c=true}}return c};Venda.Ebiz.storeHeader=function(b,a){allHeader[b]=a};Venda.Ebiz.storeData=function(b,d,c,a){if(typeof allData[b]=="undefined"){allData[b]=new Array()}a=a.replace("'","&#39;");allData[b].push({refinetxt:d,itemcount:c,refineurl:a})};Venda.Ebiz.generateData=function(b){var c=b.split(":");var e="";var m="";var h="";var o="";var f="";var d=document.getElementById("textFirstOption").innerHTML;for(var k in allData){if(Venda.Ebiz.checkFilter(k,c)){for(var g=0;g<allData[k].length;g++){m=m+'<option value="'+allData[k][g].refineurl+'">'+allData[k][g].refinetxt+" ("+allData[k][g].itemcount+")</option>"}f=allHeader[k]}else{var a="";for(var g=0;g<allData[k].length;g++){if(typeof allData[k]!="function"){a=a+'<option value="'+allData[k][g].refineurl+'">'+allData[k][g].refinetxt+" ("+allData[k][g].itemcount+")</option>"}}if(a!=""){e=e+'<div class="eachrefine"><h3>'+allHeader[k]+'</h3><div class="refineSelect"><select onchange="location = this.options[this.selectedIndex].value;"><option value="">'+d+"</option>"+a+"</select></div></div>"}}}var l=e;if(m!=""){var n='<div class="eachrefine"><h3>'+f+'</h3><div class="refineSelect"><select onchange="location = this.options[this.selectedIndex].value;"><option value="">'+d+"</option>"+m+"</select></div></div>"}else{var n=""}document.getElementById("allRefinelist").innerHTML=n+l};Venda.Ebiz.toggleService=function(d,b){target=document.getElementById(d);targetImage=document.getElementById(b);var c=document.getElementById("tag-imgUp").innerHTML;var a=document.getElementById("tag-imgDown").innerHTML;if(target.style.display=="none"){target.style.display="block";targetImage.src=c}else{target.style.display="none";targetImage.src=a}};Venda.Ebiz.grabURL=function(e,b){var f=unescape(e);var g="&";var a=g+b+"=";if(f.search(a)==-1){a="?"+b+"="}var d=f.split(a);if(d[1]){var c=d[1].split(g);return(c[0])}};Venda.Ebiz.createCookie=function(c,d,e){if(e){var b;b=(60*60*24*30);var a="; max-age="+b.toString()}else{var a=""}document.cookie=c+"="+d+a+"; path=/"};Venda.Ebiz.tradeDBTracking=function(){if(location.href.indexOf("tduid")!=-1){var a=Venda.Ebiz.grabURL(location.href,"tduid");if(a!=""&&a!=null){Venda.Ebiz.createCookie("TRADEDOUBLER",a,7)}}};Venda.Ebiz.tradeDBTracking();Venda.Ebiz.setLang=function(b,c){var a=new Date();YAHOO.util.Cookie.set(b,c,{path:"/",domain:"mobistar.be",expires:new Date(a.getTime()+365*24*60*60*1000)})};Venda.Ebiz.setVLang=function(a,b){YAHOO.util.Cookie.set(a,b)};Venda.Ebiz.switchLang=function(a){Venda.Ebiz.switchLang.tags=a;var b=unescape(location.href);if(b.indexOf("/fr/")>-1){b=b.replace(/\/fr\//,"/nl/")}else{if(b.indexOf("/nl/")>-1){b=b.replace(/\/nl\//,"/fr/")}}Venda.Ebiz.switchLang.changeLink=function(d){YAHOO.util.Event.preventDefault(d);if(Venda.Ebiz.switchLang.tags.track==""){if(Venda.Ebiz.switchLang.tags.carttotal==""||Venda.Ebiz.switchLang.tags.carttotal=="0"){if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="NL"){Venda.Ebiz.setLang("language","nl");Venda.Ebiz.setVLang("lang","nl")}if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="FR"){Venda.Ebiz.setLang("language","fr");Venda.Ebiz.setVLang("lang","fr")}window.location.href=b}else{var f=confirm(Venda.Ebiz.switchLang.tags.langmessagenotrack);if(f){if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="NL"){Venda.Ebiz.setLang("language","nl");Venda.Ebiz.setVLang("lang","nl")}if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="FR"){Venda.Ebiz.setLang("language","fr");Venda.Ebiz.setVLang("lang","fr")}window.location.href=b+"&log=4"}}}else{if(Venda.Ebiz.switchLang.tags.track=="productAdded"){var f=confirm(Venda.Ebiz.switchLang.tags.langmessagenotrack);if(f){if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="NL"){Venda.Ebiz.setLang("language","nl");Venda.Ebiz.setVLang("lang","nl")}if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="FR"){Venda.Ebiz.setLang("language","fr");Venda.Ebiz.setVLang("lang","fr")}window.location.href=Venda.Ebiz.switchLang.tags.sku+"&log=4"}}else{if(Venda.Ebiz.switchLang.tags.carttotal==""||Venda.Ebiz.switchLang.tags.carttotal=="0"){if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="NL"){Venda.Ebiz.setLang("language","nl");Venda.Ebiz.setVLang("lang","nl")}if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="FR"){Venda.Ebiz.setLang("language","fr");Venda.Ebiz.setVLang("lang","fr")}window.location.href=b}else{var c=confirm(Venda.Ebiz.switchLang.tags.langmessagetrack);if(c){if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="NL"){Venda.Ebiz.setLang("language","nl");Venda.Ebiz.setVLang("lang","nl")}if(Venda.Ebiz.switchLang.tags.langLink[0].innerHTML=="FR"){Venda.Ebiz.setLang("language","fr");Venda.Ebiz.setVLang("lang","fr")}window.location.href=Venda.Ebiz.switchLang.tags.home+"&log=4"}}}}};YAHOO.util.Event.addListener(Venda.Ebiz.switchLang.tags.langLink,"click",Venda.Ebiz.switchLang.changeLink)};Venda.Ebiz.checkCookies=function(a){Venda.Ebiz.mobistarLanguage=YAHOO.util.Cookie.get("language");Venda.Ebiz.vendaLanguage=YAHOO.util.Cookie.get("lang");Venda.Ebiz.checkCookies.tags=a;var b=YAHOO.util.Cookie.get("cartlang");var c=unescape(location.href);if(c.indexOf("/fr/")>-1){c=c.replace(/\/fr\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}else{if(c.indexOf("/nl/")>-1){c=c.replace(/\/nl\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}}if(Venda.Ebiz.mobistarLanguage==null&&Venda.Ebiz.vendaLanguage!=null){Venda.Ebiz.setLang("language",Venda.Ebiz.vendaLanguage)}else{if(Venda.Ebiz.mobistarLanguage!=null&&Venda.Ebiz.vendaLanguage==null){Venda.Ebiz.setVLang("lang",Venda.Ebiz.mobistarLanguage);window.location.href=window.location.href}else{if(Venda.Ebiz.mobistarLanguage==null&&Venda.Ebiz.vendaLanguage==null){window.location.href=Venda.Ebiz.checkCookies.tags.langPage}else{if((Venda.Ebiz.mobistarLanguage!=null&&Venda.Ebiz.vendaLanguage!=null)&&(Venda.Ebiz.mobistarLanguage==Venda.Ebiz.vendaLanguage)&&(b!=null&&b!=Venda.Ebiz.vendaLanguage)&&Venda.Ebiz.checkCookies.tags.carttotal!=""&&Venda.Ebiz.checkCookies.tags.carttotal!="0"){if(Venda.Ebiz.checkCookies.tags.track==""){window.location.href=c+"&log=4"}else{if(Venda.Ebiz.checkCookies.tags.track=="productAdded"){var e=Venda.Ebiz.checkCookies.tags.sku;if(e.indexOf("/fr/")>-1){e=e.replace(/\/fr\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}else{if(e.indexOf("/nl/")>-1){e=e.replace(/\/nl\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}}window.location.href=e+"&log=4"}else{var d=Venda.Ebiz.checkCookies.tags.home;if(d.indexOf("/fr/")>-1){d=d.replace(/\/fr\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}else{if(d.indexOf("/nl/")>-1){d=d.replace(/\/nl\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}}window.location.href=d+"&log=4"}}}else{if((Venda.Ebiz.mobistarLanguage!=null&&Venda.Ebiz.vendaLanguage!=null)&&(Venda.Ebiz.mobistarLanguage!=Venda.Ebiz.vendaLanguage)){if(Venda.Ebiz.checkCookies.tags.track==""){if(Venda.Ebiz.checkCookies.tags.carttotal==""||Venda.Ebiz.checkCookies.tags.carttotal=="0"){YAHOO.util.Cookie.set("lang",Venda.Ebiz.mobistarLanguage,{path:"/"});if(c.indexOf("&setlang=nl")>-1){c=c.replace(/&setlang=nl/,"")}else{if(c.indexOf("&setlang=fr")>-1){c=c.replace(/&setlang=fr/,"")}}window.location.href=c}else{Venda.Ebiz.setVLang("lang",Venda.Ebiz.mobistarLanguage);window.location.href=c+"&log=4"}}else{if(Venda.Ebiz.checkCookies.tags.track=="productAdded"){var e=Venda.Ebiz.checkCookies.tags.sku;if(e.indexOf("/fr/")>-1){e=e.replace(/\/fr\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}else{if(e.indexOf("/nl/")>-1){e=e.replace(/\/nl\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}}window.location.href=e+"&log=4"}else{if(Venda.Ebiz.checkCookies.tags.carttotal==""||Venda.Ebiz.checkCookies.tags.carttotal=="0"){Venda.Ebiz.setVLang("lang",Venda.Ebiz.mobistarLanguage);window.location.href=c}else{if(d.indexOf("/fr/")>-1){d=d.replace(/\/fr\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}else{if(d.indexOf("/nl/")>-1){d=d.replace(/\/nl\//,"/"+Venda.Ebiz.mobistarLanguage+"/")}}window.location.href=d+"&log=4"}}}}else{if((Venda.Ebiz.mobistarLanguage!=null&&Venda.Ebiz.vendaLanguage!=null)&&(Venda.Ebiz.mobistarLanguage==Venda.Ebiz.vendaLanguage)){if(c.indexOf("&setlang=nl")>-1){c=c.replace(/&setlang=nl/,"");window.location.href=c}else{if(c.indexOf("&setlang=fr")>-1){c=c.replace(/&setlang=fr/,"");window.location.href=c}}}}}}}}};Venda.Ebiz.trimAll=function(a){while(a.substring(0,1)==" "){a=a.substring(1,a.length)}while(a.substring(a.length-1,a.length)==" "){a=a.substring(0,a.length-1)}return a};function checkDay(){if((document.getElementById("monthdropdown"))&&(document.getElementById("daydropdown"))){var b=document.getElementById("monthdropdown");var a=document.getElementById("daydropdown");a.length=31;for(i=0;i<31;i++){a.options[i].value=i+1;a.options[i].text=i+1}if(b.value=="4"||b.value=="6"||b.value=="9"||b.value=="11"){a.remove(30)}else{if(b.value=="2"){a.remove(30);a.remove(29);a.remove(28);if(isleap(document.getElementById("yeardropdown").value)){a.length=29;a.options[28].value=29;a.options[28].text=29}}}}}function createYear(){if(document.getElementById("yeardropdown")){var c=document.getElementById("yeardropdown");var b=new Date();var e=b.getFullYear();var d=e-109;var a=e-18;c.length=92;for(i=0;i<=91;i++){c.options[i].value=d+i;c.options[i].text=d+i}}}function checkYear(){if((document.getElementById("yeardropdown"))&&(document.getElementById("daydropdown"))){if(isleap(document.getElementById("yeardropdown").value)&&document.getElementById("daydropdown").length==28){document.getElementById("daydropdown").length=29;document.getElementById("daydropdown").options[28].value=29;document.getElementById("daydropdown").options[28].text=29}else{if(document.getElementById("daydropdown").length==29&&!isleap(document.getElementById("yeardropdown").value)){document.getElementById("daydropdown").remove(28)}}}}function isleap(a){if((parseInt(a)%4)==0){if(parseInt(a)%100==0){if(parseInt(a)%400!=0){return false}if(parseInt(a)%400==0){return true}}if(parseInt(a)%100!=0){return true}}if((parseInt(a)%4)!=0){return false}};