   var http_request = false;
   function makePOSTRequest(url, parameters) {
      http_request = false;
      if (window.XMLHttpRequest) { // Mozilla, Safari,...
         http_request = new XMLHttpRequest();
         if (http_request.overrideMimeType) {
         	// set type accordingly to anticipated content type
            //http_request.overrideMimeType('text/xml');
            http_request.overrideMimeType('text/html');
         }
      } else if (window.ActiveXObject) { // IE
         try {
            http_request = new ActiveXObject("Msxml2.XMLHTTP");
         } catch (e) {
            try {
               http_request = new ActiveXObject("Microsoft.XMLHTTP");
            } catch (e) {}
         }
      }
      if (!http_request) {
         alert('Cannot create XMLHTTP instance');
         return false;
      }
      
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url, true);
      http_request.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
   }

   function alertContents() {
      if (http_request.readyState == 4) {
         if (http_request.status == 200) {
            //alert(http_request.responseText);
            result = http_request.responseText;
            document.getElementById('formcontainer').innerHTML = result;            
         } else {
            alert('There was a problem with the request.');
         }
      }
   }

   function get(obj) {
	if (document.getElementById("Email").value == '') {
	 	alert("Email is Required"); 
	} else {	
		 var poststr = "FirstName=" + encodeURI( document.getElementById("FirstName").value ) +
						"&LastName=" + encodeURI( document.getElementById("LastName").value ) +
						"&Email=" + encodeURI( document.getElementById("Email").value ) +
						"&Cell=" + encodeURI( document.getElementById("Cell").value ) +
						"&Postcode=" + encodeURI( document.getElementById("Postcode").value ) +
						"&Country=" + encodeURI( document.getElementById("Country").value ) +
						"&ThankYouSubject=" + encodeURI( document.getElementById("ThankYouSubject").value )+
						"&ThankYouBody=" + encodeURI( document.getElementById("ThankYouBody").value )+
						"&SendTo=" + encodeURI( document.getElementById("SendTo").value )+
						"&cid=" + encodeURI( document.getElementById("cid").value )+
						"&lang=" + encodeURI( document.getElementById("lang").value )+
						"&EmailFromName=" + encodeURI( document.getElementById("EmailFromName").value )+
						"&EmailFrom=" + encodeURI( document.getElementById("EmailFrom").value ); 
		  makePOSTRequest('/act/ajaxact.php', poststr);
	}
   }
   
function addNewRowForFile()
{

  var tbl = document.getElementById('myTable');
  var lastRow = tbl.rows.length;
  // if there's no header row in the table, then iteration = lastRow + 1
  var iteration = lastRow;
  var row = tbl.insertRow(lastRow);
  row.setAttribute('id', iteration);
  row.className = '';

  // cell 1
  var cell1 = row.insertCell(0);
  cell1.setAttribute('align', 'center');
  
  var num_ = iteration+1;
  cell1.innerHTML = 'Photo '+num_ +':';

  
  var cell2 = row.insertCell(1);
  var el = document.createElement('input');
  el.setAttribute('type', 'file');
  el.setAttribute('name', 'file' + iteration );
  el.setAttribute('id', 'file' + iteration);
  //el.className = 'input100proc';
  cell2.appendChild(el);


}
function stats_send(_cid)
{
  jQuery.post('/act/ajax_send_stats.php',{campaign_id: encodeURI( _cid )});
}