// ---
/*
    Written by Jonathan Snook, http://www.snook.ca/jonathan
    Add-ons by Robert Nyman, http://www.robertnyman.com
*/

function getElementsByClassName(oElm, strTagName, oClassNames){
	var arrElements = (strTagName == "*" && oElm.all)? oElm.all : oElm.getElementsByTagName(strTagName);
	var arrReturnElements = new Array();
	var arrRegExpClassNames = new Array();
	if(typeof oClassNames == "object"){
		for(var i=0; i<oClassNames.length; i++){
			arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames[i].replace(/\-/g, "\\-") + "(\\s|$)"));
		}
	}
	else{
		arrRegExpClassNames.push(new RegExp("(^|\\s)" + oClassNames.replace(/\-/g, "\\-") + "(\\s|$)"));
	}
	var oElement;
	var bMatchesAll;
	for(var j=0; j<arrElements.length; j++){
		oElement = arrElements[j];
		bMatchesAll = true;
		for(var k=0; k<arrRegExpClassNames.length; k++){
			if(!arrRegExpClassNames[k].test(oElement.className)){
				bMatchesAll = false;
				break;
			}
		}
		if(bMatchesAll){
			arrReturnElements.push(oElement);
		}
	}
	return (arrReturnElements)
}
// ---
// Array support for the push method in IE 5
if(typeof Array.prototype.push != "function"){
	Array.prototype.push = ArrayPush;
	function ArrayPush(value){
		this[this.length] = value;
	}
}

function show_feature(id, idbtn){
    ft = new Array();
    ft[0] = document.getElementById("ftDataMaintenance");
    ft[1] = document.getElementById("ftReportProduction");
    ft[2] = document.getElementById("ftScheduling");
    for(i in ft) {
        ft[i].style.display = "none";
    }
		fb = new Array();
		fb[0] = document.getElementById("featurebutton1a");
		fb[1] = document.getElementById("featurebutton2a");
		fb[2] = document.getElementById("featurebutton3a");
		for(i in fb) {
			fb[i].style.backgroundColor = "#a0d3df";
		}
		fb[2].style.backgroundImage = "url(../images/featurebox_corner3.gif)";
		fb[0].style.backgroundImage = "url(../images/featurebox_corner2.gif)";
		btn = document.getElementById(idbtn);
		btn.style.backgroundColor = "#40a7bf";
		if (idbtn == "featurebutton3a") btn.style.backgroundImage = "url(../images/featurebox_corner4.gif)";
		else if (idbtn == "featurebutton1a") btn.style.backgroundImage = "url(../images/featurebox_corner1.gif)";
    feature = document.getElementById(id);
    feature.style.clear = "left";
    feature.style.display = "block";
}

function change_bottom_border(id, sty, val){
    document.getElementById('featurebutton1').style.borderBottom
        = document.getElementById('featurebutton2').style.borderBottom
        = document.getElementById('featurebutton3').style.borderBottom
        = "solid white 1px";
    document.getElementById(id).style.borderBottom = val;
}

