var xmlHttp
function updatePage(id, pageid, typeid, content)
	{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
		{
		alert ("Your browser does not support AJAX!");
		return;
		}
		var ctime = new Date();
		var url="update_element.asp?ID="+id+"&PageID="+pageid+"&TypeID="+typeid+"&content="+encodeURIComponent(content)+"&Time="+ctime.getTime();
		xmlHttp.onreadystatechange=function()
	    {
				if (xmlHttp.readyState==4)
				{
					document.getElementById('ajax_icon_'+id).innerHTML=xmlHttp.responseText;
					setTimeout('document.getElementById("ajax_icon_"+'+id+').innerHTML = "";', 3000);
				}
				if (xmlHttp.readyState==1)
 				{
 					document.getElementById('ajax_icon_'+id).innerHTML="<img src=\"../images/ajax.gif\">";
		 		}
			}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}


function updatePageDetails(pageid, url)
	{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
		{
			alert ("Your browser does not support AJAX!");
			return;
		}
		var ctime = new Date();
		var url="update_page.asp?PageID="+pageid+"&"+url+"&Time="+ctime.getTime();
		xmlHttp.onreadystatechange=function()
	    {
				if (xmlHttp.readyState==4)
				{
					document.getElementById("ajax_page_updated").innerHTML=xmlHttp.responseText;
					setTimeout('document.getElementById("ajax_page_updated").innerHTML = "";', 3000);
				}
				if (xmlHttp.readyState==1)
 				{
 					document.getElementById("ajax_page_updated").innerHTML="<img src=\"../images/ajax.gif\">";
		 		}
			}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}

function generateParentBoxes(pageid)
	{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
		{
			alert ("Your browser does not support AJAX!");
			return;
		}
		var ctime = new Date();
		var url="update_parent_boxes.asp?PageID="+pageid+"&Time="+ctime.getTime();
		xmlHttp.onreadystatechange=function()
	    {
				if (xmlHttp.readyState==4)
				{
					document.getElementById("parent_div").innerHTML=xmlHttp.responseText;
				}
				if (xmlHttp.readyState==1)
 				{
 					document.getElementById("parent_div").innerHTML="<img src=\"../images/ajax.gif\">";
		 		}
			}
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
		}

function GetXmlHttpObject()
	{
	var xmlHttp=null;
	try
  	{
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
		}
	catch (e)
		{
		// Internet Explorer
		try
			{
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
			}
		catch (e)
			{
			xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
		}
		return xmlHttp;
	}
