//Menu for older browsers
<!--//--><![CDATA[//><!--
sfHover = function() {
	var sfEls = document.getElementById("cahsNav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>

//BreadCrumbs
function crumbs(){
	sURL = new String;
	bits = new Object;
	var x = 0;
	var stop = 0;
	var output = "<a class=\"crumbs\" HREF=\"/\">Home</a>"; 
	var output2 = "<a class=\"crumbs\" HREF=\"/\">Home</a>"; 
	sURL = location.href;
	<!--slice the first 8 digits of the front of the URL - removes http:// or shttp://-->
	sURL = sURL.slice(8,sURL.length);
	chunkStart = sURL.indexOf("/");
	<!--miss the first slash-->
	sURL = sURL.slice(chunkStart+1,sURL.length)
	while(!stop){
		chunkStart = sURL.indexOf("/");
		if (chunkStart != -1){
			bits[x] = sURL.slice(0,chunkStart)
			sURL = sURL.slice(chunkStart+1,sURL.length);
		} else {
			stop = 1;
		}
		x++;
	}
	<!--first output-->
	for(var i in bits){
		output += " &raquo; <a class=\"crumbs\" HREF=\""; 
		for(y=1;y<x-i;y++){
		<!--adds ../ to the end of output (LINK)-->
			output += "../";
		}
		<!--adds folder name to link name-->
		output += bits[i] + "/\">" + bits[i] + "</a>";
	}
	
	<!--2nd output - loops through all folders except for the last slash-->
	var a = i;
	var b = 0 ;		
	while(b<a){	
			output2 += " &raquo; <a class=\"crumbs\" HREF=\""; 
			for(y=1;y<x-b;y++){
				output2 += "../";
			}
			output2 += bits[b] + "/\">" + bits[b] + "</a>";			
		b++;
	}

	var thisURL = location.href;
	<!--finds the last slash plus 1-->
	var pURL = thisURL.lastIndexOf("/");
	var slURL = pURL+1
	<!--strips everything before last slash-->
	pURL = thisURL.slice(thisURL, -slURL);
	<!--if we're left with index or nothing, use output 2-->
	if (thisURL.indexOf("index.htm") != -1 || thisURL.indexOf("index.php") != -1 || pURL == "") {
		var title_array=document.title.split("-");
		document.write(output2 + " &raquo; " + title_array[0]);		
	} else {
		<!--if we're using 1, grab the title to first hyphen-->
		var title_array=document.title.split("-");
		output += " &raquo; ";
		document.write(output + title_array[0]);
	}
}

//Print

var gAutoPrint = true; // Flag for whether or not to automatically call the print function

function doPrinting()
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n';

		if (document.getElementsByTagName != null)
		{
			var headTags = document.getElementsByTagName("head");
			if (headTags.length > 0)
				html += headTags[0].innerHTML;
		}
		
		html += '\n</HE' + 'AD>\n<BODY>\n';
		
		var printFromHereElem = document.getElementById("printFromHere");
		
		if (printFromHereElem != null)
		{
				html += printFromHereElem.innerHTML;
		}
		else
		{
			alert("Could not find the printFromHere section in the HTML");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","doPrinting");
		printWin.document.open();
//		printWin.document.write(html);

// write title
	printWin.document.write('<html><head><title>Women\'s & Children\'s Health Service</title>');
// add stylesheet
	printWin.document.write('<link href="/css/pmhprint.css" rel="stylesheet" type="text/css">');
// write heading
	printWin.document.write('</head><body bgcolor="#ffffff"><table width="100%" border="0"><tr><td valign="top"><div align="left"><img src="/images/final_wchs_vert_colour_thumb.jpg" width="76" height="91"></div></td><td valign=top><center><br><h2>Women\'s and Children\'s Health Service</h2><h4>http://wchs.health.wa.gov.au</h4></center></td><td valign=top width="30%">Incorporating:<p>King Edward Memorial Hospital for Women<br>374 Bagot Road Subiaco<br>Western Australia 6008<br>Telephone (08) 9340 2222');
	printWin.document.write('<p>Princess Margaret Hospital for Children<br>Roberts Road Subiaco<br>Western Australia 6008<br>Telephone (08) 9340 8222</td></tr></table>');
// insert dynamic content
	printWin.document.write('<hr width="100%" size="1" noshade>' + html + '<hr width="100%" size="1" noshade></body></html>');
// insert timestamp
    printWin.document.write(Date());    		
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}