/* Copyright (C) 2009 Microsoft Corporation */
if(null==window["Live"]){window["Live"]={Header:{}};}Live.Header={};Live.Header.Utilities=
{init:function()
{var s=Live.Header.Utilities;s.ib();s.is();},
ib:function()
{this.menu=document.getElementById("mainmenu");if(!this.menu)
return;this.header=document.getElementById("header");this.jewel=this.header.getElementsByTagName("a")[0];this.jewelImg=this.jewel.getElementsByTagName("img")[0];this.menu.style.position="absolute";if(this.jewel)
this.attachEvent(this.header,"mouseover",this.lhs);},
is:function()
{this.searchForm=document.getElementById("searchform");if(!this.searchForm)
return;this.inputs=document.getElementById("efpInputs");this.go=document.getElementById("go");this.q=document.getElementById("q");if(this.searchForm)
{this.attachEvent(this.searchForm.childNodes[0],"mouseover",this.sin);this.attachEvent(this.searchForm.childNodes[0],"mouseout",this.sout);this.sc="efpSf";}
if(this.go)
{this.attachEvent(this.go,"focus",this.sinf);this.attachEvent(this.go,"blur",this.soutf);}
if(this.q)
{this.attachEvent(this.q,"focus",this.sinf);this.attachEvent(this.q,"blur",this.soutf);}
},
sinf:function(e)
{var s=Live.Header.Utilities;s.searchForm.hf=true;s.sin(e);},
soutf:function(e)
{var s=Live.Header.Utilities;s.searchForm.hf=false;s.sout(e);},
sin:function(e)
{var s=Live.Header.Utilities;s.searchForm.className=s.sc+" active";},
sout:function(e)
{var s=Live.Header.Utilities;s.cancelBubble(e);if(s.searchForm.hf)return;s.searchForm.className=s.sc;},
sbin:function(el)
{el.className+=" efpOver";if(el.src)
el.src=el.src.replace(/\.gif/gi,'_Over.gif');},
sbout:function(el)
{el.className=el.className.replace(/ efpover/gi,"");if(el.src)
el.src=el.src.replace(/_Over/gi,'');},
lhs:function()
{var s=Live.Header.Utilities;s.detachEvent(s.header,"mouseover",s.lhs);if(Live.Header.MenuContents)
{s.hsl();return;}
var el=document.createElement("script");el.onload=el.onreadystatechange=s.hsl;document.getElementsByTagName("head")[0].appendChild(el);el.src=Live.Header.Settings.TemplateUrl+"templates/menuxhtml/header.js";},
hsl:function()
{var s=Live.Header.Utilities;if(!Live.Header.MenuContents)
return;s.menu.innerHTML=Live.Header.MenuContents.replace(/\{0\}/gi,Live.Themes.ThemeUrl);s.attachEvent(s.jewel,"click",s.toggleMenu);},
toggleMenu:function(e)
{var s=Live.Header.Utilities;if(s.menu.style.display!="block")
{s.cancelBubble(e);s.attachEvent(document,"click",s.toggleMenu);s.attachEvent(s.menu,"click",s.cancelBubble);s.show_helper(e,s);}
else
{s.detachEvent(document,"click",s.toggleMenu);s.detachEvent(s.menu,"click",s.cancelBubble);s.hide_helper(e,s);}
},
show_helper:function(e,s)
{s.jewel.firstChild.className+=" Down";s.show(e,s);},
hide_helper:function(e,s)
{s.hide(e,s);s.jewel.firstChild.className=s.jewel.className.replace(" Down","");},
show:function(e,s)
{s.menu.style.display="block";},
hide:function(e,s)
{s.menu.style.display="none";},
getAction:function()
{var s=Live.Header.Utilities;},
dws:function(url)
{var h=Live.Header,u=h.Utilities,s=h.Settings;u.searchForm.action=s.wsa;u.inputs.innerHTML=u.createInputs(s.wsa,s.SearchFormCode||s.LinkReportingValues);},
initsi:function(h)
{var hs=h.Settings;hs.wsa=hs.SearchActionOverride||'http://search.sympatico.msn.ca/results.aspx';hs.sa=hs.SearchActionDefault||hs.wsa;hs.cs=hs.wsa!=hs.sa;hs.inp=h.Utilities.createInputs(hs.sa,hs.SearchFormCode||hs.LinkReportingValues);},
createInputs:function(url,form)
{var u=Live.Header.Utilities.parseUrl(url);var ip=" ";for(var i=0;u.params&&i<u.params.length;i++)
{if(u.params[i].name!='q'&&u.params[i].name!='mkt')
ip+='<input type="hidden" name="'+u.params[i].name+'" value="'+u.params[i].value+'">';if(u.params[i].name=='FORM')
form=null;}
if(form)
{ip+='<input name="FORM" type="hidden" value="'+form+'">';}
return ip;},
parseUrl:function(url)
{var u={};u.url=url;u.idx=url.indexOf("?");if(u.idx==-1)return u;u.path=url.substring(0,u.idx);u.params=Live.Header.Utilities.parseParams(url.substring(u.idx+1));return u;},
parseParams:function(qs)
{var p=[],vars=qs.split('&');for(var i=0;i<vars.length;i++)
{var prop=vars[i].split('=');if(prop.length>1)
{p[p.length]={name:prop[0],value:prop[1]};}
}
return p;},
target:function(e){if(window["event"]){return event.srcElement;}else if(e){return e.target}},
cancelBubble:function(e){if(e&&e.stopPropagation){e.stopPropagation();}else if(window["event"]){event.cancelBubble=true;}},
attachEvent:function(el,ev,cb){if(el.attachEvent){el.attachEvent("on"+ev,cb);}else if(el.addEventListener){el.addEventListener(ev,cb,false);}},
detachEvent:function(el,ev,cb){if(el.detachEvent){el.detachEvent("on"+ev,cb);}else if(el.removeEventListener){el.removeEventListener(ev,cb,false)}}
}
Live.Header.rh=function(){var b=[],h=Live.Header,s=h.Settings,u=h.Utilities;u.initsi(h);s.Market='en-ca';s.Product='Live.Search';b.push('<div id="header" metype="me"><div class="stroke"></div><div class="inside">');b.push('<div class="BrandSection"><table cellspacing="0" cellpadding="0"><tr><td><a href="#" class="jewel_css" onclick="return false" onmouseenter="this.className += \' jewel_css_hover_ie\'" onmouseleave="this.className = this.className.replace(\' jewel_css_hover_ie\', \'\')"><span><img src="'+Live.Themes.ThemeUrl+'controls/img/jewel_collage.png" width="49" height="147" alt=""></span></a></td><td><span class="Product">Windows Live<span class="tm">&trade;</span> Search</span></td></tr></table><div style="position:relative;"><div style="right:auto;left:auto;" id="mainmenu" class="Menu"></div><span style="font-size:0;"> </span></div></div>');b.push('<div class="MeSection ');b.push(!s.ViewerCid||!s.IsAuthenticated?'simple':'full');b.push('">');if(s.MeContents){b.push(s.MeContents)}else{b.push('<div class="sme"><span style="');b.push((s.NameDisplay=((s.FriendlyName==null||s.FriendlyName=='')?'display:none;':'')));b.push('"> ');b.push(s.FriendlyName);b.push(' </span><span style="');b.push((s.ChangeDisplay=(!s.IsAuthenticated?(s.NotYouUrl!=null?'':'display:none'):(s.ChangeUserUrl!=null?'':'display:none;'))));b.push('">(<a href="'+(s.NotYouUrl||'#')+'" style="');b.push((s.IsAuthenticated?'display:none;':''));b.push('">Not you?</a><a href="'+(s.ChangeUserUrl||'#')+'" style="');b.push((!s.IsAuthenticated?'display:none;':''));b.push('">Change user</a>)</span><span style="');b.push(((s.NameDisplay==''||s.ChangeDisplay=='')?'':'display:none;'));b.push('"> | </span><a class="ppl" href="');b.push((s.AuthUrl||'#'));b.push('" style="');b.push((!s.AuthUrl||!s.IsAuthenticated?'display:none;':''));b.push('">Sign out<img src="'+Live.Themes.ThemeUrl+'controls/img/passport.gif"></a><a class="ppl" href="');b.push((s.AuthUrl||'#'));b.push('" style="');b.push((!s.AuthUrl||s.IsAuthenticated?'display:none;':''));b.push('">Sign in<img src="'+Live.Themes.ThemeUrl+'controls/img/passport.gif"></a></div>');}b.push('</div>');b.push('<div class="SearchSection">');if(s.SearchContents){b.push(s.SearchContents)}else{b.push('<form class="efpSf');if(s.SearchQuery){b.push(' active');}b.push('" name="searchform" id="searchform" action="');b.push(s.sa);b.push('"><table class="efpSc" cellpadding="0" cellspacing="0"><tr><td><div class="efpHl"><span><input tabindex="1" class="q" id="q" name="q" value="');b.push(s.SearchQuery||'');b.push('">');b.push(s.cs?'<button tabindex="1" class="efpSb" onmouseover="Live.Header.Utilities.sbin(this);" onmouseout="Live.Header.Utilities.sbout(this);" type="submit">Search Search</button>':'<input name="go" id="go" onmouseover="Live.Header.Utilities.sbin(this);" onmouseout="Live.Header.Utilities.sbout(this);" tabindex="1" class="go" type="image" align="middle" src="'+Live.Themes.ThemeUrl+'controls/img/SrchBtn.gif" value="Search">');b.push('</span></div><input type="hidden" name="mkt" value="en-CA"></td><td id="efpInputs">');b.push(s.inp);b.push('</td>');b.push(s.cs?'<td><div class="efpHl"><span><button tabindex="1" onmouseover="Live.Header.Utilities.sbin(this);" onmouseout="Live.Header.Utilities.sbout(this);" onclick="Live.Header.Utilities.dws();" class="efpSb" type="submit">Web</button></span></div></td>':'');b.push('</tr></table></form>');}b.push('<div class="not"></div></div>');b.push('<div id="efp_spot" class="efp_spot"></div><div style="clear:both;"></div></div></div><div id="pagebg"></div>');document.write(b.join(''));h.Utilities.init();}
Live.Header.MenuContents='<ul class="Main"><li><a class="icon" href="http://www.live.com/?mkt=en-CA"><strong>Live.com</strong></a></li><li class="sep"></li><li><a class="icon" href="http://favorites.live.com/?mkt=en-ca"><img border="0" src="{0}controls/img/Favorites.gif">Favorites</a></li><li><a class="icon" href="http://local.live.com/?mkt=en-ca "><img border="0" src="{0}controls/img/Local.gif">Local</a></li><li><a class="icon" href="http://safety.live.com/?mkt=en-ca"><img border="0" src="{0}controls/img/OneCare.gif">OneCare</a></li><li><a class="icon" href="http://spaces.live.com/?mkt=en-CA"><img border="0" src="{0}controls/img/Spaces.gif">Spaces</a></li></ul><ul class="Tools"><li><nobr><a href="https://account.live.com/?mkt=en-ca">Account</a></nobr></li><li><nobr><a href="http://feedback.live.com/default.aspx?locale=en-ca&amp;productkey=wlsearchbook&amp;page=wlfeedback_home_form&#xD;&#xA;      ">Feedback</a></nobr></li></ul>';Live.Header.rf=function(){var b=[];b.push('<div id="footer" class="Footer">');b.push('<div class="FooterLeft"><ul> <li class="copyright"><bdo dir="ltr">© ');b.push((new Date()).getFullYear());b.push(' Microsoft</bdo></li> <li class="itm"><a target="_new" href="http://www.microsoft.com/library/toolbar/3.0/trademarks/en-ca.mspx" id="Trademarks">Trademarks</a></li> <li class="sep">|</li> <li class="itm"><a target="_new" href="http://g.msn.ca/0PR_/enca" id="Privacy">Privacy</a></li> <li class="sep">|</li> <li class="itm"><a target="_new" href="http://g.msn.ca/0TO_/enca" id="Legal">Legal</a></li>'+Live.Footer.Custom+'</ul></div>');b.push('<div class="FooterRight"><ul><li class="itm"><a target="_new" href="https://account.live.com/HelpCentral.aspx?mkt=en-ca" id="Help">Help Central</a></li> <li class="sep">|</li> <li class="itm"><a target="_new" href="https://account.live.com/?mkt=en-ca" id="Account">Account</a></li> <li class="sep">|</li> <li class="itm"><a target="_new" href="http://feedback.live.com/default.aspx?locale=en-ca&amp;productkey=wlsearchbook&amp;page=wlfeedback_home_form&#xD;&#xA;      " id="Feedback">Feedback</a></li></ul></div>');b.push('</div><div style="clear:both"></div>');document.write(b.join(''));}
