var xmlHttp_index_;
function saveas_index(photoid,type)
{
	xmlHttp_index_=GetXmlHttpObject();
	if (xmlHttp_index_==null)
	{ 
		alert ("<?php echo a_browser_does_not_support_AJAX;?>"); 
		return; 
		} var url="save_index_delete.php";
		url=url+"?photoid="+photoid+"&type="+type;
		xmlHttp_index_.onreadystatechange=finds_index_stateChanged;
		xmlHttp_index_.open("GET",url,true);
		xmlHttp_index_.send(null);
		}
		function finds_index_stateChanged()
		{ 
			if (xmlHttp_index_.readyState==4)
			{ 
				var test_=xmlHttp_index_.responseText;
				var text_array=test_.split("alada123");
				document.getElementById("whole_image").innerHTML=text_array[1];
				document.getElementById("commentindex").innerHTML=text_array[2];
				var notes = new PhotoNoteContainer(document.getElementById('PhotoContainer'));
				eval(text_array[3]);
				}}
			


				var xmlHttp_index_delete;
				function deletefrom_index(photoid)
					{
					xmlHttp_index_delete=GetXmlHttpObject();
					if (xmlHttp_index_delete==null) 
					{
 alert ("<?php echo a_browser_does_not_support_AJAX;?>"); 
 return; 
 } 
 var url="delete_index_photo.php";
 url=url+"?photoid="+photoid;
 xmlHttp_index_delete.onreadystatechange=deletef_index_stateChanged;
 xmlHttp_index_delete.open("GET",url,true);
 xmlHttp_index_delete.send(null);
 }
 function deletef_index_stateChanged()
 {
	 if (xmlHttp_index_delete.readyState==4)
	 { var test_=xmlHttp_index_delete.responseText;
	 var text_array=test_.split("alada123");
	 document.getElementById("whole_image").innerHTML=text_array[1];
	 document.getElementById("menu_ajax1").innerHTML=text_array[2];
	 document.getElementById("commentindex").innerHTML=text_array[3];
	 var notes = new PhotoNoteContainer(document.getElementById('PhotoContainer'));
	 eval(text_array[4]);
	 }}
	 /////////////////


	 function GetXmlHttpObject()
	 {
		 var xmlHttp=null;
		 try  { 
			 xmlHttp=new XMLHttpRequest();  
		 }catch (e)  { 
			 try    {  
				 xmlHttp=new ActiveXObject("Msxml2.XMLHTTP"); 
				 } 
				 catch (e) 
				 { 
					 xmlHttp=new ActiveXObject("Microsoft.XMLHTTP"); 
					 } 
					 }
					 return xmlHttp;
					 }