
// 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';
		}
	}
}


function showHide(event,node) {
	event.cancelBubble=true;
	document.getElementById(node).className =
		 (document.getElementById(node).className == "hide")?"":"hide";
	event.cancelBubble=true;
}


function compOver(obj,img,path) {
	if(!path) {
		path = '/BECRes/includes/images';
	}
	obj.style.backgroundImage = 'url('+path+'/'+img+'_o.jpg)';
}

function compOut(obj,img,path) {
	if(!path) {
		path = '/__english/landing';
	}
	obj.style.backgroundImage = 'url('+path+'/'+img+'.jpg)';
}

function genOver(obj,img,path) {
	if(!path) {
		path = '/__english/landing';
	}
	obj.style.backgroundImage = 'url('+path+'/'+img+'_o.jpg)';
}

function genOut(obj,img,path) {
	if(!path) {
		path = '/__english/landing';
	}
	obj.style.backgroundImage = 'url('+path+'/'+img+'.jpg)';
}

// 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 XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html><head><title>Print Page<\/title><link href="/BECRes/includes/css/main.css" rel="stylesheet" type="text/css" media="all"><link href="/BECRes/includes/css/printable.css" rel="stylesheet" type="text/css" media="all"><link href="/BECRes/includes/css/print_hide.css" rel="stylesheet" type="text/css" media="print"><link href="/BECRes/includes/css/sIFR-print.css" rel="stylesheet" type="text/css" media="all"><script type="text/javascript" src="/BECRes/includes/javascript/main.js" language="javascript"></script><\/head><body><div id="printable_buttons"><div style="float:left;"><input type="button" name="print" value="SEND TO PRINTER" onclick="printit();return false;" class="btn" \/><\/div><div align="right"><input type="button" name="close" value="CLOSE WINDOW" onclick="window.close();return false;" class="btn" \/><\/div><\/div>'+content+'<\/body><\/html>');

	winStatus = 1;

	newWindow.document.close();
	newWindow.focus();
}