var req;
function findAdds(url)
{
req = GetRequest()
	
  	if (req) {
        	req.onreadystatechange = showAdds
        	req.open("GET",url, true);
        	req.send(null);
       	}
       	
}
function showAdds(){
	if(req.readyState==0){}
	else if(req.readyState==1){}
		else if(req.readyState==2){}
			else if(req.readyState==3){}
				else if (req.readyState == 4) { // Complete
					if (req.status == 200) { // OK response
      				    document.getElementById('idAdds').innerHTML=req.responseText;
      				    
      				}
   	   			} 
}


/*returns an XMLHttpRequest object*/
function GetRequest()
{
  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;
}
//private_user_page_taburile
var tp = [];
var tpl = [];

function tpSet(i, c) {
alert("in tp"); 
 if (document.createElement) {
 	var e = document.getElementById(i);
 	var l = document.createElement('ul');
 	var p = document.createElement('div');
 	e.className = l.className = p.className = c;

	 var a, j;
 	for (j = 2; j < arguments.length; j++) {
 		c = document.getElementById(arguments[j]);
 		tp[arguments[j]] = c.parentNode.removeChild(c);

 		a = l.appendChild(document.createElement('li'));
 		a.className = c.className;
 		tpl[arguments[j]] = a = a.appendChild(document.createElement('a'));
		a.setAttribute('href', 'javascript:tpShow(\''+i+'\', \''+arguments[j]+'\');');
		a.appendChild(document.createTextNode(c.getAttribute('title')));
 	}

 	p.appendChild(tp[arguments[2]]);
 	tpl[arguments[2]].className = 'active';

	while (e.firstChild) e.removeChild(e.firstChild);
 	e.appendChild(l);
 	e.appendChild(p);
 	}
 }

 function tpShow(e, p) {
 	e = document.getElementById(e).lastChild;
 	tpl[e.replaceChild(tp[p], e.firstChild).getAttribute('id')].className = null;
 	tpl[p].className = 'active';
 }
