name="Lotus Technical Information";
inwidth = 210;
inheight = 300;

if (window.location.protocol == "https:") {
var host = window.location.hostname;
var pathname = window.location.pathname;
var search = window.location.search;
var url = "http://" + host + pathname + search;
location.replace(url);
}

function writeStat(pth,page,xhtml,subject){
var docurl=document.URL;
docurl=docurl.split("#")[0];
document.write("<img alt='Statistics' style='position:absolute;left:1px;top:1px;visibility:hidden' width='1' height='1' src='http://"+pth+"/fLog?CreateDocument&t="+docurl+"&r="+document.referrer+"&s="+subject+"&p="+page+"' "+xhtml+">");
}

function goToURL(link)
  {
      
    if(!link=="")
      {
        window.location.href=link
    }
}

function catNavURL(link,type,h){

	var prefix;
	var sURL = window.location.href;
	if(sURL.indexOf("xpViewCategories") >= 0) {
		prefix = "";
	}else if(sURL.indexOf("/dx/") >= 0){
		prefix = "../";	
	}else{
		prefix = h + ".nsf/";
	}

	if(type === "external"){
		window.location.href=link	
	}else if(type === "article" || type === 'category'){
			window.location.href = prefix + link;
	}
	
}
function changeNFSelector(lang,rte,nFlag){
	var nfWidget = dojo.byId('ietran_ui_langselect');
	var rteOpt = dojo.byId(rte);
	
	if(lang === "1" || nFlag === true){
		rteOpt.style.display = "none";
	}else{
		rteOpt.style.display = "";
	}
	
	nfWidget.value = lang;
	translate();
	

	}

function searchTrees(currentTopicTitle, model, articleList, item) {
	 
    var id = model.getIdentity(item);
    articleList.push(id);
    if (id == currentTopicTitle) {
        // Return the buildme array, indicating a match was found
        return articleList;
    }
    for (var idx in item.children) {
        // start a new branch of buildme, starting with what we have so far
        var buildmebranch = articleList.slice(0);
        var r = searchTrees(currentTopicTitle, model, buildmebranch, item.children[idx]);
        // If a match was found in that recurse, return it.
        //  This unwinds the recursion on completion.
        if (r) {
            return r;
        }
    }
    // Return undefined, indicating no match was found
    return undefined;
}

function selectArticleFromTree(tree, currentTopicTitle) {
    var articleList = new Array();
    var result = searchTrees(currentTopicTitle, tree.model, articleList, tree.model.root);
    if (result && result.length > 0) {
        tree.attr('path', result);
    }
}

