<!--
/**
* 
**/

/**
* 
**/
function MM_openBrWindow(theURL,winName,features) 
{ //v2.0
  window.open(theURL,winName,features);
}


/**
* Get the HTTP Object
**/
function getHTTPObject()
{
	if (window.ActiveXObject) 
	{
		return new ActiveXObject("Microsoft.XMLHTTP");
	}
	else if (window.XMLHttpRequest) 
	{
		return new XMLHttpRequest();
	}
	else
	{
		alert("Your browser does not support AJAX.");
		return null;
	}
}

/**
* Implement business logic
**/
function doWork()
{
	httpObject = getHTTPObject();
	
	nocache = Math.random();
	
	if (httpObject != null)
	{
		httpObject.open("GET", "subscribe.php?EMAIL="
		+document.getElementById('email').value
		+"&COUNTRY="
		+document.getElementById('country').value
		+"&PHONE="
		+document.getElementById('phone').value+'&nocache = '+nocache, true);
		httpObject.send(null);
		httpObject.onreadystatechange = setOutput;
	}
	
	document.getElementById('displayMessage').innerHTML = "<div id=\"subForm\">Please wait...</div>";
	document.getElementById('displayForm').innerHTML = "";
}

/**
* Implement business logic
**/
function doForm()
{
	httpObject = getHTTPObject();
	
	nocache = Math.random();
	
	if (httpObject != null)
	{
		httpObject.open("GET", "subscribe.php?"
		+"SETUP="
		+"true"+'&nocache = '+nocache, true);
		httpObject.send(null);
		httpObject.onreadystatechange = setOutput;
	}
	
	document.getElementById('displayMessage').innerHTML = "<div id=\"subForm\">Please wait...</div>";
	document.getElementById('displayForm').innerHTML = "";
}

/**
* Change the value of the output Textfields
**/
function setOutput()
{
	if(httpObject.readyState == 4)
	{
		eval("var response = ("+httpObject.responseText+")");
		
		document.getElementById('displayMessage').innerHTML = "<div id=\"subForm\">" + response.message + response.form + "</div>";
		document.getElementById('displayForm').innerHTML = "";
	}
}

/**
* Change the value of the output Textfield
**/
function setHumanSoup()
{
	var so = new SWFObject("screenings/media/HumanSoup.swf","flashID","640","480","9");
	so.addParam("allowScriptAccess", "always");
	so.write("flash");
}

/**
* Change the value of the output Textfield
**/
function setVideo(vid, autoplay)
{
	var so = new SWFObject("http://www.thealexanderwilsonproject.com/media/awp-video-player.swf?watch=" + vid + "&autoplay=" + autoplay,"flashID","540","360","10");
	so.addParam("quality", "high");
	so.addParam("allowScriptAccess", "always");
	so.addParam("wmode", "transparent");
	so.addParam("allowfullscreen", "true");
	so.write("videoPlayer");
}
//-->