var solutiondivs = new Array();
var problemdivs = new Array();

function switcher_flip(e)
{
	var e1 = getEvent(e);
	do_flip(e1);
}

function do_flip(e1)
{
	reset_solutions();
	reset_problems();
	e1.className = "problemselect";
	e1.parentNode.getElementsByTagName("div")[1].className = "solutionselect";
}


function reset_solutions()
{
	for(var i=0; i<solutiondivs.length; i++)
	{
		solutiondivs[i].className = "solution";
	}
}
function reset_problems()
{
	for(var i=0; i<problemdivs.length; i++)
	{
		problemdivs[i].className = "problem";
	}
}



function switcher_init()
{
	var switcherdivs = document.getElementById("switcher").getElementsByTagName("div");
	for(var i=0; i<switcherdivs.length; i++)
	{
		if (switcherdivs[i].className == "solution")
		{
			solutiondivs.push(switcherdivs[i]);
		}
		if (switcherdivs[i].className == "problem")
		{
			addEvent(switcherdivs[i],"mouseover",switcher_flip,false);
			problemdivs.push(switcherdivs[i]);
		}
	}
	
	do_flip(switcherdivs[0]);
	
	
}

addEvent(window,"load",switcher_init,false);
