/*  	
	ULF Web Services Version 1.1
	For www.boostfoods.com
	Created: 11th June 2005
	By: info@brownpaperbag.com.au
	Modified: 
*/
//<![CDATA[
function writeTrail() {
	var url = location.href.toLowerCase();
	var Parts = '';
	var strPath = '/';
	var strOutput = ''
	var strTemp = ''
	url = url.replace(/http\:.*\.au\//,"");
	url = url.replace(/http\:.*\.com\//,"");
	url = url.replace(/\?.*/,"");
	url = url.replace(/#.*/,"");
	Parts = url.split(/\//);
	for(i=0; i<Parts.length; i++){
		strPath += Parts[i] + '/';
		if (i == Parts.length-1){
			strTemp = (Parts[i].lastIndexOf('.')>0)?Parts[i].substring(0,Parts[i].lastIndexOf('.')):Parts[i];
			if(strTemp!=''){strOutput += (strTemp != 'default') ? ' &raquo; ' + fixCase(strTemp) : '';}
		}else{strOutput += (Parts[i+1] == 'default.aspx') ? strOutput += ' &raquo; ' + fixCase(Parts[i]) : strOutput += ' &raquo; ' + '<a href="'+strPath+ '" title="'+ fixCase(Parts[i])+'">'+fixCase(Parts[i])+'</a>'}
	}
	strOutput = '&nbsp;&nbsp;<a href="/" title="Return to the Boost Foods Homepage">Home</a> ' + strOutput;
	document.write(strOutput);
}
function fixCase(Text){
	var strOut = '';
	var i = 0;
	Text = Text.replace(/_and_/g, ' &amp; ');
	Text = Text.replace(/faqs/g, 'FAQ&rsquo;s');
	Text = Text.replace(/boost/g, 'boost&trade;');
	Text = Text.replace(/_/g, ' ');
	Text += ((Text.lastIndexOf("what") > -1) || (Text.lastIndexOf("how") > -1) || (Text.lastIndexOf("why") > -1) || (Text.lastIndexOf("what") > -1)) ? '?' : '';
	for (i=0; i<Text.length; i++){ 
		strOut += (i==0) ? Text.substring(i, i+1).toUpperCase() : ((Text.substring(i-1, i)== ' ') && (Text.substring(i, i+1) != '&') && (Text.substring(i, i+1) != '?' )) ? Text.substring(i, i+1).toUpperCase() : Text.substring(i, i+1);
	}
	strOut = strOut.replace(/Enews/g, 'eNews');
	return strOut;
}
writeTrail();

//]]>