var ajaxobj; 
var help_info = new Array();
var allHTMLTags = new Array();
function MoveWindow(box) {var ScrollTop = document.body.scrollTop; if (ScrollTop == 0) {if (window.pageYOffset) ScrollTop = window.pageYOffset; else ScrollTop = (document.body.parentElement) ? document.body.parentElement.scrollTop : 0;}; document.getElementById(box).style.top = (ScrollTop+15) + "px";}
function CheckEmail(e) {
	pattern = /^[a-zA-Z0-9._-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/;
	return pattern.test(e); 
}

function FadeIn(ele) {
	setOpacity(0, ele);
	document.getElementById(ele).style.display = "block";
	for (var i=0;i<11;i++) {
		t = (i * 35);
		setTimeout('setOpacity('+i+', "'+ele+'")',t);
	};
}

function setOpacity(value, ele) {
	document.getElementById(ele).style.opacity = value/10;
	document.getElementById(ele).style.filter = 'alpha(opacity=' + value*10 + ')';
}

function FadeOut(ele) {
	for (var i=0;i<11;i++) {
		t = (i * 35);
		setTimeout('setOpacity('+(10-i)+', "'+ele+'")',t);
		if (i == 10) setTimeout('document.getElementById("'+ele+'").style.display = "none"', t);
	};
}
function CheckAvi() {
	target_size = 150;
	width = document.getElementById("MainAvatar").width;
	height = document.getElementById("MainAvatar").height;
	if (width > height) { 
		percentage = (target_size / width); 
	} else { 
		percentage = (target_size / height); 
	}
	new_width = Math.round(width * percentage); 
	new_height = Math.round(height * percentage); 
	if (height < target_size && width < target_size) {
		new_width = width;
		new_height = height;
	};
	document.getElementById("MainAvatar").width = new_width;
	document.getElementById("MainAvatar").height = new_height;
}
function CheckSearchForm() {
	var len = document.getElementById("query").value;
	len = len.length;
	if (len > 3) return true;
	if (len <= 3) {
		alert("The search string you supplied was too short.");
		return false;
	};
}
function DoSearchBox(x) {val = document.getElementById("query").value; if (x == 1 && val == "Search") document.getElementById("query").value = ''; if (x == 0 && val.length == 0) document.getElementById("query").value = 'Search'; }
function SubmitAJAX(code, inputs, include) { 
	try { ajaxobj = new ActiveXObject('Msxml2.XMLHTTP'); }
	catch (e) {
		try { ajaxobj = new ActiveXObject('Microsoft.XMLHTTP'); }
		catch (e2) {
		try { ajaxobj = new XMLHttpRequest(); }
		catch (e3) { ajaxobj = false; }
	}
 }
 ajaxobj.onreadystatechange = function() { 
	if(ajaxobj.readyState == 4) {
		resp = ajaxobj.responseText;
		if (ajaxobj.status == 200) {
			code = code.substring(0,2);
			resp = resp.substring(2,resp.length);
			if (code < 80) ParsePageAJAX(code, resp); 
			if (code >= 80) ParseSiteAJAX(code, resp);
		}
	}
 }; 
	url = "http://tauonline.org/ajax_process.php?code=" + code + "&amp;include=" + include + inputs;
	ajaxobj.open("GET", url, true); 
	ajaxobj.send(null); 
} 
function ParseSiteAJAX(code, resp) {
	//this function will parse any site-wide ajax - passed by having a code that is greater then, or equal to, 80
}
function HelpPopup(id) {alert(help_info[id]);}
function FormSubmit(id) {document.getElementById(id).submit();}
function getElementByClass(theClass) {
	var collection = new Array();
	var allHTMLTags=document.getElementsByTagName("*");
	for (i=0; i<allHTMLTags.length; i++) {
		if (allHTMLTags[i].className==theClass) {
			collection[collection.length] = allHTMLTags[i];
		}
	}
	return collection;
}
function Seleall(ele) {
	ele.select();
}
//SubmitAJAX("01", "", "");