function tafOpenDiv(a,b,c,d,evt){
//	document.getElementById('noEmaila').style.display = 'none';
//	document.getElementById('noEmailb').style.display = 'none';
	var theCampId = a;
	var theProvider = b;
	var theCamp = c;
	if (c == 'v' || c == 'e'){
		var theLabel = 'Information about <em>&quot;' +theProvider+ '&quot;</em> will be sent to your friend.<br /><br />';
	}
	else {
		var theLabel = 'Information about <em>&quot;' +theProvider+ ' ' +theCamp+ '&quot;</em> will be sent to your friend.<br /><br />';
	}
	document.getElementById('tfCampId').value=a;
	document.getElementById('tfProvider').value=b;
	document.getElementById('tfCamp').value=c;
	document.getElementById('theLabel').innerHTML = theLabel;
	var xPos = mouseX(evt) - 345;
	var yPos = mouseY(evt) - 210;
	var theDiv = document.getElementById(d);
	var theForm = document.getElementById('tfForm');
	var theResponse = document.getElementById('tfResponse');
	
	theDiv.style.top = yPos+'px';
	theDiv.style.left = xPos+'px';
	theDiv.style.display = 'block';
	theResponse.style.display = 'none';
	theForm.style.display = 'block';
}

var xhr = false;
function sendForm() {
	document.getElementById('noName').style.display = 'none';
	document.getElementById('noEmailb').style.display = 'none';
	var dtToday = new Date();
	var theDiv = document.getElementById('tellFriend');
	var theForm = document.getElementById('tfForm');
	var theResponse = document.getElementById('tfResponse');
	var theName = document.forms.tafForm.thename.value;
	if (theName == '') {
		document.getElementById('noName').style.display = 'block';
	}
	var theEmaila = document.forms.tafForm.theemail.value;
	if (theEmaila == '') {
		document.getElementById('noEmaila').style.display = 'block';
	}
	var theEmailb = document.forms.tafForm.femailb.value;
	if (theEmailb == '') {
		document.getElementById('noEmailb').style.display = 'block';
	}
	if (theName == '' || theEmaila == '' || theEmailb == '') { return;} 
	var theCampId = document.forms.tafForm.theCampId.value;
	var theProvider = document.forms.tafForm.theProvider.value;
	var theCamp = document.forms.tafForm.theCamp.value;
	var theMessage = document.forms.tafForm.fmessage.value;
	var url = 'async/tellFriend.cfm?thename='+theName+'&theEmaila='+theEmaila+'&theEmailb='+theEmailb+'&theMessage='+theMessage+'&theCampId='+theCampId+'&theProvider='+theProvider+'&theCamp='+theCamp+'&aid='+dtToday.getHours() + dtToday.getMinutes() + dtToday.getMilliseconds();
	//document.getElementById('showme').innerHTML=url;
	try{xhr=new XMLHttpRequest();}	// Firefox, Opera 8.0+, Safari  
	catch (e){	// Internet Explorer
		try{xhr=new ActiveXObject("Msxml2.XMLHTTP");}
		catch (e){	// IE 7 on Vista
			try{xhr=new ActiveXObject("Microsoft.XMLHTTP");}
			catch (e){        
				alert("Asynchronis Data Transfer unavailable, please use Internet Explorer!");        
				return false;
			}
		}
	}

	if (xhr) {
		xhr.onreadystatechange = function(){
			if (xhr.readyState == 4 || xhr.readyState == 'undefined') {
				if (xhr.status == 200){
					theForm.style.display = 'none';
					theResponse.style.display = 'block';
					theResponse.innerHTML = xhr.responseText;
					xhr.close;
				}
				else{
					xhr.innerHTML = 'Error: ' + xhr.status;
					xhr.close;
				}
			}
		};
		xhr.open("GET", url, true);
		xhr.send(null);
	}
	else {
		alert("Asynchronous Data Error!");
	}
}

