
function zz(url, edit)
{
	if(edit)
		llamarasincrono("cargaritem.php?dir=" + url, "qwerty");
	else
	{
		llamarasincrono("cargar.php?dir=" + url, "qwerty");
		thumbnailviewer.init();
	}
}

function zzx(url, edit)
{
	var xmlHttp;
	xmlHttp=new XMLHttpRequest();

	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
			if (xmlHttp.status == 200)
			{
				qwerty.innerHTML = xmlHttp.responseText;
thumbnailviewer.init();
			}
	}
	if(edit)
	{
		alert("cargaritem.php?dir=" + url);
		xmlHttp.open("get","cargaritem.php?dir=" + url, false);
	}
	else
	{
		alert("cargar.php?dir=" + url);
		//xmlHttp.open("get","cargar.php?dir=" + url, false);
		xmlHttp.open("get","cargar.php?dir=" + url, false);

	}
	xmlHttp.send(null);
}

function cargarImagenesParaEditar(url)
{
/*	var xmlHttp;
	xmlHttp=new XMLHttpRequest();
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
			if (xmlHttp.status == 200)
			{
				imagenes.innerHTML = xmlHttp.responseText;
			}
	}
	xmlHttp.open("get","cargarimg.php?dir=" + url, false);

	xmlHttp.send(null);
*/
	llamarasincrono("cargarimg.php?dir=" + url, "imagenes");
}
function agregar()
{
	pepe.action=pepe.action+"&agregar=1";
	pepe.submit();
}

function borrar(url)
{
/*	var xmlHttp;
	xmlHttp=new XMLHttpRequest();
	xmlHttp.onreadystatechange=function()
	{
		if(xmlHttp.readyState==4)
			if (xmlHttp.status == 200)
			{
				//qwerty.innerHTML = xmlHttp.responseText;
				window.location="./cargardatos.php";
			}
	}
	xmlHttp.open("get","borrar.php?dir=" + url, false);
	xmlHttp.send(null);
*/
	llamarasincrono("borrar.php?dir=" + url, "imagenes");
	window.location="./cargardatos.php";
}

// xGetElementById r2, Copyright 2001-2007 Michael Foster (Cross-Browser.com)
// Part of X, a Cross-Browser Javascript Library, Distributed under the terms of the GNU LGPL

function xGetElementById(e)
{
  if(typeof(e)=='string') {
    if(document.getElementById) e=document.getElementById(e);
    else if(document.all) e=document.all[e];
    else e=null;
  }
  return e;
}


function pp(iditem, idpadre)
{
	var item=xGetElementById(iditem);
	var padre=xGetElementById(idpadre);

	if( !item || !padre)
		return;
	w(padre);
	if(item.style.display.toLowerCase() =="none")
	{
		padre.style.listStyle="url(./xmenu6_files/down_arrow_13x13.gif)";
		item.style.display="";
	}
	else
	{
		item.style.display="none";
		padre.style.listStyle="url(./xmenu6_files/right_arrow_13x13.gif)";
	}
}

function w(padre)
{		
	var n=padre.id ;
	if( padre.parentNode )
	{
		var e=padre.parentNode;
		e=e.firstChild;
		//i=0;
		//while(e && i<10)

		while(e )
		{
			if(n!=e.id )
				closeUL(e.firstChild);

			 e=e.nextSibling;
			 //i++;
		}
		w(padre.parentNode);
	}
}

function closeUL( item )
{
	while(item)
	{

		if( item.nodeName.toLowerCase() =='ul')
		{
			item.style.display="none";
			item.parentNode.style.listStyle="url(./xmenu6_files/right_arrow_13x13.gif)";
		}
		if(item.firstChild)
			closeUL(item.firstChild);
		item=item.nextSibling;
	}
}

function bourne()
{
	var e=xGetElementById("mnuPPal")
	if(e)
	{
		e.style.display="block";
		e=e.firstChild;
	
		while(e )
		{
			closeUL(e.firstChild);
			e=e.nextSibling;
		}
	}
}

function hex2asc(x)
{
	hex="0123456789ABCDEF";
	almostAscii=' !"#$%&'+"'"+'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ['+'\\'+']^_`abcdefghijklmnopqrstuvwxyz{|}';
	r="";
	hex=hex.toLowerCase();
	x=x.toLowerCase();
	for(i=0;i<x.length;i++)
	{
		let1=x.charAt(2*i);
		let2=x.charAt(2*i+1);
		val=hex.indexOf(let1)*16+hex.indexOf(let2);
		r+=almostAscii.charAt(val-32);
	};

return r;
};


function quienessomos()
{
	llamarasincrono("quienessomos.php", "qwerty");
};


