?? hf.js
字號:
/* Copyright (C) 2007 Microsoft Corporation */
/*@cc_on@*/
if(!('Live'in window))Live={};if(!('Header'in Live))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.jewel,"click",this.lhs);this.attachEvent(this.jewel,"focus",this.lhs);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.jewel,"click",s.lhs);s.detachEvent(s.jewel,"focus",s.lhs);s.detachEvent(s.header,"mouseover",s.lhs);s.hsl();if("click"===event.type)
s.toggleMenu();},
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);/*@if (@_jscript_version <= 5.6) // if (ie6-)
s.attachEvent(s.menu,'mouseenter',s.menu_mouseenterElementEvent_ie6);
@end@*/
},
menu_mouseenterElementEvent_ie6:function(e)
{var s=Live.Header.Utilities;s.menu.style.visibility='hidden';s.menu.style.visibility='visible';},
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);s.menu.style.visibility='hidden';s.menu.style.visibility='visible';},
hide_helper:function(e,s)
{s.hide(e,s);s.jewel.firstChild.className=s.jewel.firstChild.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://www.live.com/';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)}}
}
var m_hsTemplate={},
eHeader=document.getElementById('headerPlaceholder');Live.Header.rh=function()
{var b=[],h=Live.Header,s=h.Settings,u=h.Utilities,sHtml;u.initsi(h);s.Market='zh-cn';s.Product='Live.Spaces';b.push('<div id="header" metype="me"><div class="stroke"></div><div class="inside">');b.push('{cobrand}');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('">不是您的帳戶嗎?</a><a href="'+(s.ChangeUserUrl||'#')+'" style="');b.push((!s.IsAuthenticated?'display:none;':''));b.push('">更改用戶</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('">退出<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('">登錄<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('"><label for="q">鍵入搜索條目</label><label for="go">搜索</label><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 id="goLocal" tabindex="1" class="efpSb" onmouseover="Live.Header.Utilities.sbin(this);" onmouseout="Live.Header.Utilities.sbout(this);" type="submit">搜索 Spaces</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="zh-cn"></td><td id="efpInputs">');b.push(s.inp);b.push('</td>');b.push(s.cs?'<td><div class="efpHl"><span><button id="goWeb" tabindex="1" onmouseover="Live.Header.Utilities.sbin(this);" onmouseout="Live.Header.Utilities.sbout(this);" onclick="Live.Header.Utilities.dws();" class="efpSb" type="submit">網(wǎng)頁</button></span></div></td>':'');b.push('</tr></table></form>');}b.push('</div>');b.push
(
'<div id="efp_spot" class="efp_spot"></div>'
+
'<div style="clear:both"></div>'
+
'</div>'
+
'</div>'
+
'<div id="pagebg"></div>'
);m_hsTemplate.fullYear=s.FullYear||new Date().getFullYear()+'';m_hsTemplate.cobrand=
correctCobrand
(
s.CobrandLayout||'',
s.CobrandImage||'',
s.CobrandImageAltText||'',
s.CobrandFromString||'',
s.CobrandFromStringTop||'0',
s.CobrandWindowsProductNameTop||'0',
s.LiveBrandPrefix
?'1'===s.LiveBrandPrefix
:false,
s.CustomRenderingMode||'0',
s.NoIEFilters||'0'
);sHtml=b.join('');sHtml=fillTemplate(sHtml);if(eHeader)
{eHeader.innerHTML=sHtml;}
else
{document.write(sHtml);}
u.init();}
if(eHeader)
{Live.Header.rh();}
function correctCobrand(siLayout,sImage,sImageAltText,sFromString,siFromStringTop,siWindowsProductNameTop,bLiveBrandPrefix,siCustomRenderingMode,siNoIEFilters)
{var iLayout=Number(siLayout),
bNoCobrand=''===siLayout||'0'===siLayout,
bFlatStyle=false,
sParentClass=
bNoCobrand
?'BrandSection'
:'BrandSection cobrandSection',
sProductPrefix=
bLiveBrandPrefix
?'Live '
:'Windows Live<span class="tm">™</span> ',
sProduct='<span class="Product">{productPrefix}Spaces</span>',
sBeta='',
sMarketCobrand='',
sJewelAlt="更多服務(wù)",
sPoweredBy="Powered by {0} Windows Live",
sJewelImage,
sJewelImage_ie6;if(isRightToLeftMarket())
sPoweredBy=sPoweredBy.replace('{0} Windows Live','Windows Live {0}');m_hsTemplate.productPrefix=sProductPrefix;m_hsTemplate.productName=
bNoCobrand
?sProduct
:sProduct.slice(0,-7)+' {beta}</span>';m_hsTemplate.fromStringTop=siFromStringTop;m_hsTemplate.fromStringTopUndo=String(-Number(siFromStringTop));m_hsTemplate.windowsProductNameTop=siWindowsProductNameTop;m_hsTemplate.beta=sBeta;m_hsTemplate.marketCobrand=sMarketCobrand;m_hsTemplate.jewelAlt=sJewelAlt;m_hsTemplate.luminance=getLuminance();m_hsTemplate.cobrandImage=
3===iLayout
?transparentImageHtmlStyle(sImage,sImageAltText,'position:relative; top:{fromStringTopUndo}px;')
:transparentImageHtml(sImage,sImageAltText);m_hsTemplate.cobrandFrom='<div class="cobrand_jewel_from" style="position:relative; top:{fromStringTop}px;">{cobrandFromString}</div>';m_hsTemplate.cobrandFromString=sFromString.replace('{0}','{cobrandImage}');m_hsTemplate.cobrandPoweredBy=sPoweredBy.replace('{0}','{cobrandPoweredByImage}');m_hsTemplate.cobrandPoweredByImage=transparentImageHtml(Live.Themes.ThemeUrl+'controls/img/cobrand_1_flag.png','');m_hsTemplate.cobrandSeparatorImage=transparentImageHtml(Live.Themes.ThemeUrl+'controls/img/cobrand_3_separator_{luminance}.png','');m_hsTemplate.cobrandFlagImage=transparentImageHtml(Live.Themes.ThemeUrl+'controls/img/cobrand_3_flag.png','');m_hsTemplate.jewelButton=
bFlatStyle
?
!iLayout||3===iLayout
?correctCobrand_flagImage()
:''
:
!iLayout||3===iLayout
?correctCobrand_jewelButton()
:correctCobrand_cobrandJewelButton();sJewelImage_ie6=
'<span class="jewel_css_filter jewel_css_filter_ie6"></span>'
+
'<span style="position:absolute;display:block;height:1px;width:1px;overflow:hidden;padding:1px;">{jewelAlt}</span>';sJewelImage=
'<span class="jewel_css_filter">'
+
'<img src="'+Live.Themes.ThemeUrl+'controls/img/jewel_collage.png" width="49" height="147" title="" alt="更多服務(wù)">'
+
'</span>';if('1'===siNoIEFilters)
sJewelImage_ie6=sJewelImage;m_hsTemplate.jewelImage=
/*@if (@_jscript_version <= 5.6) // if (ie6-)
sJewelImage_ie6;
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -