if(document.all){document.write("<STYLE TYPE='text/css'>\nDIV.MENU DIV {width: 80px; height: 80px; }\nDIV.MENU {position: absolute; top: 62px; }\nDIV.HEADER DIV#Account {position: absolute; }\n#t {height: 2em; padding-top: 1px; }\n</STYLE>");}else{document.write("<STYLE TYPE='text/css'>\nBODY {border-bottom: 0px solid white; }\nDIV.HEADER {width: 97.7%; }\n</STYLE>");}

var cmenu = '';
var amenu = 0;

var bodyFarRight;
var bodyFarBottom;


function initialize(){
	getBodyDim();
	if(document.all){
		bodyFarBottom += 16;
	}

	if(document.all){
		xPosition('MNU', 0, 62);
		xPosition('Account', 0, 0);
	}
	
	keepFixed();
}

function keepFixed(){
	emuFixedPos('bdy', 'MNU', 0, 62);
	emuFixedPos('bdy', 'Account', -1, -1);
}

function emuFixedPos(bodyid, obj, xpos, ypos){
	if(document.all){
		var fixedElDim = getDimentions(obj);
		scrollOffsetY = document.getElementById(bodyid).scrollTop;
		xPosition(obj, xpos, (ypos + scrollOffsetY));
//		alert(bodyFarBottom - fixedElDim[3]);
//		xPosition(id, 0, 0);
	}
}

function getBodyDim(bId){
	inw = document.body.clientWidth;
	inh = document.body.clientHeight;
	outw = document.body.offsetWidth;
	outh = document.body.offsetHeight;
	if(window.innerWidth){
		inw = window.innerWidth;
		inh = window.innerHeight;
	}
	if(window.outerWidth){
		outw = window.outerWidth;
		outh = window.outerHeight;
	}

//	var bodyDimentions = getDimentions(bId);
//	if(document.all){
//		if(document.body.scroll != "no"){bodyDimentions[2] -= 21;}
//	}
//	bodyFarRight = bodyDimentions[2];
	bodyFarRight = inw;
	bodyFarBottom = inh;
	if(typeof(document.getElementById('bdy').style.MozOpacity) != "undefined"){
		bodyFarRight = bodyFarRight - 	15;
//		bodyFarBottom = bodyFarBottom - 	15;
	}
	var currentpos = bodyFarRight;
//	alert('Body Width: '+currentpos);
//	alert('Window Inner Width: '+inw+'\nWindow Outer Width: '+outw);
}

function getDimentions(mId){
	obj = document.getElementById(mId);
//	alert(mId);
	var dimentions = new Array(obj.offsetLeft, obj.offsetTop, obj.offsetWidth, obj.offsetHeight);
	return dimentions;
}

function xPosition(id, x, y){
	var obj = document.getElementById(id);
	obj.style.left = x;
	obj.style.top = y;
}


function revealSubMenu(id, obj){
	if(document.all){
		if(cmenu != ''){
			document.getElementById(cmenu).style.display = 'none';
			cmenu = id;
		}else{cmenu = id;}
		amenu = 1;

		document.getElementById(id).style.display = 'block';
	}
}

function hideSubMenu(id, isNotFirst){
	if(isNotFirst){
		if(document.all){
			if(amenu == 0){
				document.getElementById(id).style.display = 'none';
				cmenu = '';
			}
		}
	}else{
		amenu = 0;
		setTimeout("hideSubMenu('"+id+"', 1)", 200);
	}
}

var frmLogin = "<FORM METHOD=POST ACTION=>\nUser: <INPUT TYPE=TEXT VALUE='' SIZE=6 CLASS=t> Pass: <INPUT TYPE=PASSWORD VALUE='' SIZE=6 ID=t> <INPUT TYPE=SUBMIT VALUE='login'>\n</FORM>";
var frmSignup = "<FORM METHOD=POST ACTION=>\nEmail: <INPUT TYPE=TEXT VALUE='' CLASS=t> <INPUT TYPE=SUBMIT VALUE='signup'>\n</FORM>";

function changeForm(obj, targ){
	if(targ === undefined) targ = 'Form';
	var frm = eval("frm"+obj.innerHTML);

	frm = frm.replace(/ACTION=/, 'ACTION="'+obj.href+'"');

	document.getElementById(targ).innerHTML = frm;
}
