var reURL=/^(?:([^:\/?#]+):)?(?:\/\/((?:(([^:@]*):?([^:@]*))?@)?([^:\/?#]*)(?::(\d*))?))?((((?:[^?#\/]*\/)*)([^?#]*))(?:\?([^#]*))?(?:#(.*))?)/,url=window.location.href||"",url_parts=reURL.exec(url)||[],cp={path:"/",expires:30};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}};function menu_accordion(parentClass,nextClass){$("a."+parentClass).each(function(){var p=$(this),n=p,D="div.smenu,div.tmenu",VV=":visible",m=$("#menu").find(D),v;while((n=n.next())&&n[0]){if(n.hasClass(nextClass)){if(p.hasClass("select")){n.show()}return p.click(function(){if(p.attr("href").substr(0,1).toLowerCase()=="h"){return true}else{if(p.hasClass("goto")){if(!p.next(D).is(VV)){window.location.href=p.attr("ohref")}}}v=m.filter(VV).not(n.parents("div"));p.attr("visible",n.filter(VV).length);separation_height(n,v);v.add(n).animate({height:"toggle"},{queue:false,duration:"slow"})})}if(n.hasClass(parentClass)){break}}})}function getMenuHeight(r,a){var m=$("#menu"),h;if(r){r.show()}if(a){a.hide()}h=m.height();if(r){r.hide()}if(a){a.show()}return parseInt(h,10)}function separation_height(r,a){var menu_h=getMenuHeight(r,a),cont_h=parseInt($("#content").height(),10),hh=(menu_h>cont_h)?menu_h:cont_h,b=$("#menu_border_mid"),c;hh=(hh<=100)?0:hh-80;c={height:hh};r?b.animate(c,{queue:false,duration:"slow"}):b.css(c);return hh}function loadVideo(path,url,flashvars){var w=735,h=390,p={menu:"false",allowfullscreen:"true",allowscriptaccess:"always"},a={id:"vid"},f=flashvars||{};f.LocalPlayer=(url.substr(0,4)!="http");f.width=w;f.height=h-30;f.controlsColor=3961732;f.controlerColor=14606046;f.contrastValue=30;f.production=true;if(url){f.URL=url}swfobject.embedSWF(path+"/player/blue_player_091004.swf","videoplayer",w,h,"9.0.28",path+"/player/expressInstall.swf",f,p,a)}function cleanURL(url){return url?url.toLowerCase().replace(/\s*([a-z]+\:)\/\/([a-z0-9\-\_\.\:]+)/ig,"").replace(/[\\\/]+/g,"/").replace(/\s*[#?&]+.*/g,"").replace(/[^a-z0-9\/\-\_\.\:]+/ig,"").replace(/[\\\/]+$/g,"").replace(/^[\\\/]+/g,""):""}function fixMenu(url){$("#container").removeClass("js");var p=url_parts,u=url||p[9]||p[10]||p[11],r=$([]),D="div.tmenu,div.smenu",H="href",OH="o"+H,m=$("#menu").find(D).hide().end();if(u){u=cleanURL(u);if(u.length>1){m.find("a").each(function(j,n,h){var s=$(this).filter(".select,.thirdselect");if(s[0]){r=s}else{if((h=n.href)&&!/(^[jJ])|(#$)/.test(h)&&cleanURL(h).indexOf(u)>=0){r=r.add(n)}}});if(r.length<1){u=u.replace(/[\\\/]+[^\\\/]+$/g,"/");if(u.length>1){return fixMenu(u)}}else{if(r.length<3){if(r.hasClass("goto")){r.attr(OH,r.attr(H)).attr(H,"javascript:void(0);");r=r.next(D).find("a")}r=$(r[0]);r.parents(D).show()}}}}if(r.length>0){var m=$("#menu").find(".select,.thirdselect"),last=m.length-1,re=/^[\s\xA0]+|[\s\xA0]+$/g,b=[],z="";if(last>=0){m.each(function(i,a){var t=$(a),txt=t.text().replace(re,z),n=txt.length;if(n<1){txt=t.attr("title").replace(re,z);n=txt.length}if(n<1){txt=t.attr("alt").replace(re,z);n=txt.length}if(i==last){txt="<span>"+txt+"</span>"}b.push(txt)});$("#site_guide").html(b.join(" » "))}}}function lookCookie(n){var v=$.cookie(n);if(!v){$.cookie(n,true,cp)}return !!v}function firstVisit(){var ev=url.match(/(\/home)/i),fv=url.match(/(\/accueil)/i);if(ev|fv){$("#body").addClass("fv")}}function splashvideo(section,url,id){var b=lookCookie(section),v=0;if(!b){if(id){v=parseInt($("#"+id).attr("visible"),10)}if(v<1){window.location.href=url}}}function toggleTerms(){$("#jsheet h4+div.dtoggle").hide().prev("h4").click(function(){$(this).next("div.dtoggle").slideToggle("slow")})}function toggleBox(){$("#jsheet div.hd+div.boxContents").hide().prev("div.hd").click(function(){$(this).next("div.boxContents").slideToggle("slow")})}function menuloader(){$("a[href='#']").attr("href","javascript:void(0);");firstVisit();fixMenu();menu_accordion("fmenu","smenu");menu_accordion("smenu_link","tmenu");toggleTerms();separation_height()}String.prototype.beginsWith=function(t,i){if(i==false){return(t==this.substring(0,t.length))}else{return(t.toLowerCase()==this.substring(0,t.length).toLowerCase())}};function setCookie(name,value,expires,path,domain,secure){path=path||"/";var today=new Date();today.setTime(today.getTime());if(expires){expires=expires*1000*60*60*24}else{expires=365*1000*60*60*24}var expiresDate=new Date(today.getTime()+(expires));document.cookie=name+"="+escape(value)+((expires)?";expires="+expiresDate.toGMTString():"")+((path)?";path="+path:"")+((domain)?";domain="+domain:"")+((secure)?";secure":"")}function getCookie(check_name){var a_all_cookies=document.cookie.split(";"),i,a_temp_cookie="",cookie_name="",cookie_value="",b_cookie_found=false;for(i=0;i<a_all_cookies.length;i++){a_temp_cookie=a_all_cookies[i].split("=");cookie_name=a_temp_cookie[0].replace(/^\s+|\s+$/g,"");if(cookie_name==check_name){b_cookie_found=true;if(a_temp_cookie.length>1){cookie_value=unescape(a_temp_cookie[1].replace(/^\s+|\s+$/g,""))}return cookie_value}a_temp_cookie=null;cookie_name=""}if(!b_cookie_found){return null}}function newWindowCore(contentsURL,winName,x,y,width,height,menubar,toolbar,resizable,location,scrollbars,status){var args,newWin,w=width||180,h=height||300,x=(!x)?0:(window.screen.width/2)-(w/2),y=(!y)?0:(window.screen.height/2)-(h/2),winProps="menubar="+menubar+",toolbar="+toolbar+",resizable="+resizable+",location="+location+",status="+status+",scrollbars="+scrollbars;if(x<0){x=0}if(y<0){y=0}args="width="+w+",height="+h+","+winProps+",screenx="+x+",screeny="+y+",left="+x+",top="+y;newWin=window.open(contentsURL,winName,args);return newWin}var videoContentXml1=null;var videoContentXml2=null;function addVideoPlayer(videoXml){videoContentXml1=videoXml}function loadVideoContent1(){if(videoContentXml1==null){return}var flashvars={},params={},attributes={};flashvars.LocalPlayer=(window.location.href.substr(0,4)!="http");flashvars.width=735;flashvars.height=360;if(!autoPlayVideo){flashvars.autoplay=0}flashvars.RemoteConfig=videoContentXml1;flashvars.controlsColor=3961732;flashvars.controlerColor=14606046;flashvars.contrastValue=30;params.menu="false";params.allowfullscreen="true";params.allowscriptaccess="always";params.wmode="transparent";attributes.id="vid";swfobject.embedSWF("http://bluerush.vo.llnwd.net/o15/manulife/retirement_center/r_1_0/en/player/blue_player_20091023.swf","flashcontent","735","390","9.0.28","common/player/expressInstall.swf",flashvars,params,attributes)}function addVideoPlayer2(videoXml){videoContentXml2=videoXml}function loadVideoContent2(){if(videoContentXml2==null){return}var flashvars={},params={},attributes={};flashvars.LocalPlayer=(window.location.href.substr(0,4)!="http");flashvars.RemoteConfig=videoContentXml2;if(!autoPlayVideo){flashvars.autoplay=0}params.menu="false";params.allowfullscreen="true";params.allowscriptaccess="always";params.wmode="transparent";attributes.id="vid";swfobject.embedSWF("http://bluerush.vo.llnwd.net/o15/manulife/retirement_center/r_1_0/en/player/blue_player_openframe_09_12_18.swf","flashcontent","735","400","9.0.28","common/player/expressInstall.swf",flashvars,params,attributes)}function loadVideoContent(){loadVideoContent1();loadVideoContent2()}function stopVideoPlayer(){var flashMovie=swfobject.getObjectById("vid");if(typeof flashMovie!=="undefined"&&flashMovie){if(typeof flashMovie.jsStop=="function"){flashMovie.jsStop()}else{makeCallable(flashMovie,"jsStop")}}else{var hh=$("#videoplayer").html("");$("#SWFObjectExprInst,#vid").remove()}}function startVideoPlayer(){var flashMovie=swfobject.getObjectById("vid");if(typeof flashMovie!=="undefined"&&flashMovie){if(typeof flashMovie.jsPlay=="function"){flashMovie.jsPlay()}else{makeCallable(flashMovie,"jsPlay")}}}function makeCallable(i,name){if(i&&name){i[name]=(function(name){return function(){eval(this.CallFunction('<invoke name="'+name+'" returntype="javascript">'+__flash__argumentsToXML(arguments,0)+"</invoke>"))}})(name)}}$(function(){if(document.all&&document.execCommand&&!window.opera){try{document.execCommand("BackgroundImageCache",false,true)}catch(err){}}});