 
<!--
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

	
	

<!-- Begin
function SelObj(formname,selname,textname,str) {
	this.formname = formname;
	this.selname = selname;
	this.textname = textname;
	this.select_str = str || '';
	this.selectArr = new Array();
	this.initialize = initialize;
	this.bldInitial = bldInitial;
	this.bldUpdate = bldUpdate;
}

function initialize() {
var counter = 0;
	if (this.select_str =='') {
		for(var i=0;i<document.forms[this.formname][this.selname].options.length;i++) {
			this.selectArr[i] = document.forms[this.formname][this.selname].options[i];
			this.select_str += document.forms[this.formname][this.selname].options[i].value+":"+
			document.forms[this.formname][this.selname].options[i].text+",";
   		}
	}else{
		var tempArr = this.select_str.split(',');
		for(var i=0;i<tempArr.length;i++) {
			var prop = tempArr[i].split(':');
			this.selectArr[i] = new Option(prop[1],prop[0]);
			if(counter == 1){
				counter = 0;
				if(i-1 > 0 || i-1 == 0){
					this.selectArr[i].className = 'bkgrndGrey';
				}
			}else{
				counter = counter +1;
			}
			
   		}
	}return;
}

function bldInitial() {
	this.initialize();
	for(var i=0;i<this.selectArr.length;i++)
		document.forms[this.formname][this.selname].options[i] = this.selectArr[i];
		document.forms[this.formname][this.selname].options.length = this.selectArr.length;
		return;
}

function bldUpdate(startSelected) {
	var str = document.forms[this.formname][this.textname].value.replace('^\\s*','');
	if(str == '') {this.bldInitial();return;}
	this.initialize();
	var j = 0;
	var counter = 0;
	pattern1 = new RegExp("^"+str,"i");
	for(var i=0;i<this.selectArr.length;i++){
		
		if(pattern1.test(this.selectArr[i].text))
			document.forms[this.formname][this.selname].options[j++] = this.selectArr[i];
			document.forms[this.formname][this.selname].options.length = j;
			if(counter == 1){
				counter = 0;
				
				if(j-1 > 0 || j-1 == 0){
					document.forms[this.formname][this.selname].options[j-1].className = 'bkgrndGrey';
				}
			}else{
				counter = counter +1;
			}
			if(j==1){
				document.forms[this.formname][this.selname].options[0].selected = true;
				
			//document.forms[this.formname][this.textname].value = document.forms[this.formname][this.selname].options[0].text;
			}
			if(j>0){
				document.forms[this.formname].addTagButton.disabled = true;
			}else{
				document.forms[this.formname].addTagButton.disabled = false;
			}
	}	 
	
}

function setUp(formName, selectName, searchField) {
	obj1 = new SelObj(formName, selectName, searchField);
	// menuform is the name of the form you use
	// itemlist is the name of the select pulldown menu you use
	// entry is the name of text box you use for typing in
	obj1.bldInitial(); 
}

function setOrig(whichElement, origItem){
	if(document.getElementById(whichElement).value == ""){
		document.getElementById(whichElement).value = origItem
		
	}
	return false
}

function addItem(whichElement,whichAppliedElement){
	var originalTags = document.getElementById(whichElement);
	var appliedTags = document.getElementById(whichAppliedElement);
	var found;
	for(j = 0; j < originalTags.options.length; j++){
			if (originalTags.options[j].selected){
					//textToAdd = document.forms[0].elements[whichElement].options[document.forms[0].elements[whichElement].selectedIndex].text
					//valueToAdd = document.forms[0].elements[whichElement].options[document.forms[0].elements[whichElement].selectedIndex].value
					textToAdd = originalTags.options[j].text
					valueToAdd = originalTags.options[j].value
					
						// for (var i=document.forms[0].elements[partnerElement].options.length-1; i>=0; i--) {
						 for ( i = 0; i < appliedTags.options.length; i++) {
							if (appliedTags.options[i].value == valueToAdd) {
						    	found = "yes" 
							}
						}			
					if (valueToAdd  == "0"){
						found = "yes"
					}
					if (found !== "yes"){
						appliedTags.options[appliedTags.options.length] = new Option(textToAdd,valueToAdd)
					}
				}
			}
} 

function removeItem(whichElement){
		//textToRemove = document.forms[0].elements[whichElement].options[document.forms[0].elements[whichElement].selectedIndex].text
		//valueToRemove = document.forms[0].elements[whichElement].options[document.forms[0].elements[whichElement].selectedIndex].value
		
		for (var i=document.forms[0].elements[whichElement].options.length-1; i>=0; i--) {
		   // if (document.forms[0].elements[whichElement].options[i].text == textToRemove && document.forms[0].elements[whichElement].options[i].value == valueToRemove) {
		  	if(document.forms[0].elements[whichElement].options[i].selected){
		    	document.forms[0].elements[whichElement].options[i] = null;
			}
		}
}

function submitForm(whichArray){
		//var formItems = new Array(whichArray);
		var showerrorMsg = 0;
		var errorMsg = "Please fill in the following fields:\r\n";
		var radioChoice = false;
		var whichArray;
		if(whichArray == "videos"){
			var formItems =  new Array("videoTitle", "videoDescription","videoAuthor");
			document.getElementById("saveTagIDs").value = "";
			for (i=0; i <= document.getElementById("matchTagID").options.length - 1;i++){
				//alert(document.getElementById("matchTagID").options[i].value);
					document.getElementById("saveTagIDs").value = document.getElementById("saveTagIDs").value+document.getElementById("matchTagID").options[i].value+",";
				}
			if(document.getElementById("videoFileOrig").value.length > 0 && document.getElementById("videoFile").value.length == 0){
				document.getElementById("videoFile").value = document.getElementById("videoFileOrig").value;
			}else{
				formItems.push("videoFile");
			}
			
		}else if(whichArray=="pages"){
		
			
			var formItems = new Array("pageName", "pageTitle");
		}else{
			var formItems = new Array("Name", "Password");
		} 
		
	 	for (var i=formItems.length-1; i>=0; --i){
		
			if(document.getElementById(formItems[i]).name=="Email"){
					if(!isValidEmail(document.getElementById(formItems[i]).value)){
						showerrorMsg = 1;
						errorMsg = errorMsg+document.getElementById(formItems[i]).name+" - (Invalid email)\r\n";
					}
			}else if(document.getElementById(formItems[i]).name=="Phone"){
					if(!isValidPhone(document.getElementById(formItems[i]).value)){
						showerrorMsg = 1;
						errorMsg = errorMsg+document.getElementById(formItems[i]).name+" - (Invalid Phone Number)\r\n";
					}
			}else{
				if(document.getElementById(formItems[i]).value == "" || document.getElementById(formItems[i]).value.length < 1){
					showerrorMsg = 1;
				 	errorMsg = errorMsg+document.getElementById(formItems[i]).name+"\r\n";
					errorMsg = errorMsg.replace("video","");
					errorMsg = errorMsg.replace("FCKeditor1","Page Body");
				}
			}	
				 	
		}
		
		if(showerrorMsg == 1){
			
			alert(errorMsg);
			return false;
		}else{
			return true;
			//return false;
		}
		return false;
	}
	
	function isValidPhone(strPhone){
		//rePhoneNumber = new RegExp(/\d{3}\-\d{3}\-\d{4}/);
		rePhoneNumber = new RegExp(/\d{3}\d{3}\d{4}/);
		 if (strPhone.length != 10 || strPhone.search(rePhoneNumber) == -1){
			return false;
		 } 
		 	return true;
	}
	function isValidEmail(strEmail){
		validRegExp = /^[^@]+@[^@]+.[a-z]{2,}$/i;
		if (strEmail.length < 1 || strEmail.search(validRegExp) == -1){
			return false;
		} 
			return true; 
	}

	function setFile(whichFile,whichInput){
		whichFile = whichFile.toString();
		parent.document.getElementById(whichInput).value = whichFile;
		 
	}
	function addMyVideos(whichVideo,lang){
		if(whichVideo !=""){
			if(lang==1){
				stringToFind = whichVideo +" <a onclick=\"javascript:removeMyVideos(\'"+whichVideo+"\',1)\">(remove)</a><br>";
			}else{
				stringToFind = whichVideo +" <a onclick=\"javascript:removeMyVideos(\'"+whichVideo+"\',2)\">(enlever)</a><br>";
			}
			
			stringToUse = document.getElementById("mySelected").innerHTML;
			stringToFind = stringToFind.toUpperCase().replace(/^\s+/, "").replace(/\s+$/, "");
			stringToUse =  stringToUse.toUpperCase().replace(/^\s+/, "").replace(/\s+$/, "");
			//alert(stringToFind+"\n\n"+stringToUse);
			if (stringToUse.indexOf(stringToFind) == -1){
				if(lang==1){
					document.getElementById("mySelected").innerHTML = document.getElementById("mySelected").innerHTML + whichVideo.toUpperCase() +" <a onclick=\"javascript:REMOVEMYVIDEOS(\'"+whichVideo.toUpperCase()+"\',1)\">(REMOVE)</a><br>";
				}else{
					document.getElementById("mySelected").innerHTML = document.getElementById("mySelected").innerHTML + whichVideo.toUpperCase() +" <a onclick=\"javascript:REMOVEMYVIDEOS(\'"+whichVideo.toUpperCase()+"\',2)\">(ENLEVER)</a><br>";
				}
				
				document.getElementById("selectedVideos").value = document.getElementById("mySelected").innerHTML;
			}
		}		
	}
	function REMOVEMYVIDEOS(whichVideo,lang){
		//alert(whichVideo);
		if(lang==1){
			stringToFind = whichVideo +" <a onclick=\"javascript:removeMyVideos(\'"+whichVideo+"\',1)\">(remove)</a><br>";
		}else{
			stringToFind = whichVideo +" <a onclick=\"javascript:removeMyVideos(\'"+whichVideo+"\',2)\">(enlever)</a><br>";
		}
		stringToFind = stringToFind.toUpperCase().replace(/^\s+/, "").replace(/\s+$/, "");
		stringToUse = document.getElementById("mySelected").innerHTML;
		stringToUse =  stringToUse.toUpperCase().replace(/^\s+/, "").replace(/\s+$/, "");
		stringToWrite = stringToUse.replace(stringToFind, "");
		document.getElementById("mySelected").innerHTML = stringToWrite;
		document.getElementById("selectedVideos").value = document.getElementById("mySelected").innerHTML;
		//alert(document.getElementById("mySelected").innerHTML);
		return false;
	}
	
function clicker(){
	var thediv=document.getElementById('displaybox');
	if(thediv.style.display == "none"){
		thediv.style.display = "";
		name = document.getElementById('name').value;
		organization = document.getElementById('organization').value;
		email = document.getElementById('email').value;
		address = document.getElementById('address').value;
		city = document.getElementById('city').value;
		province = document.getElementById('province').options[document.getElementById('province').selectedIndex].value;
		country = document.getElementById('country').options[document.getElementById('country').selectedIndex].value;
		postalCode = document.getElementById('postalCode').value;
		comments = document.getElementById('comments').value;
		screeningType = document.getElementById('screeningType').options[document.getElementById('screeningType').selectedIndex].value;
		selectedVideos = document.getElementById('selectedVideos').value;
		selectedVideos = selectedVideos.replace(/(\/?REMOVE)/g,""); 
		selectedVideos = selectedVideos.replace(/[\(\)\.\-\s,]/g, "");
		thediv.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><table width='500' height='550' bgcolor='#ffffff'><tr><td bgcolor='#FFFFFF' style='border: 1px solid #000000;' valign='top' align='left'><div align='right'><a href='#' onclick='return clicker();'><font color='#FF0000'>X CLOSE PREVIEW</font></a></div><br>Below is the formatted email that will be sent to a <strong>ED<u>MEDIA</u></u></strong><hr size='1'><br><br><strong>Name:</strong> "+name+"<br><strong>Organization:</strong> "+organization+"<br><strong>Email:</strong> "+email+"<br><strong>Address:</strong> "+address+"<br><strong>City: </strong>"+city+"<br><strong>Province:</strong> "+province+"<br><strong>Country:</strong> "+country+"<br><strong>Postal Code:</strong> "+postalCode+"<br><strong>Comments:</strong> "+comments+"<br><strong>Screening Type:</strong> "+screeningType+"<br><br><strong>Selected Videos:</strong> "+selectedVideos+"<br><br><input type='button' value='Send Email' onclick='document.sendVideos.submit();'/>&nbsp;&nbsp;&nbsp;<input type='button' value='Cancel &amp; Edit' onclick='return clicker();'/></td></tr></table></td></tr></table>"; 
	}else{
		thediv.style.display = "none";
		thediv.innerHTML = '';
	}
	return false;
}



function clickerFr(){
	var thediv=document.getElementById('displaybox');
	if(thediv.style.display == "none"){
		thediv.style.display = "";
		name = document.getElementById('name').value;
		organization = document.getElementById('organization').value;
		email = document.getElementById('email').value;
		address = document.getElementById('address').value;
		city = document.getElementById('city').value;
		province = document.getElementById('province').options[document.getElementById('province').selectedIndex].value;
		country = document.getElementById('country').options[document.getElementById('country').selectedIndex].value;
		postalCode = document.getElementById('postalCode').value;
		comments = document.getElementById('comments').value;
		screeningType = document.getElementById('screeningType').options[document.getElementById('screeningType').selectedIndex].value;
		selectedVideos = document.getElementById('selectedVideos').value;
		selectedVideos = selectedVideos.replace(/(\/?ENLEVER)/g,""); 
		selectedVideos = selectedVideos.replace(/[\(\)\.\-\s,]/g, "");
		thediv.innerHTML = "<table width='100%' height='100%'><tr><td align='center' valign='middle' width='100%' height='100%'><table width='500' height='550' bgcolor='#ffffff'><tr><td bgcolor='#FFFFFF' style='border: 1px solid #000000;' valign='top' align='left'><div align='right'><a href='#' onclick='return clicker();'><font color='#FF0000'>X Fermez l'Aper&ccedil;u</font></a></div><br>Ci-dessous se trouve la formule d'application qui sera envoy&eacute;e par courriel &agrave; <strong>ED<u>M&Eacute;DIA</u></u></strong><hr size='1'><br><br><strong>Nom:</strong> "+name+"<br><strong>Organisme:</strong> "+organization+"<br><strong>Courriel:</strong> "+email+"<br><strong>Adresse:</strong> "+address+"<br><strong>Ville: </strong>"+city+"<br><strong>Province/&Eacute;tat:</strong> "+province+"<br><strong>Pays:</strong> "+country+"<br><strong>Code Postal:</strong> "+postalCode+"<br><strong>Comments:</strong> "+comments+"<br><strong>Mode de Visionnement:</strong> "+screeningType+"<br><br><strong>S&eacute;lection de Vid&eacute;os:</strong> "+selectedVideos+"<br><br><input type='button' value='Envoyer ce Courriel' onclick='document.sendVideos.submit();'/>&nbsp;&nbsp;&nbsp;<input type='button' value='Annuler &amp; Amender' onclick='return clicker();'/></td></tr></table></td></tr></table>"; 
	}else{
		thediv.style.display = "none";
		thediv.innerHTML = '';
	}
	return false;
}

//-->
 