//tree.expandNode(tree.nodeByName('product'),false,true)
// helper function; expands node and all parent nodes
function exp(node) {
   RedrawAllTrees();
   var selnode = node;
   while (node) {
      if (!node.expanded) node.treeView.expandNode(node.index,true,false);
      node = node.parentNode;
   };
   selnode.treeView.selectNode(selnode.index);
   RedrawAllTrees();
   //selnode.treeView.expandNode(selnode.index,false,true);
}


function viewsnap (img_src, bgcolor, fgcolor, img_wide, img_high, caption) {
	var scrollbar = 'no';
	var win_wide = img_wide + 100; var win_high = img_high;
	if (win_wide > screen.width) { win_wide = screen.width; scrollbar = 'yes'; }
	if (win_high > screen.height) { win_high = screen.height; scrollbar = 'yes'; }
	var left = (screen.width - win_wide) / 2;
	var top = (screen.height - win_high) / 2;
	var winAttribs =
		'toolbar=0,status=0,menubar=0,resizable=0,directories=0,dependent=yes,'
		+ 'scrollbars=' + scrollbar + ',width=' + win_wide + ',height=' + win_high + ',top=' + top + ',left=' + left;
	var winHandler = window.open('', '_blank', winAttribs);
	var htmlContent =
		'<html><meta http-equiv="Page-Enter" content="blendTrans(Duration=1.0)">'+
		+ '<head><title>Snapshot Viewer ('+img_src+')</title><style>'
		+ 'div.image{position:absolute;top:0;left:0;width:'+img_wide+'px;height:'+img_high+'px;'
		+ 'border:0px;padding:0px;z-index:0;overflow:auto;background-color:#c0c0c0;background-image:url(\'' + img_src + '\');background-repeat:no-repeat;}'
		+ 'div.caption{position:absolute;top:0;left:'+img_wide+';width:100px;height:'+img_high+'px;border:0px;'
		+ 'padding:2px;z-index:1;overflow:auto;background-color:'+bgcolor+';color:'+fgcolor+';'
		+ 'font-family:tahoma,arial,verdana,helvetica;font-size:8pt;text-align:left;}</style></head>'
		+ '<body><div class="image" onClick="self.close();"></div><div class="caption">' + caption + '</div></body></html>';
	winHandler.document.open();
	winHandler.document.write(htmlContent);
	winHandler.document.close();
	winHandler.focus();
}

function viewsnapnocap (img_src, img_wide, img_high) {
	var scrollbar = 'no';
	var win_wide = img_wide; var win_high = img_high;
	if (win_wide > screen.width) { win_wide = screen.width; scrollbar = "yes"; }
	if (win_high > screen.height) { win_high = screen.height; scrollbar = "yes"; }
	var left = (screen.width - win_wide) / 2;
	var top = (screen.height - win_high) / 2;
	var winAttribs =
		'toolbar=0,status=0,menubar=0,resizable=0,directories=0,dependent=yes,'
		+ 'scrollbars=' + scrollbar + ',width=' + win_wide + ',height=' + win_high + ',top=' + top + ',left=' + left;
	var winHandler = window.open('', '_blank', winAttribs);
	var htmlContent =
		'<html>'
		+ '<head><title>shot and go</title><style>'
		+ 'div.image{cursor:pointer;position:absolute;top:0;left:0;width:' + img_wide + 'px;height:' + img_high + 'px;'
		+ 'border:0px;padding:0px;z-index:0;overflow:auto;background-color:#000000;'
		//+ 'background-image:url(\'' + img_src + '\');'
		+ 'background-repeat:no-repeat;}</style>'
		+ '</head><body link="#DEE00F" vlink="#DEE00F" alink="#DEE00F" text="#DEE00F" bgcolor="#000000" topmargin="0" leftmargin="0">'
		+ '<div class="image" onClick="self.close();"></div>'
		+ '<img title="Click to close window" onClick="self.close();" style="cursor:pointer;position:absolute;top:0;left:0" border="0" src="'+img_src
		+'" width="'+img_wide+'" height="'+img_high+'">'
		+ '</body></html>';
	winHandler.document.open();
	winHandler.document.write(htmlContent);
	winHandler.document.close();
	winHandler.focus();
}

