var xmlHttp
function confirmDelete()
{
    var agree=confirm("Are you sure you wish to delete this entry?");
    if (agree)
        return true;
    else
        return false;
}

function active(id,max){
for(i=1;i<=max-1;i++){
	if(i==id)
	{	
		document.getElementById("nr"+i).setAttribute("class", "active");
		document.getElementById("nr"+i).setAttribute("className", "active");
	}
	else{
		document.getElementById("nr"+i).setAttribute("class", "inactive");
		document.getElementById("nr"+i).setAttribute("className", "inactive");	
	}
	
}
}
function del(idp,categ,idpr){
document.getElementById("id-poza").innerHTML = "<a href='http://www.tuzsondesign.ro/proiecte/admin.php?cat=sterge_poza&id="+idp+"&page="+categ+"&page2="+idpr+"' onClick='return confirmDelete();'>Sterge foto</a>";
}
function showUser(str)
{
 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
var url="http://www.tuzsondesign.ro/proiecte/change-photo.php"
url=url+"?id="+str
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}
function stateChanged() 
{ 
if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
document.getElementById("poza").innerHTML=xmlHttp.responseText;
} 
}

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;
}
