//Photo view 
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;
}

function photo(imageid,position,imagename,action,divid,row)
{
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
		var url="photo_view_class.php";
		url=url+"?imageid="+imageid+"&position="+position+"&imagename="+imagename;
		url=url+"&action="+action+"&divid="+divid+"&row="+row;
		url=url+"&sid="+Math.random(9999);
		xmlHttp.onreadystatechange=ph;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}

function ph()
{
	if (xmlHttp.readyState==4)
	{
		//alert(xmlHttp.responseText);
		sp=xmlHttp.responseText.split(":#:",5)
		//alert(sp[0]+"divid= "+sp[1]+"pos or= "+sp[2]+"row= "+sp[3]);
		//alert("div id="+sp[1]);
		if(sp[4]=='next')
		{
		if(sp[2]!=sp[3])
		va1=parseInt(sp[2])+1;
		document.getElementById('num'+sp[1]).innerHTML=va1+" of "+sp[3];
		}
		if(sp[4]=='back')
		{
		if(sp[2]!=1)
		va1=parseInt(sp[2])-1;
		document.getElementById('num'+sp[1]).innerHTML=va1+" of "+sp[3];	
		}
		document.getElementById('view'+sp[1]).style.display='';
		document.getElementById('view'+sp[1]).innerHTML='';
		document.getElementById('view'+sp[1]).innerHTML=sp[0];

		//document.getElementById('image'+sp[1]).style.display='none';
		//document.getElementById('img').style.display='none';
		//document.getElementById('pro_photo').style.display=none;
	}
}




function profile_view(imageid,position,imagename,action)
{
	//alert("photo");
	xmlHttp=GetXmlHttpObject();
	if (xmlHttp==null)
	{
		alert ("Your browser does not support AJAX!");
		return;
	} 
		var url="photo_view_class.php";
		url=url+"?imageid="+imageid+"&position="+position+"&imagename="+imagename;
		url=url+"&action="+action;
		url=url+"&sid="+Math.random(9999);
		//alert(url);
		xmlHttp.onreadystatechange=pro;
		xmlHttp.open("GET",url,true);
		xmlHttp.send(null);
}

function pro()
{
	if (xmlHttp.readyState==4)
	{
		//alert(xmlHttp.responseText);
		document.getElementById('view').innerHTML=xmlHttp.responseText;
		document.getElementById('view').style.display='';
		document.getElementById('image').style.display='none';
		//document.getElementById('pro_photo').style.display=none;
	}
}

function number_val_photo(va,val)
{ 
	if(va!=val)
	{
	va1=parseInt(va)+1;
	document.getElementById('num').innerHTML=va1+" of "+val;
	}
	
	
	
}
function number_val_back(va,val)
{
	//alert("sss");
	if(va!=1)
	va1=parseInt(va)-1;
	document.getElementById('num').innerHTML=va1+" of "+val;	
}
