brns4 = (document.layers)?true:false;
brie = (document.all && !window.opera)?true:false;
brie4 = (document.all && !document.getElementById)?true:false;
briewin = (window.ActiveXObject)?true:false;
brdom = (document.getElementById)?true:false;
brmoz = (window.sidebar)?true:false;
brns6 = (window.sidebar&&navigator.userAgent.indexOf('Netscape')!=-1)?true:false;
bropera = (window.opera)?true:false;
brmac = (navigator.userAgent.indexOf('Mac')!=-1)?true:false;
briemac = ((navigator.userAgent.indexOf('Mac')!=-1) && (document.all&&(!window.opera)))?true:false;

if (brns4) document.location.href="/oldbrowser.htm";

document.write('<STYLE>\n');
document.write('.menuitemover,.menuitem {\n');
if (brie) document.write('width:120px;\n');
else document.write('width:109px;\n');
document.write('padding-left:11px;\n');
document.write('cursor:default;\n');
document.write('}\n');
document.write('</STYLE>\n');

var hrefs,speed;
colon = new Array(); coloff = new Array();
bgcolon = new Array(); bgcoloff = new Array();
timo = new Array();

bgcoloff[0]="240,240,240"; 	bgcolon[0]="200,200,200";
coloff[0]="#404040";	colon[0]="#202020";
bgcoloff[1]="140,140,140"; 	bgcolon[1]="96,96,96";
coloff[1]="#F6F6F6";	colon[1]="#FFFFFF";

speed=30;
function fadein(i,n) {
	if (i>=100 && i<200) {
		hidemenus();
		pos=document.getElementById('midtd').offsetLeft+document.getElementById('menu'+i).offsetLeft;
		if (document.getElementById("submenu"+(i-100)).style.visibility!="hidden") {
			document.getElementById("subshadow").style.left=pos+2;
			document.getElementById("subshadow").style.top=100;
			document.getElementById("subshadow").style.width=document.getElementById("submenu"+(i-100)).offsetWidth;
			document.getElementById("subshadow").style.height=document.getElementById("submenu"+(i-100)).offsetHeight+4;

			document.getElementById("subkiller").style.left=pos-20;
			document.getElementById("subkiller").style.top=100;
			document.getElementById("subkiller").style.width=document.getElementById("submenu"+(i-100)).offsetWidth+40;
			document.getElementById("subkiller").style.height=document.getElementById("submenu"+(i-100)).offsetHeight+20;

			document.images["killergif"].width=document.getElementById("submenu"+(i-100)).offsetWidth+40;
			document.images["killergif"].height=document.getElementById("submenu"+(i-100)).offsetHeight+20;

			document.getElementById("submenu"+(i-100)).style.left=pos;
		}
	}
	document.getElementById('menu'+i).style.color=colon[n];
	if (brie) {
		on = bgcolon[n].split(","); off = bgcoloff[n].split(","); r1 = parseInt(on[0]);g1 = parseInt(on[1]);b1 = parseInt(on[2]); r2 = parseInt(off[0]);g2 = parseInt(off[1]);b2 = parseInt(off[2]);
		for (c=0;c<=10;c++) { clearTimeout(timo[i*1000+c]); timo[i*1000+c] = window.setTimeout("document.getElementById('menu"+i+"').style.background='rgb("+(r2+(r1-r2)*(c/10))+","+(g2+(g1-g2)*(c/10))+","+(b2+(b1-b2)*(c/10))+")'",c*speed); }
	} else {
		document.getElementById('menu'+i).style.background='rgb('+bgcolon[n]+')';
	}
}
function fadeout(i,n) {
	document.getElementById('menu'+i).style.color=coloff[n];
	if (brie) {
		on = bgcoloff[n].split(","); off = bgcolon[n].split(","); r1 = parseInt(on[0]);g1 = parseInt(on[1]);b1 = parseInt(on[2]); r2 = parseInt(off[0]);g2 = parseInt(off[1]);b2 = parseInt(off[2]);
		for (c=0;c<=10;c++) { clearTimeout(timo[i*1000+c]); timo[i*1000+c] = window.setTimeout("document.getElementById('menu"+i+"').style.background='rgb("+(r2+(r1-r2)*(c/10))+","+(g2+(g1-g2)*(c/10))+","+(b2+(b1-b2)*(c/10))+")'",c*speed); }
	} else {
		document.getElementById('menu'+i).style.background='rgb('+bgcoloff[n]+')';
	}
}

function hidesub(i) {
	document.getElementById("submenu"+(i-100)).style.left=-999;
	document.getElementById("subshadow").style.left=-999;
	document.getElementById("subshadow").style.top=-999;

	document.getElementById("subkiller").style.left=-999;
	document.getElementById("subkiller").style.top=-999;

}
function hidemenus() {
	for (x=100;x<=113;x++) hidesub(x);
}

function checkmouse(e) {
	if (allloaded) {
		if (brie) {
			//if (event.clientY>285 || event.clientY<60) hidemenus();
		}
		if (brmoz) {
			//if (e.pageY>285 || e.pageY<60) hidemenus();
		}
	}
}

chosenpoll=-99;
function poll(n) {
	if (chosenpoll!=-99) document.images["poll"+chosenpoll].src="/_img/polloff.gif";
	document.images["poll"+n].src="/_img/pollon.gif";
	document.forms["pollform"].chosenpoll.value=n;
	chosenpoll=n;
}

function surfto(n) {
	if (brie) document.getElementById("cl_"+n).click();
	else document.location.href="/"+n+"/";
}

function init() {
	allloaded=true;
}
allloaded=false;
document.onclick=hidemenus;
document.onmousemove=checkmouse;
window.onload=init;

var im,w,h,mousex,mousey,attempt,photowin;
document.write('<DIV ID="photoload" STYLE="position:absolute;visibility:hidden;padding:1px;font:menu;border:1px solid black;background:#FFFFDD">&nbsp;Loading image...&nbsp;</DIV>');
document.onmousedown=getxy;
function getxy(e) {
	if (!document.all) { mousex=e.pageX; mousey=e.pageY; }
	else { mousex=event.clientX; mousey=event.clientY; }
	mousey+=20;
}
function photopop(file) {
	if (photowin) if (!photowin.closed) photowin.close();
	with (document.getElementById("photoload").style) { left=mousex; top=mousey; visibility="visible"; }
	im = new Image();
	im.src = file;
	attempt=1; checkload();
}
function checkload() {
	if (im.complete || im.width>32) {
		s = screen;
		w = im.width; x = (s.width-w)/2 - (s.width-s.availWidth);
		h = im.height; y = (s.height-h)/2 - (s.height-s.availHeight);
		document.getElementById("photoload").style.visibility="hidden";
		photowin = window.open("../_inc/photopop.htm","pf","width="+w+",height="+h+",top="+y+",left="+x);
	} else {
		if (attempt < 100) {
			attempt++;
			window.setTimeout("checkload()",100);
		} else {
			document.getElementById("photoload").style.visibility="hidden";
			alert('The picture could not be loaded after 10 seconds');
		}
	}
}
