function submitForm()
{
	var str=createPostString();
	var ajax = createHttpRequest();
	ajax.onreadystatechange = function()
	{	
		if(ajax.readyState == 4)
		{
			if(ajax.responseText == "good")
			{
				document.getElementsByName('dimBackgroundLayer')[0].style.display='none'; 
				document.getElementById('popup').style.display='none'; 
				showPlayer();
			}
				
			else
			{
				document.getElementById("confirm").innerHTML = ajax.responseText;
			}
		}
	}
	ajax.open("POST", "http://www.fssondemand.com/sendEmail.aspx", true);
	ajax.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8");
	if(document.theForm.name.value == "")
		alert("Please input your name.");
	else if(document.theForm.phone.value == "")
		alert("Please input your phone number.");
	else if(document.theForm.email.value == "")
		alert("Please input your email address.");
	else if(document.theForm.rEmail.value == "")
		alert("Please input the email address of the person who sent you to this site.");
	else
		ajax.send(str);
}
function createPostString()
{
        str = "?submit=yes";
        for(i=0; i < document.theForm.elements.length; i++)
        {
				if(document.theForm.elements[i].type == "radio")
				{
					if(document.theForm.elements[i].checked == true)
					{
						str += "&" + document.theForm.elements[i].name;
                		str += "=" + document.theForm.elements[i].value;
					}
				}
				else if(document.theForm.elements[i].type == "checkbox")
				{
					if(document.theForm.elements[i].checked == true)
					{
						str += "&" + document.theForm.elements[i].name;
                		str += "=" + document.theForm.elements[i].value;
					}
				}
				else
				{
					str += "&" + document.theForm.elements[i].name;
					str += "=" + document.theForm.elements[i].value;
				}
        }
        return str;
}
var ajax = false;
function createHttpRequest()
{  
  	var xmlHttp;
  	try
	{    
		// Firefox, Opera 8.0+, Safari    
		xmlHttp=new XMLHttpRequest();
		return xmlHttp;
	}
  	catch (e)
  	{
		// Internet Explorer    
		try
    	{      
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			return xmlHttp;
		}
    	catch (e)
      	{      
			try
        	{        
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
				return xmlHttp;
			}
      		catch (e)
        	{        
				alert("Your browser does not support AJAX!");        
				return false;        
			}      
		}    
	}  
}
function get_url_parse(name){name = name.replace(/[\[]/,"\\[").replace(/[\]]/,"\\]"); var regex = new RegExp("[\?&]"+name+"=([^&#]*)"); var results = regex.exec(window.location.href); return results == null ? "" : results[1];}
function showPlayer(){
	
		    var vidego_video_uuid = get_url_parse('vidego_video_uuid');
			var playerDiv = document.getElementById("videgoPlayer_o21e5m92").style;
		    playerDiv.display = "inline";
		    var so = new SWFObject("http://video.touchfon.com/templates/V0-640.swf", "live_player", "672", "535", "9", "#FFFFFF");
		    so.addVariable("ts", "1231456392");
		    so.addVariable("projectid", "31766");
		    so.addVariable("projectuuid", "o21e5m92");
		    so.addVariable("programid", vidego_video_uuid);
		    so.addVariable("programuuid", vidego_video_uuid);
		    so.addVariable("loadingdomain", "http://video.touchfon.com");
		    so.addVariable("serviceURL", "http://video.touchfon.com/services/index.php");
		    so.addVariable("doResize", "false");
		    so.addParam("allowFullScreen", "true");
		    so.addParam("allowScriptAccess", "always");
		    so.addVariable("typePlayer", "vod");
		    so.write("videgoPlayer_o21e5m92");
}