﻿
function cspMediaBlock_parseMetaTag(linkId){wtRemoveCId(linkId);return true;}
function cspMediaBlock_setImageStyle(divClass,divId,imgStyle){var browserUA=navigator.userAgent.toLowerCase();var object_div=document.getElementById(divId);if(object_div!=null&&object_div.getElementsByTagName("object").length>0){var img_div=cspGetObjectsOfElementByTagAndClass(object_div.parentNode,"div",divClass);if(img_div.length>0){for(var i=0;i<img_div.length;i++){if((browserUA.indexOf("firefox")!=-1||browserUA.indexOf("msie")!=-1||browserUA.indexOf("safari")!=-1||browserUA.indexOf("opera")!=-1)&&object_div.getElementsByTagName("object")[i].type!="application/x-shockwave-flash"){img_div[i].style.display=imgStyle;}}}}
return true;}
function cspMediaBlock_isFlashInstalled(){return cspMediaBlock_getFlashVersion()>=6;}
function cspMediaBlock_getFlashVersion(){var i;if(window.ActiveXObject){for(i=12;i>5;i--){try{var flash=new ActiveXObject("ShockwaveFlash.ShockwaveFlash."+i);return i;}catch(e){}}}else if(navigator.plugins&&navigator.plugins.length){for(i=0;i<navigator.plugins.length;i++){if(navigator.plugins[i].name.indexOf("Shockwave Flash")!=-1){return navigator.plugins[i].description.split(" ")[2];}}}
return 0;}
function cspMediaBlock_writeFlashObject(swfFile,width,height,divId){if(width==0||width==undefined){width="";}
if(height==0||height==undefined){height="";}
document.getElementById(divId).innerHTML="<object "+(width!=""?" width=\""+width+"\"":"")+(height!=""?" height=\""+height+"\"":"")+" classid=\"clsid:d27cdb6e-ae6d-11cf-96b8-444553540000\"><param name=\"movie\" value=\""+swfFile+"\"><param name=\"allowScriptAccess\" value=\"always\"><param name=\"quality\" value=\"high\"><param name=\"wmode\" value=\"transparent\"><embed "+(width!=""?" width=\""+width+"\"":"")+(height!=""?" height=\""+height+"\"":"")+" src=\""+swfFile+"\" quality=\"high\" bgcolor=\"#ffffff\" align=\"middle\" allowScriptAccess=\"always\" type=\"application\/x-shockwave-flash\" pluginspage=\"http:\/\/www.macromedia.com\/go\/getflashplayer\" wmode=\"transparent\"></object>";return true;}
function cspMediaBlock_showFlash(swfFile,width,height,divId,flImgCid,flCid,flImgId){if(cspMediaBlock_isFlashInstalled()){cspMediaBlock_writeFlashObject(swfFile,width,height,divId);if(flCid!=flImgCid){cspMediaBlock_parseMetaTag(flImgCid);}}else{cspMediaBlock_setImageStyle(flImgId,divId,"block");if(flCid!=flImgCid){cspMediaBlock_parseMetaTag(flCid);}}}
function cspMediaBlock_shouldShowSilverlight(version){$$U.detectUserAgent();return Silverlight.isInstalled(version)&&!((Sys.Browser.agent===Sys.Browser.Safari&&$$U.OS=="Windows")||Sys.Browser.agent===Sys.Browser.Opera);}
function cspMediaBlock_showSilverlight(slVer,slId,xamlFile,slWidth,slHeight,slColor,isWinLess,slFramerate,slImgCid,slImgId,slCid){if(cspMediaBlock_shouldShowSilverlight(slVer)){var silverlightDiv=document.getElementById(slId);cspMediaBlock_CreateSilverlightObject(xamlFile,silverlightDiv,slId,slWidth,slHeight,slColor,isWinLess,slFramerate,slVer);if(slCid!=slImgCid){cspMediaBlock_parseMetaTag(slImgCid);}}else{cspMediaBlock_setImageStyle(slImgId,slId,"block");if(typeof $$SL!="undefined"){$$SL.registerCreative(Function.createDelegate(window,function(){var silverlightDiv=document.getElementById(slId);cspMediaBlock_CreateSilverlightObject(xamlFile,silverlightDiv,slId,slWidth,slHeight,slColor,isWinLess,slFramerate,slVer);var dcsuri=window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1)+($$SG.get_IsDirectInstall()==true?"directinstall/panel":"pagegate/panel");dcsMultiTrack("DCS.dcsuri",dcsuri,"DCSext.wt_linkid",slCid,"WT.dl","5","WT.ti","Silverlight Panel Refresh","WT.ad","","WT.mc_id","","WT.seg_4","Yes","WT.sli","Yes","WT.slv","1.0");cspMediaBlock_setImageStyle(slImgId,slId,"none");}));}
if(slCid!=slImgCid){cspMediaBlock_parseMetaTag(slCid);}}}
function cspMediaBlock_CreateSilverlightObject(xamlFile,silverlightDiv,slId,slWidth,slHeight,slColor,isWinLess,slFramerate,slVer){Silverlight.createObject(xamlFile,silverlightDiv,slId+"_object",{width:slWidth,height:slHeight,background:slColor,isWindowless:isWinLess,framerate:slFramerate,version:slVer,enableFramerateCounter:"false",ignoreBrowserVer:"false",inplaceInstallPrompt:"false"},{onError:function(){},onLoad:null,onResize:null},null);}

if(typeof window.Csp=="undefined"){window.Csp={};}
Csp.Menu=function(id){this._id=id;this._menu=document.getElementById(id);this._hider=null;this._shower=null;$().keypress(Function.createDelegate(this,this.bodyKeyPress)).mouseover(Function.createDelegate(this,this.bodyMouseOver));$("a.h15-group",this._menu).click(Function.createDelegate(this,this.toggleMenu)).mouseover(Function.createDelegate(this,this.triggerShow));$("a.h15-link",this._menu).click(Function.createDelegate(this,this.linkClick));$("div.h15-menu-container",this._menu).mouseover(Function.createDelegate(this,this.keepMenuVisible));};Csp.Menu.prototype={bodyKeyPress:function(e){if(e.keyCode==27){var menu=$(".h15-menu-container:visible",this._menu);this.hideMenus();menu.prev("a.h15-group").each(function(){this.focus();});}},bodyMouseOver:function(e){this.clearShower();this.triggerHide();},clearHider:function(){if(this._hider!=null){window.clearTimeout(this._hider);this._hider=null;}},clearShower:function(){if(this._shower!=null){window.clearTimeout(this._shower);this.shower=null;}},doubleQuote:function(s){return s.replace("'","''");},hideMenus:function(e){$("div.h15-groups table td").removeClass("h15-selected");$(".h15-menu-container",this._menu).hide();},keepMenuVisible:function(e){e.stopPropagation();this.clearHider();this.clearShower();},linkClick:function(e){var link=$(e.target);var subgroup=link.parents("ul.h15-links").prev("h6.h15-menu-header");var group=subgroup.parents("div.h15-menu-container").prev("a.h15-group");this.webTrends3(link.text(),subgroup.text(),group.text());},showFlyout:function(e){var count=$(".h15-menu-container",this._menu).length;var index=$(".h15-menu-container",this._menu).index(e);if(document.documentElement.dir!="rtl"){if(index<2){this.showFlyoutLeft(e);}else if(index<count-2){if($(".h15-column:visible",e).length>1){this.showFlyoutRightMulti(e);}else{this.showFlyoutLeft(e);}}else{if($(".h15-column:visible",e).length>1){this.showFlyoutLeftMulti(e);}else{this.showFlyoutRight(e);}}}else{if(index<2){this.showFlyoutRight(e);}else if(index<count-2){if($(".h15-column:visible",e).length>1){this.showFlyoutLeftMulti(e);}else{this.showFlyoutRight(e);}}else{this.showFlyoutLeft(e);}}
e.show();window.setTimeout(function(){$(".h15-m1, .h15-m2, .h15-m3, .h15-m4",e).css("background","#fff");},0);},showFlyoutLeft:function(e){if(document.documentElement.dir=="rtl"){e.css("left",220-e.parent("td").width());}},showFlyoutLeftMulti:function(e){if(document.documentElement.dir=="rtl"){e.css("left",200-e.parent("td").width());}else{e.css("left",-200+e.parent("td").width());}},showFlyoutRight:function(e){if(document.documentElement.dir=="ltr"){e.css("left",-220+e.parent("td").width());}},showFlyoutRightMulti:function(e){e.css("left",-200+e.parent("td").width());},showMenu:function(e){this.hideMenus();var el=$(e.target);el.parent("td").addClass("h15-selected");this.showFlyout(el.next(".h15-menu-container"));if(typeof el.attr("h15:tag")=="undefined"){this.webTrends1(el.text());el.attr("h15:tag","1");}},toggleMenu:function(e){e.preventDefault();this.clearHider();this.clearShower();var el=$(e.target).next(".h15-menu-container");var shown=el.css("display")!="none";this.hideMenus();if(!shown){el.parent("td").addClass("h15-selected");this.showFlyout(el);}},triggerHide:function(){if(this._hider==null){this._hider=window.setTimeout(Function.createDelegate(this,this.hideMenus),1000);}},triggerShow:function(e){e.stopPropagation();this.clearHider();if(this._shower!=null){this.clearShower();}
this._shower=window.setTimeout(Function.createDelegate(this,function(){this.showMenu(e);}),125);},webTrends1:function(name){if(typeof window.dcsMultiTrack!="undefined"){var name=this.doubleQuote(name);try{dcsMultiTrack("DCS.dcsuri",location.hostname,"DCSext.ngn_clevel","Level 1","DCSext.ngn_lname",name,"DCS.ngn_type","Master Navigation","WT.si_p","Level 2a","WT.ti",name+":menu:menu","WT.dl","1","DCS.wt_linkid","");}catch(e){}}},webTrends3:function(name,subgroup,group){if(typeof window.dcsMultiTrack!="undefined"){var campaignID="";var pathname=(location.pathname.startsWith("/"))?location.pathname:"/"+location.pathname;var query=(location.search.length>0)?location.search.substring(1):"";var name=this.doubleQuote(name);var title=this.doubleQuote(group)+":"+this.doubleQuote(subgroup)+":"+name;try{dcsMultiTrack("DCS.dcssip",pathname,"DCS.dcsuri",location.hostname,"DCS.dcsqry",query,"DCSext.ngn_clevel","Level 2b","DCSext.ngn_lname",name,"DCS.ngn_type","Master Navigation","WT.si_p","Level 3","WT.ti",title,"WT.dl",1,"DCSext.wt_linkid",campaignID);}catch(e){}}}};Csp.Menu.layout=function(layout,menu){var columns=$("div.h15-column",menu);var currentHeight=0;var index=0;var height=0;$("div.h15-menu",layout).each(function(){height=$(this).height()+20;if(currentHeight>0&&index<3&&currentHeight+height>350){index++;currentHeight=0;}
currentHeight+=height;$(this).appendTo(columns[index]);});var menuHeight=0;columns.each(function(){menuHeight=Math.max(menuHeight,$(this).height());});var menuWidth=(index+1)*200;$(menu).height(Math.min(menuHeight,350)+10).width(menuWidth).css({visibility:"visible"});$(".h15-menu-inner",menu).height(menuHeight);columns.each(function(){var column=$(this);var ix=columns.index(this);if(ix<index){column.addClass("h15-dotted");}
if(ix<=index){column.height(menuHeight);}else{column.hide();}});};Csp.SearchBox=function(searchSiteID,searchWebID,searchID,watermarkText){this._searchSiteID=searchSiteID;this._searchWebID=searchWebID;this._searchID=searchID;this._watermarkText=watermarkText;this.initialize();};Csp.SearchBox.prototype={initialize:function(){var el=null||document.getElementById(this._searchSiteID);if(el!=null){$addHandler(el,"click",Function.createDelegate(this,this.onSearchSiteClick));}
var el=null||document.getElementById(this._searchWebID);if(el!=null){$addHandler(el,"click",Function.createDelegate(this,this.onSearchWebClick));}
var el=null||document.getElementById(this._searchID);if(el!=null){this.setWatermark(el,true);$addHandler(el,"blur",Function.createDelegate(this,this.onBlur));$addHandler(el,"focus",Function.createDelegate(this,this.onFocus));}},clearWatermark:function(el){if(el.value==this._watermarkText){el.style.color="#000";el.style.fontStyle="normal";el.value="";}},setWatermark:function(el,always){if(always==true||el.value.length==0){el.style.color="#707070";el.style.fontStyle="italic";el.value=this._watermarkText;}},onBlur:function(e){this.setWatermark(e.target,false);},onFocus:function(e){this.clearWatermark(e.target);},onSearchSiteClick:function(e){this.searchClicked("mscom");},onSearchWebClick:function(e){this.searchClicked("live");},searchClicked:function(stype){var el=document.getElementById(this._searchID);var sterm;if(el&&el.value!=this._watermarkText){sterm=el.value;}
if(typeof window.DCSext!="undefined"){DCSext.sterm=sterm||"*";DCSext.stype=stype;}}};

var vrtc_activeTabIndices=[];var vrtc_activeTabTimers=[];var vrtc_currentTabGroup=0;var vrtc_currentTabIndex=0;var vrtc_isMouseOver=false;var vrtc_impT=null;var vrtc_keyPressFunction=null;var vrtc_tlids=[];var vrtc_tabs=[];var TVIEWHEIGHT=0;function GKBH(e){var code;if(!e){e=window.event;}
if(e.keyCode){code=e.keyCode;}else if(e.which){code=e.which;}
return code;}
function vrtc_activateTab(tabGroup,index){window.clearTimeout(vrtc_activeTabTimers[tabGroup]);vrtc_currentTabGroup=tabGroup;vrtc_currentTabIndex=index;if(vrtc_activeTabIndices.length<=tabGroup){vrtc_activeTabIndices[tabGroup]=0;}
var vrtc_activeTabIndex=vrtc_activeTabIndices[tabGroup];if(index!=vrtc_activeTabIndex){vrtc_activeTabTimers[tabGroup]=window.setTimeout(vrtc_activateTabTimer,250);}}
function vrtc_mouseOutTab(tabGroup,index){window.clearTimeout(vrtc_activeTabTimers[tabGroup]);}
function vrtc_keyPress(o){var k=GKBH(o);if(k==13||k==32){eval(vrtc_keyPressFunction);return false;}
return k;}
function vrtc_activateTabTimer(){var vrtc_activeTabIndex=vrtc_activeTabIndices[vrtc_currentTabGroup];if(vrtc_currentTabIndex!=vrtc_activeTabIndex){var h="vrtc_tbh"+vrtc_currentTabGroup+"_";var c="vrtc_tbc"+vrtc_currentTabGroup+"_";var activeTab=$get(h+vrtc_activeTabIndex);var activeTabPanel=$get(vrtc_tabs[vrtc_activeTabIndex]);var newTab=$get(h+vrtc_currentTabIndex);var newTabPanel=$get(vrtc_tabs[vrtc_currentTabIndex]);var activeTabDiv=cspGetObjectsByTagAndClass("div","vrtc_activetabdiv");if(activeTabDiv.length>0){activeTabDiv[0].className="vrtc_activetabdiv vrtc_cf";activeTabDiv[0].innerHTML=newTabPanel.innerHTML;vrtc_isMouseOver=true;}
activeTab.className="vrtc_tab";newTab.className="vrtc_tabActive";vrtc_activeTabIndices[vrtc_currentTabGroup]=vrtc_currentTabIndex;window.clearTimeout(vrtc_impT);vrtc_impT=window.setTimeout("vrtc_swtI("+vrtc_currentTabIndex+")",1000);}}
function vrtc_swtI(n){if(vrtc_impT!=null&&n>0&&vrtc_tlids[n]!=false){if(typeof window.dcsMultiTrack!="undefined"){dcsMultiTrack("DCS.dcsuri","/tabs/"+(n+1),"WT.ad","","WT.mc_id","","DCSext.wt_linkid",vrtc_tlids[n],"WT.dl","5","WT.ti","Tab "+(n+1));}
if(typeof window.$$O!="undefined"&&$$O.get_handlerUrl()!=""){$$O.recordComponentImpression({cattr:"/tabs/"+(n+1),cid:vrtc_tlids[n],cname:"cspVerticalRolloverTab",uri:window.location.href});}
vrtc_tlids[n]=false;vrtc_impT=null;}}
function getObjectHeight(i){return i.offsetHeight;}
function collapseTabs(){var objects=cspGetObjectsByTagAndClass("div","vt_tabPanel");for(var i=0;i<vrtc_tabs.length;i++){if(i==0){if(!vrtc_isMouseOver){var activeTabDiv=cspGetObjectsByTagAndClass("div","vrtc_activetabdiv");if(activeTabDiv.length>0){activeTabDiv[0].className="vrtc_activetabdiv vrtc_cf";activeTabDiv[0].innerHTML=objects[i].innerHTML;}}}
objects[i].className="vt_tabPanel vrtc_tabHiddenPanel vrtc_cf";}}
function cspVerticalRolloverTab_parseMetaTag(index){if(index!=0){wtRemoveCId(vrtc_tlids[index]);}
return true;}

function vt_setStyle(id){if($.browser.msie==true&&$.browser.version>=7){var el=document.getElementById(id);if(el){var s=el.style;s.removeAttribute("filter");s.removeAttribute("-ms-filter");}}}

if(typeof window.Csp=="undefined"){window.Csp={};}
$$SL=Csp.Silverlight=function(version,interval){var handlers=new $$E();var silverlightVersion=version||"2.0";var timeout=interval||3000;return{displayCreatives:function(){handlers.callHandlers();},get_SilverlightVersion:function(){return silverlightVersion;},refreshCreatives:function(){if(Silverlight.isInstalled(silverlightVersion)){$$SL.displayCreatives();}else if(typeof $$U!="undefined"&&$$U.Browser=="MSIE"){window.setTimeout($$SL.refreshCreatives,timeout);}},registerCreative:function(handler){handlers.addHandler(handler);}};}();var silvergate;$$SG=Csp.SilverGate=function(args){if(args!==null){this._DaysToLive=args.daysToLive||1095;this._InstallID=args.installID;this._IsDirectInstall=args.isDirectInstall||false;this._NoThanksID=args.noThanksID;this._PopupID=args.popupID;this._Version=args.version||"2.0";}
this._CloseHandlers=new $$E();this._InstallHandlers=new $$E();this._ShowHandlers=new $$E();this._UnloadHandlers=new $$E();if(this._InstallID!==null){$addHandler($get(this._InstallID),"click",Function.createDelegate(this,this.onInstallClick));}
if(this._NoThanksID!==null){$addHandler($get(this._NoThanksID),"click",Function.createDelegate(this,this.onCloseClick));}
if($.browser.ie){this._KeyPressHandler=$addHandler(document.body,"keypress",Function.createDelegate(this,this.onKeyPress));}else{this._KeyPressHandler=$addHandler(document,"keypress",Function.createDelegate(this,this.onKeyPress));}
if(typeof $$U!="undefined"){$$U.detectUserAgent();this._InstallUrl="http://www.microsoft.com/silverlight/handlers/getsilverlight.ashx?v="+this._Version;}};$$SG.prototype={dispose:function(){if(this._InstallID!==null){$clearHandlers($get(this._InstallID));}
if(this._NoThanksID!==null){$clearHandlers($get(this._NoThanksID));}
if(this._KeyPressHandler!==null){$clearHandlers(document);$clearHandlers(document.body);}},hidePopup:function(){if(this._PageGate!=null){this._PageGate.hide();this._PageGate.dispose();}
this.unloadPopup();},onCloseClick:function(){$$C.setCookie("pgcld","true",this._DaysToLive);if(typeof window.dcsMultiTrack!="undefined"){dcsMultiTrack("DCSext.wt_pg","Page Gate Close","WT.dl","16");}
this.hidePopup();this._CloseHandlers.callHandlers();},onInstallClick:function(){if(typeof window.dcsMultiTrack!="undefined"){dcsMultiTrack("DCSext.wt_pg","Install now","WT.dl","16");}
$$SL.refreshCreatives();location.href=this._InstallUrl;this.hidePopup();this._InstallHandlers.callHandlers();},onKeyPress:function(e){var target=e.target;var keyCode=e.charCode;if(keyCode==13&&target.className.indexOf("sg-ignore-enter")==-1){this.onInstallClick();}else if(keyCode==27){this.onCloseClick();}},registerClose:function(handler){this._CloseHandlers.addHandler(handler);},registerShow:function(handler){this._ShowHandlers.addHandler(handler);},registerUnload:function(handler){this._UnloadHandlers.addHandler(handler);},showPopup:function(){var popup=$get(this._PopupID);if(popup!==null){this._PageGate=new Csp.PageGate(this._PopupID);this._PageGate.show();Sys.UI.DomElement.addCssClass(popup,"sg-popup-image");popup.style.display="block";var installButton=$get(this._InstallID);if(installButton!==null){installButton.focus();}}
if(typeof window.dcsMultiTrack!="undefined"){dcsFunc("dcsCookie");dcsMeta();dcsMultiTrack("DCS.dcssip",window.location.hostname,"DCS.dcsuri",window.location.pathname.substring(0,window.location.pathname.lastIndexOf("/")+1)+"pagegate/","DCSext.wt_sppt",WT.sp+"hp","DCSext.wt_pg","Silverlight Page Gate","WT.dl","15","WT.seg_4","No","DCSext.wt_ver","","DCSext.wt_target","","DCSext.wt_linkid","");}
this._ShowHandlers.callHandlers();},showSilverGate:function(){if($$SG.overridePopup()){$$C.removeCookie("pgcld");this.showPopup();}else if(typeof $$U!="undefined"&&$$U.Browser=="Unsupported"){this.unloadPopup();}else if(typeof $$U!="undefined"&&$$U.Browser=="Safari"&&$$U.OS=="Windows"){this.unloadPopup();}else if(typeof window.Silverlight!="undefined"&&Silverlight.isInstalled(this._Version)){$$SL.displayCreatives();this.unloadPopup();}else if(!$$C.enabled()||$$C.hasCookie("pgcld")){this.unloadPopup();}else{this.showPopup();}},unloadPopup:function(){if(typeof window.dcsRun!="undefined"&&$$SG.get_IsDisplayed()){dcsRun();}
this.dispose();this._UnloadHandlers.callHandlers();$$SG.set_IsUnloaded(true);}};$$SG.get_IsDirectInstall=function(){return this.IsDirectInstall||false;};$$SG.set_IsDirectInstall=function(value){this.IsDirectInstall=value;};$$SG.get_IsDisplayed=function(){return this.IsDisplayed||false;};$$SG.set_IsDisplayed=function(value){this.IsDisplayed=value;};$$SG.get_IsUnloaded=function(){return this.IsUnloaded||false;};$$SG.set_IsUnloaded=function(value){this.IsUnloaded=value;};$$SG.createDirectInstall=function(id,event){$addHandler($get(id),event,function(e){$$U.detectUserAgent();if(typeof window.$$U!="undefined"&&$$U.Browser!="Unsupported"){e.preventDefault();if(typeof window.dcsMultiTrack!="undefined"){var el=$get(this._InstallID);var text=(el!=null)?el.title:"Click to install";dcsMultiTrack("WT.ti","Direct Install: "+text,"DCSext.wt_slditi","Direct Install: "+text,"WT.dl","18");}
$$SL.refreshCreatives();$$SG.set_IsDirectInstall(true);location.href="http://www.microsoft.com/silverlight/handlers/getsilverlight.ashx?v="+$$SL.get_SilverlightVersion();}});};$$SG.createPageGate=function(args){this.set_IsDisplayed(this.shouldShowSilverGate(args));if(typeof window.Silverlight!="undefined"&&typeof Silverlight.WaitForInstallCompletion!="undefined"){Silverlight.WaitForInstallCompletion=function(){};}
silvergate=new $$SG({daysToLive:args.daysToLive,installID:args.installID,noThanksID:args.noThanksID,popupID:args.popupID});$().ready(Function.createDelegate(silvergate,silvergate.showSilverGate));};$$SG.overridePopup=function(){return $$Q.hasValue("showPageGate")||$$Q.hasValue("showpagegate");};$$SG.shouldShowSilverGate=function(args){if(this.overridePopup()){return true;}else if(typeof $$U!="undefined"&&$$U.Browser=="Unsupported"){return false;}else if(typeof $$U!="undefined"&&$$U.Browser=="Safari"&&$$U.OS=="Windows"){return false;}else if(typeof window.Silverlight!="undefined"&&Silverlight.isInstalled($$SL.get_SilverlightVersion())){return false;}else if(!args.isDirectInstall&&(!$$C.enabled()||$$C.hasCookie("pgcld"))){return false;}else{return true;}};$$PG=Csp.PageGate=function(popupID){this._popupID=popupID;this.initialize();}
$$PG=Csp.PageGate.prototype={dispose:function(){if(this._ResizeHandler!=null){$removeHandler(window,"resize",this._ResizeHandler);}
if(this._ScrollHandler!=null){$removeHandler(window,"scroll",this._ScrollHandler);}},getClientBounds:function(){var clientWidth;var clientHeight;switch(Sys.Browser.agent){case Sys.Browser.InternetExplorer:clientWidth=document.documentElement.clientWidth;clientHeight=document.documentElement.clientHeight;break;case Sys.Browser.Safari:clientWidth=window.innerWidth;clientHeight=window.innerHeight;break;case Sys.Browser.Opera:clientWidth=Math.min(window.innerWidth,document.body.clientWidth);clientHeight=Math.min(window.innerHeight,document.body.clientHeight);break;default:clientWidth=Math.min(window.innerWidth,document.documentElement.clientWidth);clientHeight=Math.min(window.innerHeight,document.documentElement.clientHeight);break;}
return new Sys.UI.Bounds(0,0,clientWidth,clientHeight);},hide:function(){this._popup.style.display="none";this._backgroundEl.style.display="none";this.turnSelectsOn();this.turnTabsOn();},initialize:function(){if(typeof this._popupID!="undefined"){this._tagsWithTabIndex=["A","AREA","BUTTON","IFRAME","INPUT","OBJECT","SELECT","TEXTAREA"];this._popup=$get(this._popupID);if(typeof this._popup!="undefined"){this._popup.style.position="absolute";this._popup.style.zIndex="10001";if(document.body.childNodes.length>0){document.body.insertBefore(this._popup,document.body.childNodes[0]);}else{document.body.appendChild(this._popup);}
this._ResizeHandler=$addHandler(window,"resize",Function.createDelegate(this,this.onResize));this._ScrollHandler=$addHandler(window,"scroll",Function.createDelegate(this,this.onScroll));this.resize();this.hide();}}},resize:function(){var clientBounds=this.getClientBounds();var clientHeight=clientBounds.height;var clientWidth=clientBounds.width;var scrollTop=document.documentElement.scrollTop?document.documentElement.scrollTop:document.body.scrollTop;var scrollLeft=document.documentElement.scrollLeft?document.documentElement.scrollLeft:document.body.scrollLeft;var scrollHeight=Math.max(document.documentElement.scrollHeight,document.body.scrollHeight);var scrollWidth=Math.max(document.documentElement.scrollWidth,document.body.scrollWidth);if(Sys.Browser.agent===Sys.Browser.InternetExplorer&&Sys.Browser.version==6){var bounds=Sys.UI.DomElement.getBounds(this._popup);if(typeof bounds!="undefined"){this._popup.style.top="20px";this._popup.style.left=(scrollLeft+((clientWidth-bounds.width)/2))+"px";}
var backgroundEl=this._backgroundEl;if(typeof backgroundEl=="undefined"){backgroundEl=this._backgroundEl=document.createElement("DIV");backgroundEl.className="sg-background";backgroundEl.style.left="0px";backgroundEl.style.position="absolute";backgroundEl.style.top="0px";backgroundEl.style.zIndex="10000";if(document.body.childNodes.length>0){document.body.insertBefore(backgroundEl,document.body.childNodes[0]);}else{document.body.appendChild(backgroundEl);}}
backgroundEl.style.height=Math.max(clientHeight,scrollHeight)+"px";backgroundEl.style.width=Math.max(clientWidth,scrollWidth)+"px";}else{var bounds=Sys.UI.DomElement.getBounds(this._popup);if(typeof bounds!="undefined"){this._popup.style.top="20px";this._popup.style.left=((clientWidth-bounds.width)/2)+"px";}
var backgroundEl=this._backgroundEl;if(typeof backgroundEl=="undefined"){backgroundEl=this._backgroundEl=document.createElement("DIV");backgroundEl.className="sg-background";backgroundEl.style.left="0px";backgroundEl.style.position="fixed";backgroundEl.style.top="0px";backgroundEl.style.zIndex="10000";if(document.body.childNodes.length>0){document.body.insertBefore(backgroundEl,document.body.childNodes[0]);}else{document.body.appendChild(backgroundEl);}}
backgroundEl.style.height=Math.max(clientHeight,scrollHeight)+"px";backgroundEl.style.width=Math.max(clientWidth,scrollWidth)+"px";}},show:function(){this._popup.style.display="block";this._backgroundEl.style.display="block";this.resize();this.turnSelectsOff();this.turnTabsOff();},turnSelectsOff:function(){if($.browser.msie&&$.browser.version==6){$("SELECT").css("visibility","hidden");}},turnSelectsOn:function(){if($.browser.msie&&$.browser.version==6){$("SELECT").css("visibility","visible");}},turnTabsOff:function(){var popupEls=[];var els=this._popup.getElementsByTagName("*");for(var i=0;i<els.length;i++){popupEls.push(els[i]);}
this._tabbedEls=[];var allEls=document.getElementsByTagName("*");for(var i=0;i<allEls.length;i++){var el=allEls[i];if(Array.indexOf(popupEls,el)==-1&&Array.indexOf(this._tagsWithTabIndex,el.tagName)!=-1){this._tabbedEls.push({tag:el,index:el.tabIndex});el.tabIndex="-1";}}},turnTabsOn:function(){if(typeof this._tabbedEls!="undefined"){for(var i=0;i<this._tabbedEls.length;i++){var tabbedEl=this._tabbedEls[i];tabbedEl.tag.tabIndex=tabbedEl.index;}}},onResize:function(){this.resize();},onScroll:function(){this.resize();}};
