
// TREE TOGGLER

function doBranch(node) {

	if(node.parentNode.className == "closed") {
		node.parentNode.className = "open";
	}
	
	else if (node.parentNode.className == "open") {
		node.parentNode.className = "closed";
	}
}

function doFolder(node,iFr,src) {

	if(node.parentNode.className == "closed") {
		node.parentNode.className = "open";
	}
	window.parent.document.getElementById(iFr).src = src;
}	

function branchAll() {
	
	var nodes = document.getElementsByTagName('li');

	for (var i = 0; i < nodes.length; i++) {
	
		if (nodes[i].className == 'closed') {			
			nodes[i].className = 'open';
		}
	}	
}

function collapseAll() {
	
	var nodes = document.getElementsByTagName('li');

	for (var i = 0; i < nodes.length; i++) {
	
		if (nodes[i].className == 'open') {			
			nodes[i].className = 'closed';
		}
	}
}

// PRINT FUNCTIONS

function printit(){  
	if (window.print) {
	    window.print() ;  
	} else {
	    var WebBrowser = '<OBJECT ID="WebBrowser1" WIDTH=0 HEIGHT=0 CLASSID="CLSID:8856F961-340A-11D0-A96B-00C04FD705A2"></OBJECT>';
	document.body.insertAdjacentHTML('beforeEnd', WebBrowser);
	    WebBrowser1.ExecWB(6, 2); //Use a 1 vs. a 2 for a prompting dialog box    WebBrowser1.outerHTML = "";  
	}
}

function printFrame(iFr) {
	window.top[iFr].focus();
	window.top[iFr].print();
}

function printDiv(id) {
	var content = document.getElementById(id).innerHTML
	tmpStr = "location=no,menubar=no,directories=no,toolbar=no,status=no,personalbar=no,titlebar=no,scrollbars=yes,dependent=yes,resizable=yes";
	
	newWindow=window.open('','newWin',tmpStr);
	newWindow.document.write('<!doctype html public "-//W3C//DTD HTML 4.0 Transitional//EN"><html><head><title>Print Page<\/title><link href="/_media/_css/printable.css" rel="stylesheet" type="text/css" media="all"><link href="/_media/_css/sIFR-print.css" rel="stylesheet" type="text/css" media="all"><\/head><body>'+content+'<\/body><\/html>');
	
	winStatus = 1;
	
	newWindow.document.close();
	newWindow.focus();
}