function schemechange() {
	menuchange(2);
	check=3;

	if (schemever==0) {
		schemever=1;
		thecol='lightgreen';
		theshadcol='black';
		scheme.src=blankimg.src;
}
else
	if (schemever==1) {
		schemever=2;
		thecol='khaki';
		theshadcol='sandybrown';
		scheme.src=image4.src;
}
else
	if (schemever==2) {
		schemever=3;
		thecol='white';
		theshadcol='indianred';
		scheme.src=image3.src;
}
else
	if (schemever==3) {
		schemever=4;
		thecol='khaki';
		theshadcol='sienna';
		scheme.src=image2.src;
}
else
{
		schemever=0;
		thecol='white';
		theshadcol='indianred';
		scheme.src=image2.src;
}
	nextstage();
}


function hor_placer(val,loc) {
	topmostLyr[val].left=loc;
	middlebitLyr[val].left=loc;
//if (!document.all) {
	shadbitLyr[val].left=loc+1;
//}
	buttonLyr[val].left=loc;
	beneathLyr[val].left=loc;
}

function ver_placer(val,loc) {
	topmostLyr[val].top=loc;
	middlebitLyr[val].top=loc+(6*thesize);
//if (!document.all) {
	shadbitLyr[val].top=loc+(6*thesize)+1;
//}
	buttonLyr[val].top=loc;
	beneathLyr[val].top=loc;
}


function quickh(val,val2) {
	if (direction=='left') {
		hor_placer(val,(parseInt(topmostLyr[val2].left)-blockwid));}
	else{
		hor_placer(val,(parseInt(topmostLyr[val2].left)+blockwid));}
}

function quickv(val,val2) {ver_placer(val,parseInt(topmostLyr[val2].top));}


function cleartestbox() {
	toptestLyr.visibility="hidden";
	midtestLyr.visibility="hidden";
	notestLyr.visibility="hidden";
	nosuppLyr.visibility="hidden";
	testbutLyr.visibility="hidden";
	bottest1Lyr.visibility="hidden";
	bottest2Lyr.visibility="hidden";
}

function hider(val) {
	beneathLyr[val].visibility="hidden";
	topmostLyr[val].visibility="hidden";
	middlebitLyr[val].visibility="hidden";
	buttonLyr[val].visibility="hidden";
//if (!document.all) {
	shadbitLyr[val].visibility="hidden";
//}
}

function clearit(a,b) {for (var looper = a; looper <b; looper++) {hider(looper);}}

function cleargroup(groupval) {
	if (groupval==1) {clearit(3,6);} //os's
	if (groupval==2) {clearit(6,15);} //browsers
	if (groupval==3) {clearit(24,38);} //os versions
	if (groupval==4) {
		clearit(41,78);
//		clearit(52,no_boxes); //browser versions
		}
}

function changin(val) {
	unsupported=false;

	if(testing) {testing=false;cleartestbox();}
	if(direction=='left'&&(val>24&&val<38)) {cleargroup(2);cleargroup(4);}
	if(val==2||(direction=='left'&&(val>2&&val<6))) {clearit(6,no_boxes);} // new 20.9 

	if(direction=='right') {
		if (val>2&&val<15) {cleargroup(3);} // new 20.9 
		if (val>5&&val<15) {cleargroup(1);} // new 20.9 
}
//		if (val>5&&val<15) {cleargroup(4);} // new 20.9 


if (val==1) {//browser
	direction='right';
	clearblue(1);
	clearit(3,(no_boxes));
	loader(1,6,14);
	quickh(14,1);
	ver_placer(14,(parseInt(topmostLyr[13].top)+blockhgt));
	shower(14);
}

else

if (val==2) {//os
	direction='left';
	clearblue(2);
	loader(2,3,6);
}

else

if (val==3) {//windows
	ostype=linker[val];
		if (direction=='right'&&(browtype=='MSIE'||browtype=='Ace_ExP')){
//		if (direction=='right'&&browtype=='Ace_ExP'){
			quickh(33,3);
			quickh(34,3);
			quickv(34,3);
			quickh(36,3);
			ver_placer(33,(parseInt(topmostLyr[val].top)-blockhgt));
			ver_placer(36,(parseInt(topmostLyr[val].top)+blockhgt));
			shower(33);
			shower(34);
			shower(36);
			}
		else 
		if (direction=='right'&&browver=='op6'){tested(val);}
		else {loader(3,32,38);}
}

else

if (val==4) {//mac
	ostype=linker[val];
		if (direction=='right'&& (browtype=='firefox'||browtype=='safari'||browver=='op8')) {
			quickh(25,4);
			quickv(25,4);
			shower(25);} 
		else	{loader(4,24,26);}
}

else

if (val==5) {//linux
	ostype=linker[val];
		if (direction=='right'&&(browver=='op6'||browver=='ff1.0'||browver=='ff0.9')){tested(val);}
		else{loader(5,26,32);}
}

else
 
if (val==6) {  //msie
	browtype=linker[val];
//	cleargroup(4);
		if (direction=='left'&&ostype=='mac') {
			quickh(55,6);
			quickv(55,6);
			shower(55);
			} 
		else{loader(6,52,58);}
	clearit(26,32);
	clearit(41,52); //nu
	clearit(58,no_boxes); //nu
}

else

if (val==7) { //netscape
	browtype=linker[val];
//	cleargroup(4);
		if (direction=='left'&&ostype!='windows') {
			if (ostype=='mac') { 
				quickh(72,7);
				quickv(72,7);
				shower(72);}
			if (ostype=='linux') {
				quickh(75,7);
				ver_placer(75,(parseInt(topmostLyr[val].top))+(blockhgt/2));
				quickh(72,7);
				ver_placer(72,(parseInt(topmostLyr[val].top))-(blockhgt/2));
				shower(75);
				shower(72);}
			}
		else {loader(7,71,77);}
	clearit(41,71); //nu
	clearit(77,no_boxes); //nu
}

else

if (val==8) { //mozilla
	browtype=linker[val];
//	cleargroup(4);
		if (direction=='left'&&ostype=='mac') {
			quickh(66,8);
			ver_placer(66,(parseInt(topmostLyr[val].top))-(blockhgt/2));
			quickh(67,8);
			ver_placer(67,(parseInt(topmostLyr[val].top))+(blockhgt/2));
			shower(67);
			shower(66);
			}
		else
		if (direction=='left'&&ostype=='linux') {
			quickh(69,8);
			quickv(69,8);
			shower(69);
			}
		else
			{loader(8,65,71);
				if (direction=='left'&&osver=='XP') {hider(65);}
			}
	clearit(41,65); //nu
	clearit(71,no_boxes); //nu
}

else

if (val==9) { //firefox
	browtype=linker[val];
//	cleargroup(4);
		if (direction=='left'&&ostype=='mac') {unsupported=true;tested(val);}
		else
		{loader(9,41,45);}
	clearit(45,no_boxes); //nu
}
	
else
if (val==10) {//opera
	browtype=linker[val];
//	cleargroup(4);
		if (direction=='left'&&ostype=='mac') {
			quickh(58,10);
			quickv(58,10);
			shower(58);
		}
		else{
			loader(10,58,62);
			}
	clearit(41,58); //nu
	clearit(62,no_boxes); //nu
}

else
if (val==11) {//k-mel
	browtype=linker[val];
//	cleargroup(4);
	loader(11,62,65);
	clearit(41,62); //nu
	clearit(65,no_boxes); //nu
}

else
if (val==12) {//konq
	browtype=linker[val];
//	cleargroup(4);
	ostype='linux';
	loader(12,47,51);
	clearit(41,47); //nu
	clearit(51,no_boxes); //nu
}

else
if (val==13) {
	browtype=linker[val];
//	cleargroup(4);
		if (direction=='right') {loader(13,4,5);}
		else
		{tested(val);}
	clearit(41,no_boxes); //nu
}

else
if (val==14) {//ace
	browtype=linker[val];
//	cleargroup(4);
	loader(14,77,78);
	clearit(41,77); //nu
}


else
if (val==24) {
	osver=linker[val];
	if (direction=='left') {
		cleargroup(4);
		loader(24,6,11);
		}
	else {
		passfail=true;
		tested(val);}
}

else

if (val==25) {
	osver=linker[val];
	tested(val);
}

else

if (val==26||val==27||val==29) {

	(val==26?osver=linker[val]:osver='');
	if (direction=='left') {loader(val,7,11);
				quickh(12,26);
				ver_placer(12,(parseInt(topmostLyr[10].top))+blockhgt);
				shower(12);
}
	else 	{
		if (val==26&& (browver=='km9'||browver=='ff1.0.4'||browver=='ff1.0.6'||browtype=='opera'||browver=='kd3.2'|| browver=='moz1.7x'||browtype=='netscape')) {passfail=true;}
	tested(val);}
	}

else

if (val==28||(val>29&&val<33)||val==35||val==38||val==47||val==48||val==50||val==62||val==63) {   /// default untested
	if (val<38) {osver='badwin';}
	if (direction=='right') 		{  /// direction = right!
			if (val>37) {clearit(26,38);}
			if (val>61) {hider(3);}
		}
	passfail=false;tested(val);
}

else

if (val==33 || val==34|| val==36) {
	osver=linker[val];
	if (val==34) {osver='ME';}
	if (direction=='left') {
		loader(val,6,11);
		quickh(11,val);
		ver_placer(11,(parseInt(topmostLyr[10].top)+blockhgt));
		quickh(14,val);
		ver_placer(14,(parseInt(topmostLyr[6].top)-blockhgt));
		shower(11);
		shower(14);
					}
	else {
		passfail=true;
//			if ((val==34||val==36)&&browver=="MSIE3") {unsupported=true;}
		tested(val);}
}

else

if (val==49) {
	browver='kd3.2'; 
	if (direction=='right') {loader(val,26,32);}
	else
	{passfail=true;tested(val);}
}

else

if ((val>40&&val<45) ||(val>57&&val<62)) {
	if (val==41) {browver='ff0.9';}
	if (val==42) {browver='ff1.0';}
	if (val==43) {browver='ff1.0.4';}
	if (val==44) {browver='ff1.0.6';}
	if (val==58) {browver='op6';}
	if (val==59) {browver='op7.2';}
	if (val==60) {browver='op7.5';}
	if (val==61) {browver='op8';}
	if (direction=='right') {
		if ((val>40&&val<45)||val==59||val==60||val==61) {
			hider(4);
			nomac(val);
		} 
		else
		{loader(val,3,6);}
		cleargroup(3);
	}
	else {
		passfail=true;
		if (osver=='slackware'&&(val==41||val==42)) {passfail=false;}
		tested(val);}
}

else

if (val>51&&val<58) {
	browver='MSIE'+linker[val];
		if (direction=='right') {
			if (val==55) {
				hider(3);
				loader(val,4,5);
				clearit(32,38);
					}
			else {
				cleargroup(3);
				hider(4);
				loader(val,3,4);
			}
		}
		else {
			if (val==52&&osver!='98') {unsupported=true;}
			passfail=true;
			tested(val);}
}

else

if (val==64) {
	browver='km'+linker[val];
	if (direction=='right') {loader(64,3,4);}
	else {passfail=true;tested(val);}
}

else

if (val>64&&val<71) {
	browver='moz'+linker[val];
	if (val==70) {browver='moz1.8';}
		if (direction=='right') {
			cleargroup(1);
			cleargroup(3);
				if (val==66||val==67) {loader(val,4,5);}	 
				if (val==65||val==68) {loader(val,3,4);} 
				if (val==69||val==70) {nomac(val);} 
		}
	else {passfail=true;tested(val);}
}

else

if (val>70&&val<77) {
	browver='ns'+linker[val];
		if (val==74) {browver='ns6';}
		if (val==75) {browver='ns7';}
		if (val==76) {browver='ns8';}
		if (direction=='right') {
			cleargroup(1);
			cleargroup(3);
				if (val==72) {
					quickh(4,val);
					quickh(5,val);
					ver_placer(4,(parseInt(topmostLyr[val].top)-(blockhgt/2)));
					ver_placer(5,(parseInt(topmostLyr[val].top)+(blockhgt/2)));
					shower(4);
					shower(5);
					} 
				if (val==75) {nomac(val);} 
				if (val==71||(val>72&&val<77&&val!=75)) {loader(val,3,4);} 
		}
	else {passfail=true;tested(val);}
}

else

if (val==77) {
	browver='AE1';
	if (direction=='right') {loader(77,3,4);}
	else {passfail=true;tested(val);}
}


else{tested(val);}


	if (direction=='left') {
		if (parseInt(blackLyr.left)>parseInt(topmostLyr[val].left)) {setblue(val);}
		if (parseInt(blackLyr.left)<parseInt(topmostLyr[val].left)) {
			if (val>14||val<6) {browtype='';} 
			clearblue(val);}
		if (val>2&&val<6) {thirdlayer(val);}
		if (val>23&&val<38) {secondlayer(val);}
	}

	if (direction=='right') {
		if (parseInt(blackLyr.left)<parseInt(topmostLyr[val].left)) {setblue(val);}
		if (parseInt(blackLyr.left)>parseInt(topmostLyr[val].left)) {
			if (val>5||val<3) {ostype='';} 
			clearblue(val);}
		if (val>5&&val<24) {thirdlayer(val);}
		if (val>37&&val<no_boxes) {secondlayer(val);}
	}

	blackLyr.left=parseInt(beneathLyr[val].left);
	blackLyr.top=parseInt(beneathLyr[val].top);
	blackLyr.visibility="visible";
	beneathLyr[val].visibility="hidden";
}

function nomac(val) {
					quickh(3,val);
					ver_placer(3,(parseInt(topmostLyr[val].top)-(blockhgt/2)));
					quickh(5,val);
					ver_placer(5,(parseInt(topmostLyr[val].top)+(blockhgt/2)));
					shower(3);
					shower(5);
}

function loader(val,startpoint,endpoint) {

if (val==1) {var columnval=((parseInt(available_width/2))+blockwid);}
if (val==2) {var columnval=((parseInt(available_width/2))-(blockwid*2));}

if (direction=='left') {
	if (val>2&&val<6) {var columnval=((parseInt(available_width/2))-(blockwid*3));}
	if (val>5&&val<24) {var columnval=((parseInt(available_width/2))-(blockwid*5));}
	if (val>23&&val<38) {var columnval=((parseInt(available_width/2))-(blockwid*4));}
}
else
{
	if (val>2 &&val<6) {var columnval=((parseInt(available_width/2))+(blockwid*4));}
	if (val>5&&val<24) {var columnval=((parseInt(available_width/2))+(blockwid*2));}
	if (val>37&&val<no_boxes) {var columnval=((parseInt(available_width/2))+(blockwid*3));}
} 

	for (var looper = startpoint; looper <endpoint; looper++) {
		topmostLyr[looper].left=columnval;
		middlebitLyr[looper].left=columnval;
		shadbitLyr[looper].left=columnval+1;
		buttonLyr[looper].left=columnval;
		beneathLyr[looper].left=columnval;
		shower(looper);
	}
var st=startpoint;

if (val==13||val==14||(val>51&&val<58)||(val>63&&val<71)||(val>70&&val<78)) {  
	ver_placer(st,(parseInt(topmostLyr[val].top)));
}

if (val==4) {
	ver_placer(startpoint,(parseInt(topmostLyr[val].top)-(blockhgt/2)));
	ver_placer((st+1),(parseInt(topmostLyr[val].top)+(blockhgt/2)));
}

if (val==2||val==11||val==32||(val>40&&val<44)||val==58) {
	ver_placer(st,(parseInt(topmostLyr[val].top)-blockhgt));
	ver_placer((st+1),(parseInt(topmostLyr[val].top)));
	ver_placer((st+2),(parseInt(topmostLyr[val].top)+blockhgt));
}

if (val==9||val==10||val==12||val==25||(val>25&&val<31)) {
	ver_placer(st,(parseInt(topmostLyr[val].top)-(blockhgt*1.5)));
	ver_placer((st+1),(parseInt(topmostLyr[val].top)-(blockhgt/2)));
	ver_placer((st+2),(parseInt(topmostLyr[val].top)+(blockhgt/2)));
	ver_placer((st+3),(parseInt(topmostLyr[val].top)+(blockhgt*1.5)));
}

if (val==24 || val==33|| val==34 || val==36 ) {
	ver_placer(st,(parseInt(topmostLyr[val].top)-(2*blockhgt)));
	ver_placer((st+1),(parseInt(topmostLyr[val].top)-blockhgt));
	ver_placer((st+2),(parseInt(topmostLyr[val].top)));
	ver_placer((st+3),(parseInt(topmostLyr[val].top)+blockhgt));
	ver_placer((st+4),(parseInt(topmostLyr[val].top)+(2*blockhgt)));
}

if (val==3 || (val>4&&val<9)|| (val>25&&val<32)||(val==49)) {
	ver_placer(st,(parseInt(topmostLyr[val].top)-(blockhgt*2.5)));
	ver_placer((st+1),(parseInt(topmostLyr[val].top)-(blockhgt*1.5)));
	ver_placer((st+2),(parseInt(topmostLyr[val].top)-(blockhgt/2)));
	ver_placer((st+3),(parseInt(topmostLyr[val].top)+(blockhgt/2)));
	ver_placer((st+4),(parseInt(topmostLyr[val].top)+(blockhgt*1.5)));
	ver_placer((st+5),(parseInt(topmostLyr[val].top)+(blockhgt*2.5)));
}

if (val==1) {
	ver_placer(6,(parseInt(topmostLyr[val].top)-(4*blockhgt)));
	ver_placer(7,(parseInt(topmostLyr[val].top)-(3*blockhgt)));
	ver_placer(8,(parseInt(topmostLyr[val].top)-(2*blockhgt)));
	ver_placer(9,(parseInt(topmostLyr[val].top)-(blockhgt)));
	ver_placer(10,(parseInt(topmostLyr[val].top)));
	ver_placer(11,(parseInt(topmostLyr[val].top)+(blockhgt)));
	ver_placer(12,(parseInt(topmostLyr[val].top)+(2*blockhgt)));
	ver_placer(13,(parseInt(topmostLyr[val].top)+(3*blockhgt)));
}
}

function tested(val) {

testing=true;
	
	if (osver=='badwin') {passfail=false;}
	if (osver=='osx') {passfail=false;}

	if (osver=='mac' && (browtype=='firefox'||browver=='op8')) {passfail=false;}
	if (ostype!='mac'&& browver=='MSIE5.2') {passfail=false;unsupported=true;}
	if (ostype!='mac'&& (browver=='op6'||browver=='moz1.3'||browver=='moz1.02')) {passfail=false;}

	if (osver!='XP'&& (browver=='ns8'||browver=='moz1.8')) {passfail=false;}

	if (osver!='98'&& browver=='moz0.99') {passfail=false;}
	if (osver!='98'&& browver=='MSIE3') {passfail=false;unsupported=true;}
	if (osver=='badwin'&& browver=='MSIE3') {unsupported=false;}

	if (ostype=='windows' && browver=='ns4.7x'){passfail=false;}

	if (browtype=='kmeleon' && browver!='km9') {passfail=false;}
	if (ostype=='linux'&& (osver!='slackware'||browver=='op7.2')) {passfail=false;}


	var testposl=parseInt(topmostLyr[val].left);
	var testposh=parseInt(topmostLyr[val].top);

	(direction=='right'?testposl=testposl+blockwid:testposl=testposl-blockwid); 

	testbutLyr.left=testposl;
	testbutLyr.top=testposh;
	testbutLyr.visibility="visible";


	if (passfail) {
		passfail=false;
		toptestLyr.left=testposl;
		toptestLyr.top=testposh;
		midtestLyr.left=testposl;
		midtestLyr.top=testposh+(6*thesize);
		bottest1Lyr.left=testposl;
		bottest1Lyr.top=testposh;
		toptestLyr.visibility="visible";
		midtestLyr.visibility="visible";
		bottest1Lyr.visibility="visible";
	}
	else {
		notestLyr.left=testposl;
		notestLyr.top=testposh+(6*thesize);
		nosuppLyr.left=testposl;
		nosuppLyr.top=testposh+(6*thesize);
		bottest2Lyr.left=testposl;
		bottest2Lyr.top=testposh;

		if (unsupported) {
			nosuppLyr.visibility="visible";} 
		else {
			notestLyr.visibility="visible";}
		bottest2Lyr.visibility="visible";}
}

function setblue(val) {
	if (parseInt(thirdLyr.left)!=parseInt(secondLyr.left)) {thirdLyr.visibility="visible";}
//first
	if (val>2) {			
		firstLyr.left=parseInt(blackLyr.left);
		firstLyr.top=parseInt(blackLyr.top);
		firstLyr.visibility="visible";}
	else{
		firstLyr.left=parseInt(topmostLyr[val].left);
		firstLyr.top=parseInt(topmostLyr[val].top);
	}
}

function clearblue(val) {
	if ((val<3)||(direction=='right'&&(val>5&&val<24))||(direction=='left'&&(val<6||(val>23&&val<38)))) {
		secondLyr.visibility="hidden";
		secondLyr.left=parseInt(topmostLyr[val].left);
		secondLyr.top=parseInt(topmostLyr[val].top);
	}
		firstLyr.visibility="hidden";
		firstLyr.left=parseInt(topmostLyr[val].left);
		firstLyr.top=parseInt(topmostLyr[val].top);
	if (val<3) {
		thirdLyr.visibility="hidden";
		thirdLyr.left=parseInt(topmostLyr[val].left);
		thirdLyr.top=parseInt(topmostLyr[val].top);
	}
}

function secondlayer(val) {
	secondLyr.left=parseInt(topmostLyr[val].left);
	secondLyr.top=parseInt(topmostLyr[val].top);
	secondLyr.visibility='visible';
}

function thirdlayer(val) {
	thirdLyr.left=parseInt(topmostLyr[val].left);
	thirdLyr.top=parseInt(topmostLyr[val].top);
}

function changout(val) {beneathLyr[val].visibility="visible";blackLyr.visibility="hidden";}

function shower(val) {
	beneathLyr[val].visibility="visible";
	topmostLyr[val].visibility="visible";
	middlebitLyr[val].visibility="visible";
	buttonLyr[val].visibility="visible";
	shadbitLyr[val].visibility="visible";
}

