// VERSION 7.1.2058 // This script works with IE 5.x+. Optimized for IE6.x //************************** LOCALIZATION VARIABLES *************************** // Load xml resource jsPath = "MSHelp/scripts/"; //jsPath = ""; var xmldoc = new ActiveXObject("MSXML.DOMDocument"); xmldoc.async = false; xmldoc.load(jsPath + "dtue.xml"); // Variables for Feedback links //var L_FeedbackLink_TEXT = getXMLText('L_FeedbackLink_TEXT'); var L_FeedbackLink_TEXT = "Send feedback"; //var L_MessageLink_TEXT = getXMLText('L_MessageLink_TEXT'); var L_MessageLink_TEXT =""; //var L_MailToLink_TEXT = getXMLText('L_MailToLink_TEXT'); var L_MailToLink_TEXT = "Send feedback"; // Variables for the running head buttons //var L_SeeAlso_TEXT = getXMLText('L_SeeAlso_TEXT'); //var L_Requirements_TEXT = getXMLText('L_Requirements_TEXT'); //var L_QuickInfo_TEXT = getXMLText('L_QuickInfo_TEXT'); //var L_FilterTip_TEXT = getXMLText('L_FilterTip_TEXT'); // tooltip for language button //var L_Language_TEXT = getXMLText('L_Language_TEXT'); // heading for menu of programming languages //var L_ShowAll_TEXT = getXMLText('L_ShowAll_TEXT'); // label for 'show all languages' menu item var L_SeeAlso_TEXT = "See Also"; var L_Requirements_TEXT = "Requirements"; var L_QuickInfo_TEXT = "QuickInfo"; var L_FilterTip_TEXT = "Language Filter"; // tooltip for language button var L_Language_TEXT = "Language"; // heading for menu of programming languages var L_ShowAll_TEXT = "Show All"; // label for 'show all languages' menu item // Variables for Expand-Collapse functions //var L_ExpandAll_TEXT = getXMLText('L_ExpandAll_TEXT'); //var L_CollapseAll_TEXT = getXMLText('L_CollapseAll_TEXT'); //var L_ExColl_TEXT = getXMLText('L_ExColl_TEXT'); var L_ExpandAll_TEXT = "Expand All"; var L_CollapseAll_TEXT = "Collapse All"; var L_ExColl_TEXT = "Click to Expand or Collapse"; // Localization Variables for NavFailPage Param var L_Keyword_TEXT = "Keyword ="; var L_IndexMoniker_TEXT = "IndexMoniker ="; var L_URL_TEXT = "Source URL ="; // defines the running head popup box. Localizable var L_PopUpBoxStyle_Style = "WIDTH:200PX; PADDING:5px 7px 7px 7px; BACKGROUND-COLOR:#FFFFCC; BORDER:SOLID 1 #999999; VISIBILITY:HIDDEN; POSITION:ABSOLUTE; TOP:0PX; LEFT:0PX; Z-INDEX:2;"; //*************************** END LOCALIZATION ******************************** //**** Do not localize the following lines, they allow for bilingual files **** var US_See_Also = "See Also"; var US_Requirements = "Requirements"; var US_QuickInfo = "QuickInfo" //***ScriptSettings var bRefTips = true //Show RefTips var bInCHM = false //CHM check var popOpen, theImg, theDiv, e; var advanced = false; var curLang = null; var showAll = true; var cook = null; var scrollPos = 0; var baseUrl = jsPath; //jsPath comes from the dtuelink.js var popupDIV = "
';
// Add the menu.
var div = '';
try{nsbanner.insertAdjacentHTML('afterEnd', div);}
catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', div);}catch(e){}}
}
if (!showAll)
filterLang();
}
}
function initPreElem(pre){
var htm0 = pre.outerHTML;
var reLang = /]*class="?lang"?[^>]*>/i;
var iFirst = -1;
var iSecond = -1;
iFirst = htm0.search(reLang);
if (iFirst >= 0) {
iPos = iFirst + 17;
iMatch = htm0.substr(iPos).search(reLang);
if (iMatch >= 0)
iSecond = iPos + iMatch;
}
if (iSecond < 0) {
var htm1 = trimPreElem(htm0);
if (htm1 != htm0) {
pre.insertAdjacentHTML('afterEnd', htm1);
pre.outerHTML = "";
}
}
else {
var rePairs = /<(\w+)\b[^>]*><\/\1>/gi;
var substr1 = htm0.substring(0,iSecond);
var tags1 = substr1.replace(/>[^<>]+(<|$)/g, ">$1");
var open1 = tags1.replace(rePairs, "");
open1 = open1.replace(rePairs, "");
var substr2 = htm0.substring(iSecond);
var tags2 = substr2.replace(/>[^<>]+<");
var open2 = tags2.replace(rePairs, "");
open2 = open2.replace(rePairs, "");
pre.insertAdjacentHTML('afterEnd', open1 + substr2);
pre.insertAdjacentHTML('afterEnd', trimPreElem(substr1 + open2));
pre.outerHTML = "";
}
}
function trimPreElem(htm){
return htm.replace(/[ \r\n]*((<\/[BI]>)*)[ \r\n]*<\/PRE>/g, "$1").replace(
/\w*<\/SPAN>\w*((<[BI]>)*)\r\n/g, "\r\n$1"
);
}
function getBlock(elem){
while (elem && elem.tagName.match(/^([BIUA]|(SPAN)|(CODE)|(TD))$/))
elem = elem.parentElement;
return elem;
}
function langMenu(){
bodyOnClick();
var btn = window.event.srcElement
if (btn.id=="button1"){
btn.src = btn.src.replace("a.gif", "c.gif");}
window.event.returnValue = false;
window.event.cancelBubble = true;
var div = document.all.lang_menu;
var lnk = window.event.srcElement;
if (div && lnk) {
var x = lnk.offsetLeft + lnk.offsetWidth - div.offsetWidth;
div.style.pixelLeft = (x < 0) ? 0 : x;
div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
div.style.visibility = "visible";
}
}
function chooseLang(item){
window.event.returnValue = false;
window.event.cancelBubble = true;
if (item) {
closeMenu();
curLang = item.innerText;
showAll = false;
}
if (cook) {
cook.putValue('lang', curLang);
cook.putValue('lang.all', '');
}
filterLang();
}
function chooseAll(){
window.event.returnValue = false;
window.event.cancelBubble = true;
closeMenu();
showAll = true;
if (cook)
cook.putValue('lang.all', '1');
unfilterLang();
}
function closeMenu(){
var div = document.all.lang_menu;
if (div && div.style.visibility != "hidden") {
var lnk = document.activeElement;
if (lnk && lnk.tagName == "A")
lnk.blur();
div.style.visibility = "hidden";
}
}
function getNext(elem){
for (var i = elem.sourceIndex + 1; i < document.all.length; i++) {
var next = document.all[i];
if (!elem.contains(next))
return next;
}
return null;
}
function filterMatch(text, name){
var a = text.split(",");
for (var iTok = 0; iTok < a.length; iTok++) {
var m = a[iTok].match(/([A-Za-z].*[A-Za-z+#0-9])/);
if (m && m[1] == name)
return true;
}
return false;
}
function topicHeading(head){
try{var iLim = nstext.children.length;
Section = nstext;}
catch(e){try{var iLim = scrtext.children.length;
Section = scrtext;}
catch(e){var iLim = document.body.children.length;
Section = document.body;
}
}
var idxLim = head.sourceIndex;
for (var i = 0; i < iLim; i++) {
var elem = Section.children[i];
if (elem.sourceIndex < idxLim) {
if (elem.tagName.match(/^(P)|(PRE)|([DOU]L)$/))
return false;
}
else
break;
}
return true;
}
function filterLang(){
var spans = document.all.tags("SPAN");
for (var i = 0; i < spans.length; i++) {
var elem = spans[i];
if (elem.className == "lang") {
var newVal = filterMatch(elem.innerText, curLang) ? "block" : "none";
var block = getBlock(elem);
block.style.display = newVal;
elem.style.display = "none";
if (block.tagName == "DT") {
var next = getNext(block);
if (next && next.tagName == "DD")
next.style.display = newVal;
}
else if (block.tagName == "DIV") {
block.className = "filtered2";
}
else if (block.tagName.match(/^H[1-6]$/)) {
if (topicHeading(block)) {
if (newVal != "none") {
var tag = null;
if (block.children && block.children.length) {
tag = block.children[block.children.length - 1];
if (tag.className == "ilang") {
tag.innerHTML = (newVal == "block") ?
' [' + curLang + ']' : "";
}
}
}
}
else {
var next = getNext(block);
while (next && !next.tagName.match(/^(H[1-6])$/)) {
if (next.tagName =="DIV"){
if (next.className.toUpperCase() != "TABLEDIV") break;
}
next.style.display = newVal;
next = getNext(next);
}
}
}
}
else if (elem.className == "ilang") {
var block = getBlock(elem);
if (block.tagName == "H1")
elem.innerHTML = ' [' + curLang + ']';
}
}
resizeBan();
}
function unfilterLang(name){
var spans = document.all.tags("SPAN");
for (var i = 0; i < spans.length; i++) {
var elem = spans[i];
if (elem.className == "lang") {
var block = getBlock(elem);
block.style.display = "block";
elem.style.display = "inline";
if (block.tagName == "DT") {
var next = getNext(block);
if (next && next.tagName == "DD")
next.style.display = "block";
}
else if (block.tagName == "DIV") {
block.className = "filtered";
}
else if (block.tagName.match(/^H[1-6]$/)) {
if (topicHeading(block)) {
var tag = null;
if (block.children && block.children.length) {
tag = block.children[block.children.length - 1];
if (tag && tag.className == "ilang")
tag.innerHTML = "";
}
}
else {
var next = getNext(block);
while (next && !next.tagName.match(/^(H[1-6])$/)) {
if (next.tagName =="DIV"){
if (next.className.toUpperCase() != "TABLEDIV") break;
}
next.style.display = "block";
next = getNext(next);
}
}
}
}
else if (elem.className == "ilang") {
elem.innerHTML = "";
}
}
resizeBan();
}
// ****************************************************************************
// * Reftips (parameter popups) *
// ****************************************************************************
function initReftips(){
var DLs = document.all.tags("DL");
var PREs = document.all.tags("PRE");
if (DLs && PREs) {
var iDL = 0;
var iPRE = 0;
var iSyntax = -1;
for (var iPRE = 0; iPRE < PREs.length; iPRE++) {
if (PREs[iPRE].className == "syntax") {
while (iDL < DLs.length && DLs[iDL].sourceIndex < PREs[iPRE].sourceIndex)
iDL++;
if (iDL < DLs.length) {
initSyntax(PREs[iPRE], DLs[iDL]);
iSyntax = iPRE;
}
else
break;
}
}
if (iSyntax >= 0) {
var last = PREs[iSyntax];
if (last.parentElement.tagName == "DIV") last = last.parentElement; last.insertAdjacentHTML('afterEnd','');
}
}
}
function initSyntax(pre, dl){
var strSyn = pre.outerHTML;
var ichStart = strSyn.indexOf('>', 0) + 1;
var terms = dl.children.tags("DT");
if (terms) {
for (var iTerm = 0; iTerm < terms.length; iTerm++) {
if (terms[iTerm].innerHTML.indexOf("")!=-1){
var word = terms[iTerm].innerText.replace(/\s$/, "");
var ichMatch = findTerm(strSyn, ichStart, word);
if (ichMatch < 1){
word = word.replace(/\s/, " ")
ichMatch = findTerm(strSyn, ichStart, word);
}
while (ichMatch > 0) {
var strTag = '' + word + '';
strSyn =
strSyn.slice(0, ichMatch) +
strTag +
strSyn.slice(ichMatch + word.length);
ichMatch = findTerm(strSyn, ichMatch + strTag.length, word);
}
}
}
for (var iTerm = 0; iTerm < terms.length; iTerm++) {
if (terms[iTerm].innerHTML.indexOf("")==-1){
var words = terms[iTerm].innerText.replace(/\[.+\]/g, " ").replace(/,/g, " ").split(" ");
var htm = terms[iTerm].innerHTML;
for (var iWord = 0; iWord < words.length; iWord++) {
var word = words[iWord];
if (word.length > 0 && htm.indexOf(word, 0) < 0)
word = word.replace(/:.+/, "");
if (word.length > 0) {
var ichMatch = findTerm(strSyn, ichStart, word);
while (ichMatch > 0) {
if (!isLinkText(strSyn.substring(ichMatch))){
var strTag = '' + word + '';
strSyn =
strSyn.slice(0, ichMatch) +
strTag +
strSyn.slice(ichMatch + word.length);
ichMatch = findTerm(strSyn, ichMatch + strTag.length, word);
}
else ichMatch = findTerm(strSyn, ichMatch + word.length, word);
}
}
}
}
}
}
// Replace the syntax block with our modified version.
pre.outerHTML = strSyn;
}
function findTerm(strSyn, ichPos, strTerm)
{
var ichMatch = strSyn.indexOf(strTerm, ichPos);
while (ichMatch >= 0) {
var prev = (ichMatch == 0) ? '\0' : strSyn.charAt(ichMatch - 1);
var next = strSyn.charAt(ichMatch + strTerm.length);
if (!isalnum(prev) && !isalnum(next) && !isInTag(strSyn, ichMatch)) {
var ichComment = strSyn.indexOf("/*", ichPos);
while (ichComment >= 0) {
if (ichComment > ichMatch) {
ichComment = -1;
break;
}
var ichEnd = strSyn.indexOf("*/", ichComment);
if (ichEnd < 0 || ichEnd > ichMatch)
break;
ichComment = strSyn.indexOf("/*", ichEnd);
}
if (ichComment < 0) {
ichComment = strSyn.indexOf("//", ichPos);
var newPos = 0;
if (ichComment >= 0) {
while (isInTag(strSyn, ichComment)) { //checks to see if the comment is in a tag (and thus part of a URL)
newPos = ichComment + 1;
ichComment = strSyn.indexOf("//", newPos);
if (ichComment < 0)
break;
}
while (ichComment >= 0) {
if (ichComment > ichMatch) {
ichComment = -1;
break;
}
var ichEnd = strSyn.indexOf("\n", ichComment);
if (ichEnd < 0 || ichEnd > ichMatch)
break;
ichComment = strSyn.indexOf("//", ichEnd);
}
}
}
if (ichComment < 0)
break;
}
ichMatch = strSyn.indexOf(strTerm, ichMatch + strTerm.length);
}
return ichMatch;
}
function isLinkText(strHtml){
return strHtml.indexOf("<")==strHtml.toLowerCase().indexOf("<\/a>");
}
function isInTag(strHtml, ichPos)
{
return strHtml.lastIndexOf('<', ichPos) >
strHtml.lastIndexOf('>', ichPos);
}
function isalnum(ch){
return ((ch >= 'a' && ch <= 'z') || (ch >= 'A' && ch <= 'Z') || (ch >= '0' && ch <= '9') || (ch == '_') || (ch == '-'));
}
function showTip(link){
bodyOnClick();
var tip = document.all.reftip;
if (!tip || !link)
return;
window.event.returnValue = false;
window.event.cancelBubble = true;
// Hide the tip if necessary and initialize its size.
tip.style.visibility = "hidden";
tip.style.pixelWidth = 260;
tip.style.pixelHeight = 24;
// Find the link target.
var term = null;
var def = null;
var DLs = document.all.tags("DL");
for (var iDL = 0; iDL < DLs.length; iDL++) {
if (DLs[iDL].sourceIndex > link.sourceIndex) {
var dl = DLs[iDL];
var iMax = dl.children.length - 1;
for (var iElem = 0; iElem < iMax; iElem++) {
var dt = dl.children[iElem];
if (dt.tagName == "DT" && dt.style.display != "none") {
if (findTerm(dt.innerText, 0, link.innerText) >= 0) {
var dd = dl.children[iElem + 1];
if (dd.tagName == "DD") {
term = dt;
def = dd;
}
break;
}
}
}
break;
}
}
if (def) {
window.linkElement = link;
window.linkTarget = term;
tip.innerHTML = '
';
if (advanced)
try{nsbanner.insertAdjacentHTML('afterEnd', divR);}
catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', divR);}catch(e){}}
else
document.body.insertAdjacentHTML('beforeEnd', divR);
}
}
if (divS != "") {
divS = '
';
if (advanced)
try{nsbanner.insertAdjacentHTML('afterEnd', divS);}
catch(e){try{scrbanner.insertAdjacentHTML('afterEnd', divS);}catch(e){}}
else
document.body.insertAdjacentHTML('beforeEnd', divS);
}
}
}
}
function resetButtons(){
//unclick buttons...
var btns = document.all.button1;
if (btns) {
if (btns.src!=null) btns.src=btns.src.replace("c.gif", "a.gif"); //if there is only one button.
for (var i = 0; i < btns.length; i++){
btns[i].src = btns[i].src.replace("c.gif", "a.gif");
}
}
}
function showSeeAlso(){
bodyOnClick();
var btn = window.event.srcElement
if (btn.id=="button1"){
btn.src = btn.src.replace("a.gif", "c.gif");}
window.event.returnValue = false;
window.event.cancelBubble = true;
var div = document.all.sapop;
var lnk = window.event.srcElement;
if (div && lnk) {
div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
div.style.visibility = "visible";
}
}
function showRequirements(){
bodyOnClick();
var btn = window.event.srcElement
if (btn.id=="button1"){
btn.src = btn.src.replace("a.gif", "c.gif");}
window.event.returnValue = false;
window.event.cancelBubble = true;
var div = document.all.rpop;
var lnk = window.event.srcElement;
if (div && lnk) {
div.style.pixelTop = lnk.offsetTop + lnk.offsetHeight;
div.style.visibility = "visible";
}
}
function hideSeeAlso(){
var div = document.all.sapop;
if (div)
div.style.visibility = "hidden";
var div = document.all.rpop;
if (div)
div.style.visibility = "hidden";
}
function loadAll(){
try {
scrollPos = allHistory.getAttribute("Scroll");
}
catch(e){ }
}
function saveAll(){
try{
allHistory.setAttribute("Scroll",nstext.scrollTop);
}
catch(e){ }
}
// ****************************************************************************
// * Expand-Collapse *
// ****************************************************************************
/* keeping state requires the document to have the following tags... the meta tag may have to be before the body tag.
*/
/* required in the css
div.saveHistory
{
behavior:url(#default#savehistory);
}
*/
function fnLoad(){
var oArray = sHistory.getAttribute("sPersistState").split("|");
if (oArray.length>0){
var offset = oArray[0]-sHistory.sourceIndex;
for(var i=1;i