 function createUser($firstName, $lastName, $emailAddress, $postalCode, $active)
  {  var xmlHttp;
  try
    {xmlHttp=new XMLHttpRequest();}
  catch (e)
    {try
      {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch (e)
      {try
        {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
      catch (e)
        {alert("Your browser does not support AJAX!");
         return false;
        }
      }
    }
 xmlHttp.onreadystatechange=function()
  {
   if(xmlHttp.readyState==4)
     {
		document.getElementById("status").innerHTML=xmlHttp.responseText;
		if (xmlHttp.responseText.length<41)
		{
			document.getElementById("firstName").value="";
			document.getElementById("lastName").value="";
			document.getElementById("emailAddress").value="";
			document.getElementById("postalCode").value="";
		}
     }
  }
 xmlHttp.open("GET","createSubscriber.php?firstName="+$firstName+"&lastName="+$lastName+"&emailAddress="+$emailAddress+"&postalCode="+$postalCode+"&active="+$active,true);
 xmlHttp.send(null);
 }
 
  function unsubscribeUser($firstName, $lastName, $emailAddress)
  {  var xmlHttp;
  try
    {xmlHttp=new XMLHttpRequest();}
  catch (e)
    {try
      {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch (e)
      {try
        {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
      catch (e)
        {alert("Your browser does not support AJAX!");
         return false;
        }
      }
    }
 xmlHttp.onreadystatechange=function()
  {
   if(xmlHttp.readyState==4)
     {
		alert("Subscription deactivated successfully. Refresh this page for updated view.");
     }
  }
 xmlHttp.open("GET","../createSubscriber.php?firstName="+$firstName+"&lastName="+$lastName+"&emailAddress="+$emailAddress+"&active=false",true);
 xmlHttp.send(null);
 }
 
  function deleteMedia($Id, $objectType)
  {  var xmlHttp;
  try
    {xmlHttp=new XMLHttpRequest();}
  catch (e)
    {try
      {xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}
    catch (e)
      {try
        {xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
      catch (e)
        {alert("Your browser does not support AJAX!");
         return false;
        }
      }
    }
 xmlHttp.onreadystatechange=function()
  {
   if(xmlHttp.readyState==4)
     {
		alert(xmlHttp.responseText+". Refresh the page to see updated view.");
     }
  }
 if (confirm("This file or folder (including contents) will be permanently deleted. Is that OK?"))
 {
	xmlHttp.open("GET","deleteMedia.php?Id="+$Id+"&objectType="+$objectType,true);
	xmlHttp.send(null);
 }
 }
 
function OpenPopup($pollId)
{
window.open('viewCurrentPollResults.php?Id='+$pollId,'present','height=350,width=300,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
}

function OpenUploadDialog(mediaType)
{
window.open('uploadMedia.php?mediaType='+mediaType,'present','height=200,width=400,status=no,toolbar=no,menubar=no,resizable=no,scrollbars=no');
}

function closeUpload(mediaFolder, filename)
{
window.opener.ProcessMedia.mediaPath.value="http://www.adriandix.ca/uploads/"+mediaFolder+"/-"+filename; 
window.close(); 
}

function openVideo(windowTitle, videoSrc)
{ 
OpenWindow=window.open("", "newwin", "height=350,width=350,toolbar=no,scrollbars=yes,menubar=no");
OpenWindow.document.write("<HTML>")
OpenWindow.document.write("<TITLE>"+windowTitle+"</TITLE>")
OpenWindow.document.write("<BODY BGCOLOR=000000>")
OpenWindow.document.write("<EMBED SRC="+videoSrc+" AUTOSTART=true></EMBED>")
OpenWindow.document.write("</HTML>")
OpenWindow.document.close()
self.name="main"
}