function changeMe(id) { 
    var i;
    var divs = document.body.getElementsByTagName("DIV");

    for (i = 0; i < divs.length; ++i) {
	if (divs[i].id.length == 0) { continue; }
	if (divs[i].id != 'br' && divs[i].id != 'menu_div' && divs[i].id != 'relatedTopics' && divs[i].id != 'hl04'){
	if (divs[i].id != 'right_content'){
		if (id == divs[i].id) {
		    divs[i].style.display = 'block';
		} else {
		    divs[i].style.display = 'none';
		}
	    }
	}
	}
	posRel();
    return false;
}

function roller(aImg) {
    var src = aImg.src;
    var aPath = src.split('/');
    var img = aPath[aPath.length - 1].split('.');

    if (img[1] == 'def') {
	img[1] = 'rol';
    } else {
	img[1] = 'def';
    }
    aPath[aPath.length - 1] = img.join('.');
    src = aPath.join('/');
    aImg.src = src;
}

function printContent(myWin) {
    var target = myWin.document.getElementById('right_content');
    var theWin = window.open('', 'print','width=652,height=330,scrollbars,status');
    the_doc = theWin.document;
    the_doc.open();
    the_doc.write('<html><head><style>img.printButton { display: none; }</style></head>');
    the_doc.write('<link rel="Stylesheet" type="text/css" href="../lib.css/global.css">');   
    the_doc.write('<body style="background-color: white; background-image: none; margin: 0;">');
	the_doc.write('<div style="width: 630px;">');
    the_doc.write('<p align="center" style="margin-top: 0;"><img src="../commonimages/print_header.gif"/></p>');   
    the_doc.write(target.innerHTML);
    the_doc.write('&nbsp;<br/><hr />');
    the_doc.write('<p align="center" class="small">Swenox AB&nbsp;&nbsp;Sweden&nbsp;&nbsp;<br/>');
    the_doc.write('Swenox AB&nbsp;&nbsp;&nbsp;Sweden&nbsp;<br/>');
    the_doc.write('Printed from http://www.swenox.com, copyright &copy; 2006 Swenox AB.<br/>');
	the_doc.write('</div>');
	the_doc.write('</body></html>');
    the_doc.close();
    theWin.print();
}

function posRel() {
	var myDivs = document.getElementsByTagName("div");
	
/* position related topics and make them visible */	
	if (myDivs['relatedTopics'] != null) {
		myDivs['relatedTopics'].style.top = 1 + "px";
		var menuBot = parseInt(myDivs['menu_div'].offsetHeight);
		var relTop = parseInt(myDivs['relatedTopics'].style.top);
		relPos = menuBot + 210 + "px";
		myDivs['relatedTopics'].style.display = 'block';
		myDivs['relatedTopics'].style.top = relPos;
	}

/* position bottom bar */

/* first, check that the bottom bar and main content divs exist and set a value for the starting
location of the bottom bar */	
	if (myDivs['br'] != null && myDivs['right_content'] != null) {
		myDivs['br'].style.top = 1 + "px";
		
/* next, work out which of the divs has the lowest bottom point */		
		myPage = (document.location.href);
		if (myPage.indexOf('home/index.html') > -1) { // check if we're on the home page;
			x1 = parseInt(myDivs['right_content'].offsetHeight) + 178;
			} else {
			x1 = parseInt(myDivs['right_content'].offsetHeight) + 62;
			}
		x2 = parseInt(myDivs['menu_div'].offsetHeight) + 206;
		if (myDivs['relatedTopics'] != null ) {
			x3 = parseInt(myDivs['relatedTopics'].offsetHeight) + x2;
			} else {
			x3 = 0 
			}
		x = (Math.max(x1,x2,x3))
//		alert (x);

/* then, compare the position of the lowest div with the bottom of the window, using 
different methods for IE and Mozilla */

		if ((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >=4)){ 
			y = window.innerHeight;
		} else if ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >=4)){ 	
			y = document.body.clientHeight;
		} else { 
			return;
		}

/* then, position the bottom bar and make it visible */

		if (x > y) {
			myDivs['br'].style.top = x + "px";
			myDivs['br'].style.display = 'block';
//			alert ("content bigger than window");
		} else {
//			alert ("window bigger than content");
			myDivs['br'].style.top = (y - 20) + "px";
			myDivs['br'].style.display = 'block';
		}
	}
	
return;
}