function RunGallery(gallery)
{
	document.write('<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://fpdownload.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=7,0,0,0" width="640" height="640" id="countryFest012610a_gallery" align="middle">\n');
	document.write('<param name="allowScriptAccess" value="sameDomain" />\n');
	document.write('<param name="allowFullScreen" value="false" />\n');
	document.write('<param name="movie" value="gallery.swf?gallery='+gallery+'" />\n');
	document.write('<param name="quality" value="high" />\n');
	document.write('<param name="wmode" value="transparent" />\n');
	document.write('<embed src="gallery.swf?gallery='+gallery+'" quality="high" wmode="transparent" bgcolor="#ffffff" width="640" height="640" name="countryFest012610a_gallery" align="middle" allowScriptAccess="sameDomain" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />\n');
	document.write('</object>\n');
}
function ajaxRequester()
{
	var myRequest;
	try{
		myRequest = new ActiveXObject("Msxml2.XMLHTTP");
	}catch(e){
		try{
			myRequest = new ActiveXObject("Microsoft.XMLHTTP");
		}catch(oc){
			myRequest = null;
		}
	}
 
	if(!myRequest && typeof XMLHttpRequest != "undefined"){
		myRequest = new XMLHttpRequest();
	}
	return myRequest;
}
function emailSubmit()
{
	var fullName = document.getElementById('marketingfullName').value
	var email = document.getElementById('marketingemail').value
	
	if((fullName == 'Your Email') || (email == 'Was added successfully!') || (fullName == 'Enter Full Name') || (email == 'Enter Email Address') || (fullName == '') || (email == ''))
	{
		document.getElementById('marketingfullName').value = 'Enter Full Name'
		document.getElementById('marketingemail').value = 'Enter Email Address'
		return;
	}

	if((fullName == 'Your Email') || (email == 'Was added successfully!'))
	{
		document.getElementById('marketingfullName').value = 'Enter Full Name'
		document.getElementById('marketingemail').value = 'Enter Email Address'
		return;
	}
	
  var loadAjax = ajaxRequester();

  if( loadAjax != null)
  {
		var strQueryString = 'index.cfm/event/emailmarketingajax/fullName/' + document.getElementById('marketingfullName').value + '/email/' + document.getElementById('marketingemail').value + '/'
		loadAjax.open("GET", strQueryString, true);
		loadAjax.onreadystatechange = function (aEvt) {
			if( loadAjax.readyState == 4)
			{ //The load is complete when readyState equals 4
				if( loadAjax.status != "200" &&  loadAjax.status != undefined)
				{
					var x = loadAjax.responseText; //error
					alert(x)
				} else {
          var xmlDoc; 
          if(window.ActiveXObject)
          {
              //Internet Explorer
              xmlDoc = new ActiveXObject("Microsoft.XMLDOM");
              xmlDoc.async = false;
              xmlDoc.loadXML( loadAjax.responseText);
          }
          else if(document.implementation && document.implementation.createDocument)
          {
              //Mozilla
              xmlDoc =  loadAjax.responseXML;
          }
          document.getElementById('marketingfullName').value = 'Your Email'
					document.getElementById('marketingemail').value = 'Was added successfully!'
					alert('Your email: ' + email + '\n was submitted successfully.')
				}
			}
		}
		loadAjax.send(null);
	}
}

