//
// support.js
//
var dbg={
	w:null,
	print: function(msg){
		if((dbg.w==null)||(dbg.w.closed)){
			dbg.w = window.open("","debug","width=500, height=500, resizable, scrollbars");
			dbg.w.document.open("text/plain");
		}
		dbg.w.focus();
		dbg.w.document.writeln(msg);
		dbg.w.self.scrollBy(0,100);
	}
};
//
var support = {
	selects:null,
	family:null,
	init: function(){
		var x = document.getElementById("families");
		support.selects = document.getElementsByTagName("select");
		addEvent(x, "change", support.swap, false);
		support.hideAll();
		support.showSelect();
	},
	swap:function(){
		support.hideAll();
		support.showSelect();
	},
	hideAll:function(){
		for(var i=1; i<support.selects.length; i++){
			support.selects[i].className="hide";
			support.selects[i].name="";
		}
	},
	showSelect:function(){
		support.family = document.getElementById("families").value;
		document.getElementById(support.family).className="show";
		document.getElementById(support.family).name="model";
	}
};
//
function addEvent(elm, evType, fn, useCapture){
	if(elm.addEventListener){
		elm.addEventListener(evType, fn, useCapture);
		return;
	}
	if(elm.attachEvent){
		elm.attachEvent("on"+evType, fn);
		return;
	}
}
//
addEvent(window, "load", support.init, false);