function OSNextPrev(Option)
	{
		if (Option == 'n')
			{
			if (CurElement != idsLen)
				{
				CurElement++;
				change(ids[CurElement]);
				}
			else
				{
				CurElement = 0;
				change(ids[CurElement]);
				}
			}
		if (Option == 'p')
			{
			if (CurElement != 0)
				{
				CurElement--;
				change(ids[CurElement]);
				}
			else
				{
				CurElement = idsLen;
				change(ids[CurElement]);
				}
			}
	}
function fun(id)
{
	for (i=0;i<=idsLen;i++)
	{
		
		if (ids[i]== 'id' )
			CurElement = i;
	}
	change(id);

}

function objetoAjax(){
var xmlhttp=false;
try {

xmlhttp = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
xmlhttp = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
xmlhttp = false;
}

}
if (!xmlhttp && typeof XMLHttpRequest!='undefined') {
  xmlhttp = new XMLHttpRequest();
  }
  return xmlhttp;
  }
  
function change(id){
  //donde se mostrará lo resultados

  divResultado = document.getElementById('photo_rotation');
  ajax=objetoAjax();
  

  ajax.open("GET", "photos.php?id="+id,true);
  ajax.onreadystatechange=function() {

	 
  if (ajax.readyState==4) 
  {
	divResultado.innerHTML = ajax.responseText

  }
  }
  ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");

  //enviando los valores
  ajax.send(null)
  }
  
  