// Location.js
// provides location path mapping of current location within website
//
var path = "";
var href = document.location.href;
var s = href.split("/"); 
for (var i=2;i<(s.length-1);i++) {
  sublocation = s[i]; 
  sublocation = sublocation.toLowerCase();
  switch (sublocation) {
	case "www.rss.usda.gov":  
		sublocation = "Home"; break;
	case "k:":  
		sublocation = "Home"; break;
	case "forms":  
		sublocation = "Forms"; break;
	case "publications":
		sublocation = "Publications"; break;
	case "training":  
		sublocation = "Training"; break;
	case "resources":  
		sublocation = "Resources"; break;


	default: sublocation = s[i];
   	}
path+="<A HREF=\""+href.substring(0,href.indexOf(s[i])+s[i].length)+"/\">"+sublocation+"</A>";
if (i != s.length-2) {path +=" &raquo; "; }
   }
var url = 'You are here: ' + path;
document.writeln(url);

