



var error_cnt=0;
var error_open=0;
function err_show(message)
{
	 document.getElementById("hot_errors").className = "on";
	 var err_html = "<div id='err"+error_cnt+"' class='box_error'>";
	  err_html += flash_insert("/swf/error_box","100%",1,"typeBox=ok&no="+error_cnt+"&action=err_ok&texto="+message);
	  err_html += "</div>";

	 document.getElementById("hot_errors").innerHTML += err_html;
	 error_cnt++;
	 error_open++;
	 
}
function err_ok(no)
{
	 document.getElementById("hot_errors").removeChild(document.getElementById("err"+no));
	 error_open--;
	 trace("ERR OK!");
	 if(error_open==0)
	{
		 document.getElementById("hot_errors").className = "";
	 }
}




function confirm_del(no,width)
{
	if( width == undefined) width = "100%"
	 var err_html = "<div id='err"+error_cnt+"' class='box_error'>"
	 err_html+=flash_insert("/swf/error_box",width,1,"typeBox=confirm&action=confirm_end&no="+no+"&texto=¿Quieres borrar este artículo?")
	 err_html+='<p class="box_error_buts" ><a href="javascript:confirm_end('+no+',false);"><img src="/images/bt_cancel.gif" border="0"/></a><a href="javascript:confirm_end('+no+',true);"><img src="/images/bt_ok.gif" border="0"/></a></p></div>';
	 
	 
	 
	 
	 
	 var ndiv = document.createElement("div");
	 ndiv.innerHTML = err_html;
	 var node = document.getElementById("edit"+no);
	while (node.hasChildNodes())
	{
		node.removeChild(node.firstChild);
	}
	 node.appendChild(ndiv);
 
}


function confirm_end(no,res)
{
	if(res)
	{
		document.location="/edit/del/id/"+no;
		return;
	}
 	var node = document.getElementById("edit"+no);
	if (node && node.hasChildNodes && node.removeChild) 
	{
		while (node.hasChildNodes())
		{
			node.removeChild(node.firstChild);
		}
	}


}

