document.write("<scr"+"ipt type='text/javascript' src='/includes/js/AC_RunActiveContent.js' ></scr"+"ipt>");

document.write("<scr"+"ipt type='text/javascript' src='/includes/js/highslide/highslide-full.js' ></scr"+"ipt>");
document.write("<link media='all' type='text/css' rel='stylesheet' href='/includes/js/highslide/css/highslide.css'></link>");

function updateImagen(obj, noticia) {
	var imagen = $F(obj);
	new Ajax.Request(root + "php/fotogalerias.php", {
		parameters : { action:"imagen", noticia:noticia, imagen:imagen },
		onSuccess: function(t) {
			if ( t.responseText ) {
				var xml = t.responseText;
				var a = $("image-display").down("a");
				var img = $("image-display").down("img");
				var path = img.src.substr(0, img.src.lastIndexOf("/"));
				path = path.substr(0, path.lastIndexOf("/")+1);

				a.href = path + this.ParseData(xml, "dir") + "/" + this.ParseData(xml, "img");
				img.src = path + this.ParseData(xml, "dir") + "/" + this.ParseData(xml, "thu");
				img.alt = this.ParseData(xml, "txt");
				$("img-desc").update( this.ParseData(xml, "txt") );

				_nnEventTrack( window.location );
			}
		},
		onException: function(t,e) {
			alert(e.message);
		}
	});
	return false;
}
function imageAdd(select, noticia) {
	var selected = select.selectedIndex;
	if ( selected >= select.length-1 )
		select.selectedIndex = 0;
	else
		select.selectedIndex = selected + 1;

	return this.updateImagen(select, noticia);
}
function imageBack(select, noticia) {
	var selected = select.selectedIndex;
	if ( selected <= 0 )
		select.selectedIndex = select.length-1;
	else
		select.selectedIndex = selected - 1;

	return this.updateImagen(select, noticia);
}
