// Supersleight plugin for IE6 PNG transparency - http://allinthehead.com/retro/338/supersleight-jquery-plugin
eval(function(p,a,c,k,e,d){e=function(c){return(c<a?'':e(parseInt(c/a)))+((c=c%a)>35?String.fromCharCode(c+29):c.toString(36))};if(!''.replace(/^/,String)){while(c--)d[e(c)]=k[c]||e(c);k=[function(e){return d[e]}];e=function(){return'\\w+'};c=1};while(c--)if(k[c])p=p.replace(new RegExp('\\b'+e(c)+'\\b','g'),k[c]);return p}('6.12.11=h(1){1=6.10({A:k,E:k,e:"x.Z",Y:k},1);X H.G(h(){b(6.j.W&&J(6.j.I)<7&&J(6.j.I)>4){6(H).V("*").G(h(i,F){8 0=6(F);b(1.E&&0.3("d-f").U(/\\.z/i)!==T){8 g=0.3("d-f");8 C=g.S(5,g.R-2);8 B=(0.3("d-D")=="Q-D"?"P":"o");8 c={"u":"t:s.r.q(9=\'"+C+"\', p=\'"+B+"\')","d-f":"O("+1.e+")"};0.3(c)}b(1.A&&0.m("N[9$=z]")){8 c={"y":0.y()+"v","w":0.w()+"v","u":"t:s.r.q(9=\'"+0.n("9")+"\', p=\'o\')"};0.3(c).n("9",1.e)}b(1.M&&0.m("a, L")&&0.3("l")===""){0.3("l","K")}})}})};',62,65,'_4|_1||css|||jQuery||var|src||if|_8|background|shim|image|bg|function||browser|true|position|is|attr|scale|sizingMethod|AlphaImageLoader|Microsoft|DXImageTransform|progid|filter|px|height||width|png|imgs|_7|_6|repeat|backgrounds|_3|each|this|version|parseInt|relative|input|applyPositioning|img|url|crop|no|length|substring|null|match|find|msie|return|apply_positioning|gif|extend|supersleight|fn'.split('|'),0,{}));

// Set up wrapper object
if(!TELUS){
  var TELUS = {};
};
// Homepage-specific code
TELUS.homepage = {
  init  : function(){
    TELUS.isIE6 = (jQuery.browser.msie && jQuery.browser.version.indexOf("6")==0);
    
    var curr = jQuery('.pageContent div.banner-swap')[0].id;
    var prev = curr;
    var tmr;
    var indicator = jQuery('<img src="/accueil/images/indicator.png" id="indicator"/>').hide().appendTo('#banner');
    if(!TELUS.isIE6) {
      indicator.bind('load',function(){
        jQuery(this).fadeIn('slow');
      })
    } else {
      try{document.execCommand("BackgroundImageCache",false,true);}catch(e){};
      indicator.show(); 
    };
    jQuery("#banner").supersleight({shim: '/accueil/images/x.gif'});
    var swaps = jQuery('.pageContent div.banner-swap *');
    swaps.bind('mouseover',function(e){
      var that = (jQuery(e.target).hasClass('banner-swap')) ? e.target : jQuery(this).parents('.banner-swap').get(0);
      // move the indicator
      indicator.css('left',that.offsetLeft+(Math.round(jQuery(that).outerWidth()-indicator.outerWidth())/2));
      if(that.id != curr){
        // clear timer
        clearTimeout(tmr);
		 tmr = window.setTimeout(function(){
		   jQuery('#banner a:visible:not(.curr)').css('display','none');
		   var currBanner = jQuery('#banner a.curr');
		   currBanner.fadeOut(444,function(){
			 currBanner.removeClass('curr');
		   });
		   
		   jQuery('#banner-' + that.id).parent().addClass('curr').fadeIn(888,function(){
			 if(that.firstChild.id.indexOf(curr)>=0){
			   jQuery(that).css({'display':'block'});
			 };
			});
		  },555);
		};
      prev = curr;
      curr = that.id;
      return true;
    });
  }
};
// add the additional banners
/*document.getElementById('banner-inner').innerHTML += '<a href="/portalWeb/appmanager/cpPortal/consumerPortal?_nfpb=true&_pageLabel=telephone_index" style="display:none;"><img src="cs_common/images/banners/homephone.jpg" alt="Rock-solid home phone for a rock-solid price." id="banner-homephone" /></a><a style="display:none;" href="http://promo2.telus.com/tm/09/q3/high_speed/hs_ab/index.html?CMP=ILCintcs050208vrdrt_tcom_frontAB" class="bc|http://promo2.telus.com/tm/09/q3/high_speed/hs_bc/index.html?CMP=ILCintcs050208vrdrt_tcom_frontBC ab|http://promo2.telus.com/tm/09/q3/high_speed/hs_ab/index.html?CMP=ILCintcs050208vrdrt_tcom_frontAB"><img src="cs_common/images/banners/internet.jpg" alt="Get TELUS High Speed from $20/mo. in a bundle." id="banner-internet" /></a><a style="display:none;" href="http://promo2.telus.com/tm/09/q3/ttv/ab_ip/index.html?CMP=ILCintcs050208vrdrt_tcom_frontAB" class="bc|http://promo2.telus.com/tm/09/q3/ttv/bc/index.html?CMP=ILCintcs050208vrdrt_tcom_frontBC ab|http://promo2.telus.com/tm/09/q3/ttv/ab_ip/index.html?CMP=ILCintcs050208vrdrt_tcom_frontAB"><img src="cs_common/images/banners/telustv.jpg" alt="All digital TELUS TV is here." id="banner-telustv" /></a><a style="display:none;" href="http://www.telusmobility.com"><img src="cs_common/images/banners/mobility.jpg" alt="Get a jump on life, with web to go." id="banner-mobility" /></a>';*/
TELUS.homepage.init();