var popupObj = new ajaxObject('http://www.mindtime.com/AJAX/popup.php', updatePopup);
var contactObj = new ajaxObject('http://www.mindtime.com/AJAX/processContact.php', updatePopup);

function loadRevolutionary(word){
	//change text to "loading" or animated gif
	document.getElementById('popLearningContent').innerHTML = '<div style="width: 208px; text-align: center; margin: 100px auto 100px auto; font-size: 14px; color: #666;"><img src="http://www.mindtime.com/IMG/POPUPS/loading.gif" width="208" height="13" border="0" alt="loading" /><br />&nbsp;<br />LOADING...</div>';
	
	//show the window
	document.getElementById('popLearningMedia').style.display='block';
	
	//load the content dynamically from AJAX call
	pVars = "page="+word;
	popupObj.update(pVars, 'GET');
}

function updatePopup(responseText, responseStatus){
	
	if (responseStatus==200) {
		document.getElementById("popLearningContent").innerHTML = responseText;
	}else {
		alert(responseStatus + ' -- Error Processing Request');
	}
}

function submitContact(){
	var topic = document.getElementById('f_interest').value;
	var phone = document.getElementById('f_phone').value;
	var phone_pref = document.getElementById('f_phone_pref').value;
	var message = document.getElementById('f_message').value;
	
	pVars = "f_interest="+topic+"&f_phone="+phone+"&f_phone_pref="+phone_pref+"&f_message="+message;
	contactObj.update(pVars, 'POST');
	
	return false;
}