

//-------------------------------------------------------------------------------------------
//-- Generic --------------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------
var xmlHttp1,xmlHttp2,xmlHttp3,xmlHttp4,xmlHttp5;
var ajaxreturn = null;
var ajaxerror = "Your browser does not support AJAX!";

function GetXmlHttpObject(){
	var xmlHttp=null;
	try{xmlHttp=new XMLHttpRequest();}			// Firefox, Opera 8.0+, Safari
	catch(e){
	  try{xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");}	// Internet Explorer
	  catch(e){xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");}
	}
	return xmlHttp;
}


//-------------------------------------------------------------------------------------------

function stateChanged1(){if(xmlHttp1.readyState==4){document.getElementById("veditin").innerHTML=xmlHttp1.responseText;}}
function stateChanged2(){if(xmlHttp2.readyState==4){document.getElementById("tdselectarchive").innerHTML = xmlHttp2.responseText;naviswitch('editoff');}}
function stateChanged3(){if(xmlHttp3.readyState==4){
		//document.getElementById("veditin").innerHTML=xmlHttp3.responseText;
		var arr = xmlHttp3.responseText.split("|");
		document.getElementById("veditin").innerHTML= arr[0];
		
		if(arr[1]!=""&&arr[2]!=""&&arr[3]!=""&&arr[4]!=""){
			


			document.getElementById('bubble1').style.left = (parseInt(document.getElementById('thisimage').offsetLeft) + parseInt(arr[1])) + 'px';
			document.getElementById('bubble1').style.top = (parseInt(document.getElementById('thisimage').offsetTop) + parseInt(arr[2])) + 'px';
			document.getElementById('bubble2').style.left = (parseInt(document.getElementById('thisimage').offsetLeft) + parseInt(arr[3])) + 'px';
			document.getElementById('bubble2').style.top = (parseInt(document.getElementById('thisimage').offsetTop) + parseInt(arr[4])) + 'px';

		}
		}}

function stateChanged4(){if(xmlHttp4.readyState==4){document.getElementById("veditin").innerHTML=xmlHttp4.responseText;}}
function stateChanged5(){if(xmlHttp5.readyState==4){document.getElementById("veditin").innerHTML=xmlHttp5.responseText;}}



//-------------------------------------------------------------------------------------------
//-- Source specific ------------------------------------------------------------------------
//-------------------------------------------------------------------------------------------
function ajax_admentry(str){ 

	
	xmlHttp1=GetXmlHttpObject();
	if (xmlHttp1==null){alert(ajaxerror); return;} 
	var url="adm_entry.php?"+str+"&sid="+Math.random();
	xmlHttp1.onreadystatechange=stateChanged1;
	xmlHttp1.open("GET",url,true);
	xmlHttp1.send(null);
}

//-------------------------------------------------------------------------------------------
function ajax_newentry(str){ 

	ajaxreturn = null;
	
	xmlHttp2=GetXmlHttpObject();
	if (xmlHttp2==null){alert(ajaxerror); return;} 
	var url="ajax_update.php?"+str+"&sid="+Math.random();
	xmlHttp2.onreadystatechange=stateChanged2;
	xmlHttp2.open("GET",url,true);
	xmlHttp2.send(null);
}

//-------------------------------------------------------------------------------------------
function ajax_admbubles(str){ 

	
	xmlHttp3=GetXmlHttpObject();
	if (xmlHttp3==null){alert(ajaxerror); return;} 
	var url="adm_bubbles.php?"+str+"&sid="+Math.random();
	xmlHttp3.onreadystatechange=stateChanged3;
	xmlHttp3.open("GET",url,true);
	xmlHttp3.send(null);
}

//-------------------------------------------------------------------------------------------
function ajax_gallery(str){ 

	//alert(str);
	
	xmlHttp4=GetXmlHttpObject();
	if (xmlHttp4==null){alert(ajaxerror); return;} 
	var url="adm_gallery.php?"+str+"&sid="+Math.random();
	xmlHttp4.onreadystatechange=stateChanged4;
	xmlHttp4.open("GET",url,true);
	xmlHttp4.send(null);
}

//-------------------------------------------------------------------------------------------
function ajax_layout(str){ 

	
	xmlHttp5=GetXmlHttpObject();
	if (xmlHttp5==null){alert(ajaxerror); return;} 
	var url="adm_layout.php?"+str+"&sid="+Math.random();
	xmlHttp5.onreadystatechange=stateChanged5;
	xmlHttp5.open("GET",url,true);
	xmlHttp5.send(null);
}

//-------------------------------------------------------------------------------------------
