$(document).ready(function(){
   var COOKIE_NAME = 'telusCSR_lang';
   lang = $.cookie(COOKIE_NAME);
   txt_en = 'english';
   txt_fr = 'français';
   
   if(lang=='en') {
      $('a.cookie_setter').text(txt_fr); 
   } else {
      $('a.cookie_setter').text(txt_en);
   }
   $('a.cookie_setter').click(function() { // set cookie by number of days
      newLang = $(this).attr('rel');
   if(newLang=='en') {
      setLangTo  = 'fr';
      setText    = txt_en;
   } else {
      setLangTo  = 'en';
      setText    = txt_fr;
   }
      var date = new Date();
      date.setTime(date.getTime() + (3 * 24 * 60 * 60 * 1000));
      $.cookie(COOKIE_NAME, setLangTo, { path: '/', expires: date });
   }); 
   
   // submit button hover state
   $('span.submitBtnInput input').hover(
      function(){
      if(lang=='en') {
         $(this).attr('src','_img/en/btn-submit-over.gif');
      } else {
         $(this).attr('src','_img/fr/btn-submit-over.gif');
      }
   },
      
      function(){
      if(lang=='en') {
         $(this).attr('src','_img/en/btn-submit.gif');
      } else { 
         $(this).attr('src','_img/fr/btn-submit.gif');
      }
      
   }
);
   
   // include this for the facebox plugin
   $('a[rel*=facebox]').facebox();
   
   // add before the particular class for GRI
   $(".ia2007").before('<img src="/csr2007/csr/_img/shared/icon-assurance-2007.gif" class="marginImgRight" alt="." title="independent assurance provided by PricewaterhouseCoopers LLP (PWC) in 2007" />').css('margin-top','0');
   $(".iaprior").before('<img src="/csr2007/csr/_img/shared/icon-assurance-prior.gif" class="marginImgRight" alt="." title="independent assurance provided by PricewaterhouseCoopers LLP (PWC) in previous years" />').css('margin-top','0');
   $(".iamousear").before('<img src="/csr2007/csr/_img/shared/icon-mouse-annualreport.gif" class="marginImgRight" alt="" />').css('margin-top','0');
   $(".addicon").after('<div class="clearboth" style="height: 10px;"></div>');   
   
}); 
