//PAGE FUNCTIONSfunction toggleMe(id) {	if (document.getElementById(id).style.display == "" ) {		document.getElementById(id).style.display = "none";	} else {            document.getElementById(id).style.display = "";	}}function decision(message, url){if(confirm(message)) location.href = url;}function setFocus(id){     document.getElementById(id).focus();}function myPopup(i) 	{	window.open(i, "myWindow", "location=no,menubar=no,width=880,height=220,toolbar=no")	}//AJAX FUNCTIONS//variables include "i" for instance; "element" for form field; and "content_id" for content IDvar xmlhttp;function ajaxLoad() {	var ed = tinyMCE.get(element_id);	showContent() // Do you ajax call here, window.setTimeout fakes ajax call	ed.setProgressState(1); // Show progress	window.setTimeout(function() {		ed.setProgressState(0); // Hide progress		ed.setContent(xmlhttp.responseText);	}, 5000);} function ajaxSave(i,element,content_id) {	var element_id = element+i;	var ed = tinyMCE.get(element_id);	postContent(i,element,content_id) // Do you ajax call here, window.setTimeout fakes ajax call	ed.setProgressState(1); // Show progress	window.setTimeout(function() {		ed.setProgressState(0); // Hide progress		ed.setContent(xmlhttp.responseText);	}, 5000);}function ajaxDelete(i) {	var conlon = 'content_long'+i;	var ed = tinyMCE.get(conlon);	 	deleteContent(i) // Do you ajax call here, window.setTimeout fakes ajax call	ed.setProgressState(1); // Show progress	window.setTimeout(function() {		ed.setProgressState(0); // Hide progress		ed.setContent(xmlhttp.responseText);	}, 5000);}function ajaxSaved(i) {	var conlon = 'content_long'+i;	//conlon = conlon + str;	ajaxSaver(conlon);}function ajaxSaver(i,element,content_id) {	alert('i: '+i+' e: '+element+' id: '+content_id);}//AJAX Savefunction postContent(i,element,content_id) {	xmlhttp=GetXmlHttpObject();	if (xmlhttp==null)		{		alert ("Browser does not support HTTP Request");		return;		}	var element_id = element+i;	if (element=='content_long')		{		tinyMCE.execCommand('mceRemoveControl',false,element_id);		}	var contents=escape(document.getElementById(element_id).value);	//alert("contents="+contents);	var url="ajax.php?_function=AJAX_Update";	url=url+"&content_id="+content_id;	url=url+"&"+element+"="+contents;	url=url+"&i="+i;	url=url+"&sid="+Math.random();	xmlhttp.onreadystatechange=function(){stateChanged(i,element,content_id)};	xmlhttp.open("POST",url,true);	xmlhttp.send(null);	if (element=='content_long')		{		tinyMCE.execCommand("mceAddControl",true,element_id);		}	//alert("i = "+i+" element = "+element+" content_id = "+content_id);	//alert("url = "+url);	}//AJAX Loadfunction showContent() {	xmlhttp=GetXmlHttpObject();	if (xmlhttp==null)		{	  	alert ("Browser does not support HTTP Request");	  	return;		}	var content_id=document.getElementById('content_id').value;	var content_long=document.getElementById('content_long').value;	var url="ajax.php_function=AJAX_Load";	url=url+"?content_id="+content_id;	url=url+"&content_long="+content_long;	url=url+"&sid="+Math.random();	xmlhttp.onreadystatechange=stateChanged;	xmlhttp.open("POST",url,true);	xmlhttp.send(null);	//alert("i = "+i+" element = "+element+" content_id = "+content_id);	//alert("url = "+url);	}//AJAX Deletefunction deleteContent(i) {	xmlhttp=GetXmlHttpObject();	if (xmlhttp==null)		{		alert ("Browser does not support HTTP Request");		return;		}	var conid = 'content_id'+i;	var content_id=document.getElementById(conid).value;	var url="ajax.php?_function=AJAX_Delete";	url=url+"&content_id="+content_id;	url=url+"&sid="+Math.random();	xmlhttp.onreadystatechange=function(){stateChanged(content_id)};	xmlhttp.open("POST",url,true);	xmlhttp.send(null);	//alert(conid+" = "+content_id);	}function stateChanged(i,element,content_id) {	if (xmlhttp.readyState==4)		{		//alert("i = "+i+" element = "+element+" content_id = "+content_id);		var div = element+content_id;		var form = element+i;		//alert("form: "+form+" div: "+div);		document.getElementById(div).innerHTML=xmlhttp.responseText;		document.getElementById(form).value=xmlhttp.responseText;		if(element=='title')			{			var snav = 'snav'+content_id;			document.getElementById(snav).innerHTML=xmlhttp.responseText;			}		}}//AJAX Browser Pickerfunction GetXmlHttpObject(){if (window.XMLHttpRequest)  // code for IE7+, Firefox, Chrome, Opera, Safari  {  return new XMLHttpRequest();  }if (window.ActiveXObject)  // code for IE6, IE5  {  return new ActiveXObject("Microsoft.XMLHTTP");  }return null;}//TINYMCE Functionsfunction generateTinyMCE(id) { if (!tinyMCE.get(id))   tinyMCE.execCommand('mceAddControl', false, id); else   tinyMCE.execCommand('mceRemoveControl', false, id);}