//Menu style wrapper V2
//Code - Frank Gasking
//Purpose - Take a standard Bulleted list and wrap in a nice style
//        - Requires just a simple bulleted list to maintain with links.

var text, links, a=0, locationpart, temp;

// First of all get all the links and store in an array.  We are working in order, so items 0-?? will be in order of list.
links = document.getElementById('minitabs').getElementsByTagName('a');


// Now we ensure all <LI> and <A> tags are lower case, as Firefox and IE handle both at different cases.... This is to
// Be dropped and merged into the next line of code which has a REG EXP... this can do OR...
text = document.getElementById('minitabs').innerHTML.replace(/<LI><A/g, "<li><a");


temp = this.location.href;
locationpart = temp.slice(0, temp.indexOf(".asp")+4);

//And finally the part where we add the click links.
//This time we keep replacing until all exact instances of <li onmouseout are gone... because eventually they will all be <li onclick etc....
while (a < links.length){
	if (locationpart == links[a]){
		text = text.replace ("<li><a href=", "<li><a style=\"cursor: pointer;\" class=\"inshade\" href=");
	}
	else{
		text = text.replace ("<li><a href=", "<li><a style=\"cursor: pointer;\" href=");
	}
	a++;	
}

//Finally set the text and we are done.
document.getElementById('minitabs').innerHTML = text;
