window.onload=LoadPage; window.onunload=Window_Unload; window.onresize=ResizeWindow; window.onbeforeprint = set_to_print; window.onafterprint = reset_form; var vbDeclaration; var vbUsage; var csLang; var cLang; var jsharpLang; var jsLang; var scrollPos = 0; var inheritedMembers; var protectedMembers; var netcfMembersOnly; /* ********** ********** Begin ********** */ function LoadPage() { /* if(IsEvilUrl()) { ReloadEvilUrlAsGoodUrl(); return; // in just a moment, page will reload. } // show correct language LoadLanguages(); LoadMembersOptions(); Set_up_checkboxes(); DisplayLanguages(); if(inheritedMembers=="off") DisplayInheritedMembers(); if(protectedMembers=="off") DisplayProtectedMembers(); if(netcfMembersOnly=="on") DisplayNETCFMembers(); ChangeMembersOptionsFilterLabel(); */ LoadSections(); ResizeWindow(); try { mainSection.setActive(); } catch(e) { } // make body visible, now that we're ready to render document.body.style.display = ""; //set the scroll position try{mainSection.scrollTop = scrollPos;} catch(e){} } function Window_Unload() { SaveSections(); } function ResizeWindow() { if (document.body.clientWidth==0) return; var header = document.getElementById("header"); var mainSection = document.getElementById("mainSection"); if (mainSection == null) return; document.body.scroll = "no" mainSection.style.overflow= "auto"; header.style.width= document.body.offsetWidth - 2; //mainSection.style.paddingRight = "20px"; // Width issue code mainSection.style.width= document.body.offsetWidth - 4; mainSection.style.top=0; if (document.body.offsetHeight > header.offsetHeight + 10) mainSection.style.height= document.body.offsetHeight - (header.offsetHeight + 10); else mainSection.style.height=0; try { mainSection.setActive(); } catch(e) { } } function Load(key) { userDataCache.load("docSettings"); var value = userDataCache.getAttribute(key); return value; } function Save(key, value) { userDataCache.setAttribute(key, value); userDataCache.save("docSettings"); } function RemoveAttribute(key) { userDataCache.removeAttribute(key); userDataCache.save("docSettings"); } function set_to_print() { //breaks out of divs to print var i; if (window.text)document.getElementsByTagName("*").text.style.height = "auto"; for (i=0; i < document.getElementsByTagName("*").length; i++) { if (document.getElementsByTagName("*")[i].tagName == "body") { document.getElementsByTagName("*")[i].scroll = "yes"; } if (document.getElementsByTagName("*")[i].id == "header") { document.getElementsByTagName("*")[i].style.margin = "0px 0px 0px 0px"; document.getElementsByTagName("*")[i].style.width = "100%"; } if (document.getElementsByTagName("*")[i].id == "mainSection") { document.getElementsByTagName("*")[i].style.overflow = "visible"; document.getElementsByTagName("*")[i].style.top = "5px"; document.getElementsByTagName("*")[i].style.width = "100%"; document.getElementsByTagName("*")[i].style.padding = "0px 10px 0px 30px"; } } } function reset_form() { //returns to the div nonscrolling region after print document.location.reload(); } /* ********** ********** Begin Expand/Collapse ********** */ function getNextSibling(startBrother){ endBrother=startBrother.nextSibling; while(endBrother.nodeType!=1){ endBrother = endBrother.nextSibling; } return endBrother; } var collapsedItems = new Array(); function ExpandCollapse(imageItem) { if(ItemCollapsed(imageItem.id) == true) { imageItem.src = document.getElementById('collapseImage').src; ExpandSection(imageItem); RemoveCollapsedItem(imageItem.id); if(imageItem.id.indexOf("Family", 0) == 0) { protectedMembers = "on"; Set_up_checkboxes(); ChangeMembersOptionsFilterLabel(); } } else { imageItem.src = document.getElementById('expandImage').src; CollapseSection(imageItem); AddCollapsedItem(imageItem.id); } SetCollapseAll(); } function ExpandCollapseAll(imageItem) { var imgElements = document.getElementsByName("toggleSwitch"); var i; if(ItemCollapsed(imageItem.id) == true) { imageItem.src = document.getElementById('collapseAllImage').src; RemoveCollapsedItem(imageItem.id); for(i = 0; i < imgElements.length; ++i) { imgElements[i].src = document.getElementById('collapseImage').src; ExpandSection(imgElements[i]); RemoveCollapsedItem(imgElements[i].id); if(imgElements[i].id.indexOf("Family", 0) == 0) protectedMembers = "on"; } SetToggleAllLabel(false); } else { imageItem.src = document.getElementById('expandAllImage').src; AddCollapsedItem(imageItem.id); for(i = 0; i < imgElements.length; ++i) { imgElements[i].src = document.getElementById('expandImage').src; CollapseSection(imgElements[i]); AddCollapsedItem(imgElements[i].id); } SetToggleAllLabel(true); } } function ExpandCollapse_CheckKey(imageItem) { if(window.event.keyCode == 13) ExpandCollapse(imageItem); } function ExpandCollapseAll_CheckKey(imageItem) { if(window.event.keyCode == 13) ExpandCollapseAll(imageItem); } function ExpandSection(imageItem) { getNextSibling(imageItem.parentNode.parentNode).style.display = ""; } function CollapseSection(imageItem) { getNextSibling(imageItem.parentNode.parentNode).style.display = "none"; } function SetCollapseAll() { var imageElement = document.getElementById("toggleAllImage"); if(imageElement == null) return; var imgElements = document.getElementsByName("toggleSwitch"); var allCollapsed = true; var i; for(i = 0; i < imgElements.length; ++i) { allCollapsed = allCollapsed && ItemCollapsed(imgElements[i].id) } if(allCollapsed) { imageElement.src = document.getElementById('expandAllImage').src; AddCollapsedItem(imageElement.id); } else { imageElement.src = document.getElementById('collapseAllImage').src; RemoveCollapsedItem(imageElement.id); } SetToggleAllLabel(allCollapsed); } function SetToggleAllLabel(allCollapsed) { var labelElement; labelElement = document.getElementById("collapseAllLabel"); if(labelElement == null) return; labelElement.style.display = "none"; labelElement = document.getElementById("expandAllLabel"); labelElement.style.display = "none"; if(allCollapsed) { labelElement = document.getElementById("expandAllLabel"); labelElement.style.display = "inline"; } else { labelElement = document.getElementById("collapseAllLabel"); labelElement.style.display = "inline"; } } function ItemCollapsed(imageId) { var i; for(i = 0; i < collapsedItems.length; ++i) { if(imageId == collapsedItems[i]) return true; } return false; } function AddCollapsedItem(imageId) { if(ItemCollapsed(imageId) == false) collapsedItems[collapsedItems.length] = imageId; } function RemoveCollapsedItem(imageId) { var i; for(i = 0; i < collapsedItems.length; ++i) { if(imageId == collapsedItems[i]) collapsedItems.splice(i, 1); } } function SaveSections() { var i; var x = 0; // CleanUserDataStore(); for(i = 0; i < collapsedItems.length; ++i) { if(ShouldSave(collapsedItems[i]) == true) { Save("imageValue" + x, collapsedItems[i]); x++; } } } function ExpandAttribute() { var precedingItems = new Array(); var collapsedItem = new Array(); var temp = new Array(); var e = document.getElementsByTagName("div"); for(var i = 0; i < e.length; i++) { if(e[i].getAttribute("expanded") == "false") { collapsedItem[collapsedItem.length] = e[i]; if(collapsedItem[collapsedItem.length - 1].previousSibling != null) { if(collapsedItem[collapsedItem.length - 1].previousSibling.firstChild != null) { temp[temp.length] = collapsedItem[collapsedItem.length - 1].previousSibling.firstChild.firstChild if (temp[temp.length - 1] == null) {} else if (temp[temp.length - 1] != null) { precedingItems[precedingItems.length] = temp[temp.length - 1]; AddCollapsedItem(precedingItems[precedingItems.length - 1].id); } } } } } } function LoadSections() { /* var i = 0; var imageId = Load("imageValue" + i); while(imageId != null) { var imageItem = document.getElementById(imageId); if(imageItem != null) { if(imageItem.id.indexOf("Family", 0) == 0) { if(protectedMembers == "on") { ExpandCollapse(imageItem); } } else ExpandCollapse(imageItem); } else { AddCollapsedItem(imageId); } i++; imageId = Load("imageValue" + i); } ExpandAttribute(); */ SetCollapseAll(); } function CleanUserDataStore() { /* var i = 0; var imageId = Load("imageValue" + i); while(imageId != null) { RemoveAttribute("imageValue" + i); i++; imageId = Load("imageValue" + i); } */ } function ShouldSave(imageId) { var toggleName; if(imageId == "toggleAllImage") return false; toggleName = "procedureToggle"; if(imageId.indexOf(toggleName, 0) == 0) return false; toggleName = "sectionToggle"; if(imageId.indexOf(toggleName, 0) == 0) return false; return true; } function OpenSection(imageItem) { if(ItemCollapsed(imageItem.id) == true) ExpandCollapse(imageItem); } /* ********** ********** End Expand/Collapse ********** */ /* ********** ********** Begin Copy Code ********** */ function CopyCode(key) { var trElements = document.getElementsByTagName("tr"); var i; for(i = 0; i < trElements.length; ++i) { if(key.parentElement.parentElement.parentElement == trElements[i].parentElement) { window.clipboardData.setData("Text", trElements[i].innerText); } } } function ChangeCopyCodeIcon(key) { var i; var imageElements = document.getElementsByName("ccImage") for(i=0; i