
// Modify these vars to suit your needs
// Note: if you do not want others to use your uploader, you will need to hardcode these vars in your flash file, buy the source code.


var cssPath = "easyflashuploader.css"; // the page where the files will be posted
var formPostURL = "http://campingauquebec.com/upload/upload.php"; // the page where the files will be posted
var afterCompletionPage = "http://campingauquebec.com/upload/thankyou.html"; // leave empty if you dont want to redirect
var flashMovieObjectEmbedID = "MediaUpload"; // the html tag "id" for the flash <object> and <embed> tags
var flashFormID = "UploadForm"; // the form which has the flash uploader embeded
var maxUploadSize = 524288000; // maximum allowed upload size in bytes
var minUploadSize = 16384; // minimum allowed upload size bin bytes
var maxFiles = 50; // allow a maximum of 50 files to be uploaded at a time
var allowedFileTypes = '*.jpg;*.gif;*.png;*.zip;*.jpeg'; // allowed file types; add or delete extensions in the given format
var showFlashAlert = false; // will show javascript based alert by default; set true to show flash alert for validation
var showNoAlert = false; // will not show any alert if set to true



// Called by flash; modify if you want to validate html form
function efuValidateForm()
{
	// put javascript form validation code here if you want
	// this function must return true for the flash to work
	// If there is a validation issue, show js alert box and return false.
	return true;	
}

// --- DO NOT MODIFY BEYOND THIS POINT; UNLESS YOU KNOW WHAT YOU ARE DOING ---
var formValues = ""; // leave it empty
// Called by flash
function efuGetAfterCompletionPage()
{
	return afterCompletionPage;
}

// Called by flash; no modification needed
function efuGetFormPostURL()
{
	return formPostURL;
}

// Called by flash; no modification needed
function efuGetFormValues()
{
	return formValues;
}

function efuGetCssPath()
{
	return cssPath;
}

function efuGetMaxUploadSize()
{
	return maxUploadSize;
}

function efuGetMinUploadSize()
{
	return minUploadSize;
}

function efuGetAllowedFileTypes()
{
	return allowedFileTypes;
}

function efuGetShowFlashAlert()
{
	return showFlashAlert;
}

function efuGetShowNoAlert()
{
	return showNoAlert;
}

function efuGetMaxFiles()
{
	return maxFiles;
}

// called by html form; no modification needed
function efuGetFlashMovieObject(movieName)
{
  if (window.document[movieName]) 
  {
      return window.document[movieName];
  }
  if (navigator.appName.indexOf("Microsoft Internet")==-1)
  {
    if (document.embeds && document.embeds[movieName])
      return document.embeds[movieName]; 
  }
  else // if (navigator.appName.indexOf("Microsoft Internet")!=-1)
  {
    return document.getElementById(movieName);
  }
}

// called by html form; no modification needed
function efuDoSubmit()
{
	if(efuValidateForm())
	{
		formValues = '';
		var flash = efuGetFlashMovieObject(flashMovieObjectEmbedID);
		var formObj = document.getElementById(flashFormID);		
		for (var i = 0; i < formObj.elements.length; i++) 
		{
			formValues += escape(formObj.elements[i].name) + '=' + escape(formObj.elements[i].value) + ((i != (formObj.elements.length - 1)) ? '&':'');
		}
		flash.startUpload();
	}
}