jQuery.cookie=function(name,value,options){if(typeof value!='undefined'){var expires='',date;options=options||{};if(value===null){value='';options.expires=-1;}if(options.expires&&(typeof options.expires=='number'||options.expires.toUTCString)){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):'',domain=options.domain?'; domain='+(options.domain):'',secure=options.secure?'; secure':'';document.cookie=[name,'=',encodeURIComponent(value),expires,path,domain,secure].join('');}else{var cookieValue=null,i,cookie,cookies;if(document.cookie&&document.cookie!=''){cookies=document.cookie.split(';');for(i=0;i<cookies.length;i++){cookie=jQuery.trim(cookies[i]);if(cookie.substring(0,name.length+1)==(name+'=')){cookieValue=decodeURIComponent(cookie.substring(name.length+1));break;}}}return cookieValue;}};
var reURL=/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,
url=window.location.href||'',url_parts=reURL.exec(url)||[],hash=url_parts[13]||'',videos=[
'how_is_it_spread',
'h1n1_overview',
'when_to_see_a_doctor',
'reducing_your_risk_at_work',
'reducing_your_risk_at_home',
'reducing_the_risk_at_school',
//'h1n1_overview',
'how_is_it_spread',
'how_long_does_swine_flu_last', //7
'should_i_see_a_doctor',
'what_can_i_do_to_feel_better',
'what_is_the_difference',
'will_i_get_sick',
'myths_and_facts',
'how_is_h1n1_different'],
titles_en=[
'How is it spread?',
'H1N1 Overview',
'When to see a doctor',
'Reducing your risk at work',
'Reducing your risk at home',
'Reducing the risk at school',
//'h1n1_overview',
'How is it spread?',
'FAQ: How long does H1N1 last?', //7
'FAQ: Should I see a doctor if I think I have H1N1 but am otherwise healthy?',
'FAQ: What can I do to feel better?',
'FAQ: What’s the difference between Cold, Flu and H1N1 Flu?',
'FAQ: Will I get sick if I’m in a room with someone who is infected?',
'The H1N1 Vaccine – Myths &amp; Facts',
'How is H1N1 Different?'
],
titles_fr=[
'Comment le virus H1N1 se propage-t-il?',
'Aperçu du virus H1N1',
'Quand consulter un médecin?',
'Réduire les risques au travail',
'Réduire les risques à la maison',
'Réduire les risques à l’école',
//'h1n1_overview',
'Comment le virus H1N1 se propage-t-il?',
'FAQ: Combien de temps le virus H1N1 dure-t-il?', //7
'FAQ: Devrais-je voir un médecin si je pense avoir le virus H1N1, mais que je me sens en bonne santé?',
'FAQ: Que puis-je faire pour me sentir mieux?',
'FAQ: Quel est la différence entre un rhume, une grippe et la grippe H1N1?',
'FAQ: Vais-je être malade si je me retrouve dans la même pièce que quelqu’un d’infecté?',
'Le vaccin H1N1 - Mythes et réalité',
'Les particularités du virus H1N1'
],titles=titles_en,cp={path:'/',expires:366},flashMovie,local=(window.location.href.substr(0,4)!='http')?'true':'false';
function intval(i){return parseInt(i,10);}
function toChapterName(i){i=intval(i);if(i<=0)i=0;return (i<videos.length?videos[i]:i);}
function toTitleName(i,c){i=intval(i);if(i<=0)i=0;if(lang=='fr')titles=titles_fr;return (i<titles.length?titles[i]:c);}
function parseChapter(s){var z='[^a-z0-9_]+',u=url.toLowerCase(),v=s.toLowerCase().replace('/^'+z+'|'+z+'$/ig','').replace('/'+z+'/ig','_'),i,re,j=-1;if(/^[0-9]+$/.test(v))j=intval(v);else for(i in videos){re=new RegExp(videos[i],'ig');if(re.test(v)||re.test(u)){j=intval(i);break;}}
if(j<0)j=(typeof chapId!='undefined')?intval(chapId):0;return j;}
function setNewUrl(id,chapterName){
jQuery('#title').html(toTitleName(id,chapterName)).next('div.entry').find('p').hide();
jQuery('#sidebarWidget1,#sidebarWidget3').find('a.selected').removeClass('selected');
var s=toChapterName(id);window.location.hash=escape(s);}
function trackFlash(){flashMovie=swfobject.getObjectById('flashContent');if(typeof flashMovie!='undefined'&&flashMovie&&typeof flashMovie.trackClose=='function')flashMovie.trackClose();}
function loadVideo(id){lang=lang||'en';var a='',N='i',c,$=jQuery,FC='flashContent',SS='selected',e,
//PP='http://h1n1.bluerush.ca',
PP=(lang!='fr')?'http://d2lab9g6o4k9jt.cloudfront.net/r02':'http://daawvs2qycuqn.cloudfront.net/r01',
BP=(lang!='fr')?'/player/blue_player_9.swf':'/player/blue_player_2.swf',
RC=(lang!='fr')?'../config/player_settings_24.xml':'../config/player_settings_16.xml',
FV={production:'true',LocalPlayer:local,chapterId:id,UrlPrefix:PP+'/player/'};
FV.RemoteConfig=RC;
FV.defaultlang=FV.lang=lang;
try{FV.chapterId=id=id||parseChapter(hash);
if(id==0||id==6){c=intval($.cookie(N));if(c==1){FV.chapterId=id=0;a='&autoplay=0';FV.autoplay=0;}else{FV.chapterId=id=6;$.cookie(N,1,cp);}}
swfobject.embedSWF(PP+BP,//?production=true&LocalPlayer='+local+'&chapterId='+id+a,
FC,'710','470','9',PP+'/player/expressInstall.swf',FV,{menu:'false',allowfullscreen:'true',allowscriptaccess:'always'},{id:FC});
window.onbeforeunload=trackFlash;
id=intval(id);
if(id>=7&&id<12)jQuery('#sidebarWidget3 li a')[id-7].className=SS;
if(id==7)jQuery('#sidebarWidget3 li a')[id-7].className=SS+' firstFAQ';
if(id>=12&&id<14)jQuery('#sidebarWidget2 a')[id-12+1].className='list '+SS;
if(id==14)jQuery('#sidebarWidget2 a')[0].className='list '+SS;
}catch(e){}
}
jQuery('#sidebarWidget3 li a:first').addClass('firstFAQ');
function SetStop(){flashMovie=swfobject.getObjectById('flashContent');if(typeof flashMovie!='undefined'&&flashMovie&&typeof flashMovie.jsStop=='function')flashMovie.jsStop();}
if(typeof chapId!='undefined'||document.getElementById('flashContent')){loadVideo();jQuery(function(){jQuery('a[target=_blank]').click(SetStop);});}
