
function confirmar_url(url,texto)
{
	if (confirm (texto)) {self.location=url;}
}

function url_self()
{
	var text;
	
	text=location.href;
	var array_text=text.split("?");
    return array_text[0];
}

function openZoom(url,w,h)
{
var w = 800;
var h = 800;
  var str="height="+h+",width="+w+", toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=no, copyhistory=no";
  window.open(url,"_blank",str);
}


function desplegables(id, nivel1, nivel2, nivel3, nivel4, nivel5) {
	
	if (id != 'null') location.href="index.php?opcion=33&id_cat="+id+"&nivel1="+nivel1+"&nivel2="+nivel2+"&nivel3="+nivel3+"&nivel4="+nivel4+"&nivel5="+nivel5;
}

function renombrar_galeria(id, galeria, nombre) {
	getAjax('modules/fotografos/gal_fotos_ajax.php', 'opcion=cname&galeria='+galeria+'&nombre='+nombre, id, 'load_'+id);
}

function renombrar_cat_grid(id, cat, nombre) {
	getAjax('modules/grid/grid_ajax.php', 'opcion=cname&cat='+cat+'&nombre='+nombre, id, 'load_'+id);
}

function cambiar_comentario_foto(id, foto, comentario) {
	getAjax('modules/fotografos/gal_fotos_ajax.php', 'opcion=ccom&id='+foto+'&comentario='+comentario, id, 'load_'+id);
}

function borrar_foto(id, foto, galeria, nodo) {
	if(confirm('Seguro que quieres borrar esta foto ?')) getAjax('modules/fotografos/gal_fotos_ajax.php', 'opcion=cdel&id='+foto+'&galeria='+galeria+'&nodo='+nodo, id, 'load_'+id);
}

function leerCookie(nombre) {
   a = document.cookie.substring(document.cookie.indexOf(nombre + '=') + nombre.length + 1,document.cookie.length);
   if(a.indexOf(';') != -1)a = a.substring(0,a.indexOf(';'))
   return a; 
}
