function UpdatePage(dest,pageCall, reload){
	var xmlHttp;
	var destination = '';
	
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
	  try {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {
	    try {
	      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e) {
	      alert("Your browser does not support AJAX!");
	    }
	  }
	}
	
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			
			//alert(xmlHttp.responseText);
			
			if(reload != '' && reload != undefined){
				if(xmlHttp.responseText.indexOf('Please upgrade to gold or platinum.') >= 0){
					if (dest == 'SendMessageContent'){
						document.getElementById(destination).innerHTML = '<br><a href="/register/IMU_Pre_Upgrade_1.html">To send a message you need to be a gold or platinum member.</a><br><br>';
					} else {
						document.getElementById(destination).innerHTML = '<br><a href="/register/IMU_Pre_Upgrade_1.html">To send a message you need to be a gold or platinum member.</a><br><br><div style="background-color:#E9E8E6;">&nbsp;</div>';
					}
				} else {
					UpdatePage(dest,reload)
				}
			} else {
				document.getElementById(destination).innerHTML =  xmlHttp.responseText;
			}
			//document.myForm.time.value=xmlHttp.responseText;
			//alert(xmlHttp.responseText);
		}
	}
	destination=dest;
	//alert(dest);
	if (dest == 'SendMessageContent'){
		document.getElementById(destination).innerHTML = '<br><img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_left.gif"> Processing... <img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_right.gif"><br><br>';
	}else{
		document.getElementById(destination).innerHTML = '<br><img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_left.gif"> Processing... <img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_right.gif"><br><br><div style="background-color:#E9E8E6;">&nbsp;</div>';
	}
	xmlHttp.open("GET",pageCall,true);
	xmlHttp.send(null);
}


function UpdatePage_post(dest,pageCall, params, reload){
	var xmlHttp;
	var destination = '';
	
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
	  try {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {
	    try {
	      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e) {
	      alert("Your browser does not support AJAX!");
	    }
	  }
	}
	
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			
			//alert(xmlHttp.responseText);
			if(reload != '' && reload != undefined){
				if(xmlHttp.responseText.indexOf('Please upgrade to gold or platinum.') >= 0){
					if (dest == 'SendMessageContent'){
						document.getElementById(destination).innerHTML = '<br><a href="/register/IMU_Pre_Upgrade_1.html">To send a message you need to be a gold or platinum member.</a><br><br>';
					} else {
						document.getElementById(destination).innerHTML = '<br><a href="/register/IMU_Pre_Upgrade_1.html">To send a message you need to be a gold or platinum member.</a><br><br><div style="background-color:#E9E8E6;">&nbsp;</div>';
					}
				} else {
					UpdatePage(dest,reload)
				}
			} else {
				document.getElementById(destination).innerHTML =  xmlHttp.responseText;
			}
			//document.myForm.time.value=xmlHttp.responseText;
			//alert(xmlHttp.responseText);
		}
	}
	destination=dest;
	//alert(dest);
	if (dest == 'SendMessageContent'){
		document.getElementById(destination).innerHTML = '<br><img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_left.gif"> Processing... <img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_right.gif"><br><br>';
	}else{
		document.getElementById(destination).innerHTML = '<br><img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_left.gif"> Processing... <img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_right.gif"><br><br><div style="background-color:#E9E8E6;">&nbsp;</div>';
	}
	/*xmlHttp.open("POST",pageCall,true);
	
	xmlHttp.send(null);*/
	xmlHttp.open("POST",pageCall,true);

	// Set our POST header correctly…
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");
	// Send the parms data…
	xmlHttp.send(params);
}

function PostComplaint(){
	/*alert(name);
	alert(id);*/
	
	var ComplainerID = document.ComplaintForm.ComplainerID.value;
	var OffenderID = document.ComplaintForm.OffenderID.value;
	var OffenceTypeID = document.ComplaintForm.OffenceTypeID.value;
	var Title = document.ComplaintForm.Title.value;
	var AboutMe = document.ComplaintForm.AboutMe.value;
	var Partner = document.ComplaintForm.Partner.value;

	var xmlHttp;
	var params = "formsubmit=" + encodeURI(1) + "&forAjax=" + encodeURI(1) + "&ComplainerID=" + encodeURI(ComplainerID) + "&OffenderID=" + encodeURI(OffenderID) + "&OffenceTypeID=" + encodeURI(OffenceTypeID) + "&Title=" + encodeURI(Title) + "&AboutMe=" + encodeURI(AboutMe) + "&Partner=" + encodeURI(Partner) + '&date=' + encodeURI(Date())
		
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
	  try {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {
	    try {
	      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e) {
	      alert("Your browser does not support AJAX!");
	    }
	  }
	}
	
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			document.getElementById('ComplainProfile').innerHTML = xmlHttp.responseText;
			//document.myForm.time.value=xmlHttp.responseText;
			//alert(xmlHttp.responseText);
			
			
		}
	}

	document.getElementById('ComplainProfile').innerHTML = '<br><img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_left.gif"> Processing... <img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_right.gif"><br><br><div style="background-color:#E9E8E6;">&nbsp;</div>';

	xmlHttp.open("POST",'/include/complaint_process.html',true);

	// Set our POST header correctly…
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	// Send the parms data…
	xmlHttp.send(params);
	
}


function Message_Go_ajax(params, mybutton){
	var xmlHttpMsgGo;
		
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttpMsgGo=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
	  try {
	    xmlHttpMsgGo=new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {
	    try {
	      xmlHttpMsgGo=new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e) {
	      alert("Your browser does not support AJAX!");
	    }
	  }
	}
	
	xmlHttpMsgGo.onreadystatechange=function(){
		if(xmlHttpMsgGo.readyState==4){
			
			var response = xmlHttpMsgGo.responseText;
			var LinkTo = '';
			var LinkText = '';
			if (response.substring(0,14) == 'messages_saved'){
				LinkTo = '/mail/ajax/saved_ajax.html';
				LinkText = 'Saved Messages';
				response = response.substring(14,response.length)
			/*} else if (response.substring(0,17) == 'messages_archived'){
				LinkTo = '/mail/view_system.html';
				LinkText = 'Archived Messages';
				response = response.substring(17,response.length)*/
			} else if (response.substring(0,13) == 'messages_sent'){
				LinkTo = '/mail/ajax/sent_ajax.html';
				LinkText = 'Sent Messages';
				response = response.substring(13,response.length)
			} else if (response.substring(0,8) == 'messages'){
				LinkTo = '/mail/ajax/inbox_ajax.html';
				LinkText = 'Messages';
				response = response.substring(8,response.length)
			} else if (response.substring(0,5) == 'flirt'){
				LinkTo = '/mail/ajax/flirt_ajax.html';
				LinkText = 'Flirt';
				response = response.substring(5,response.length)
			} else if (response.substring(0,3) == 'sys'){
				LinkTo = '/mail/ajax/system_ajax.html';
				LinkText = 'System Messages';
				response = response.substring(3,response.length)
			}
			if(LinkTo != ''){
				LinkTo = LinkTo + '?date=' + Date();
				UpdatePage('ContentWindow',LinkTo);
			} else {
				document.getElementById('ContentWindow').innerHTML = response;
			}
			
			
			//document.myForm.time.value=xmlHttpMsgGo.responseText;
			//alert(xmlHttpMsgGo.responseText);
		}
	}
	document.getElementById('ContentWindow').innerHTML = '<br><img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_left.gif"> Processing... <img src="http://images.imatchup.com/images/NEWIMU/Interstitials/lights_right.gif"><br><br><div style="background-color:#E9E8E6;">&nbsp;</div>';

	xmlHttpMsgGo.open("POST",'/listener/message_go_ajax.html',true);

	// Set our POST header correctly…
	xmlHttpMsgGo.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttpMsgGo.setRequestHeader("Content-length", params.length);
	xmlHttpMsgGo.setRequestHeader("Connection", "close");
	// Send the parms data…
	xmlHttpMsgGo.send(params);
}


/* Back up the function
function Message_Go_ajax(params, mybutton){

	var xmlHttp;
		
	try
	{
	  // Firefox, Opera 8.0+, Safari
	  xmlHttp=new XMLHttpRequest();
	}
	catch (e)
	{
	  // Internet Explorer
	  try {
	    xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
	  } catch (e) {
	    try {
	      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
	    } catch (e) {
	      alert("Your browser does not support AJAX!");
	    }
	  }
	}
	
	xmlHttp.onreadystatechange=function(){
		if(xmlHttp.readyState==4){
			var response = xmlHttp.responseText;
			var LinkTo = '';
			var LinkText = '';
			if (response.substring(0,14) == 'messages_saved'){
				LinkTo = '/mail/inbox.html?ShowMail=saved';
				LinkText = 'Saved Messages';
				response = response.substring(14,response.length)
			} else if (response.substring(0,17) == 'messages_archived'){
				LinkTo = '/mail/inbox.html?ShowMail=system';
				LinkText = 'Archived Messages';
				response = response.substring(17,response.length)
			} else if (response.substring(0,13) == 'messages_sent'){
				LinkTo = '/mail/inbox.html?ShowMail=sent';
				LinkText = 'Sent Messages';
				response = response.substring(13,response.length)
			} else if (response.substring(0,8) == 'messages'){
				LinkTo = '/mail/inbox.html';
				LinkText = 'Messages';
				response = response.substring(8,response.length)
			} else if (response.substring(0,5) == 'flirt'){
				LinkTo = '/mail/inbox.html?ShowMail=flirt';
				LinkText = 'Flirt';
				response = response.substring(5,response.length)
			} else if (response.substring(0,3) == 'sys'){
				LinkTo = '/mail/inbox.html?ShowMail=system';
				LinkText = 'System Messages';
				response = response.substring(3,response.length)
			}
			if(LinkTo != ''){
				if (mybutton == 1){
					response = response + '<br><br><br><br><br>You will be redirected to your <a href="' + LinkTo + '"> ' + LinkText + '</a>.'
				} else {
					response = response + '<br><br><br><br><br><a href="' + LinkTo + '">Back to your ' + LinkText + '.</a>'
				}
			}
			
			document.getElementById('FeedBackContent').innerHTML = response;
			
			if (mybutton == 1){
				var temp = "window.location='" + LinkTo + "'";
				setTimeout(temp, 3000);
			}
			//document.myForm.time.value=xmlHttp.responseText;
			//alert(xmlHttp.responseText);
		}
	}
	document.getElementById('FeedBackContent').innerHTML = 'Processing';

	xmlHttp.open("POST",'/listener/message_go_ajax.html',true);

	// Set our POST header correctly…
	xmlHttp.setRequestHeader("Content-type", "application/x-www-form-urlencoded");
	xmlHttp.setRequestHeader("Content-length", params.length);
	xmlHttp.setRequestHeader("Connection", "close");

	// Send the parms data…
	xmlHttp.send(params);
} */