var xmlHttp;

function isEmailAddr(Email) {
 	var result = false
 	var theStr = new String(Email)
	var index = theStr.indexOf("@");
	if (index > 0) {
    var pindex = theStr.indexOf(".",index);
    if ((pindex > index+1) && (theStr.length > pindex+1))
 	result = true;
  }
 return result;
}

function ajax_prep(x) {
	var str = x;
	str = str.replace(/#/gi, "%23");
	str = str.replace(/\+/gi, "%2B");
	str = str.replace(/\n/gi, "-BREAK-");
	str = escape(str);
	return str;
}

function setClassName(objId, newClass) {
	document.getElementById(objId).className = newClass;
}
function toggleVis(id) {
	if(document.getElementById(id).style.display == 'block') {document.getElementById(id).style.display = 'none';}
	else {document.getElementById(id).style.display = 'block';}
}


function GetXmlHttpObject() {
	var xmlHttp = null;
	try {xmlHttp=new XMLHttpRequest();} 
	catch (e) {
		try {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e) {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
	}
	return xmlHttp;
}

