/**
 * @author Riccardo Canalicchio
 */
function ConfirmBox(link,msg){
	if ($('confirm') == null) 
	{
		var yesLink = document.createElement('a');
		yesLink.href = link;
		yesLink.appendChild(document.createTextNode('SI'));
		yesLink.id='yesconfirmlink';
		var noLink = document.createElement('a');
		noLink.appendChild(document.createTextNode('NO'));
		noLink.href='#';
		noLink.id='noconfirmlink';		
		noLink.onclick = removeConfirm;
		yesLink.onclick = removeConfirm;
		var my_div = document.createElement('div');
		my_div.id = 'confirm';
		my_div.onclick = removeConfirm;						
		var question = document.createElement('p');
		question.appendChild(document.createTextNode(msg));
		my_div.appendChild(question);
		my_div.appendChild(yesLink);
		my_div.appendChild(noLink);
		$('confirm_container').appendChild(my_div);
		appearConfirm();			
	}
	return false;
}
function ConfirmBox_remote(msg,func){
	if ($('confirm') == null) 
	{
		var yesLink = document.createElement('a');
		yesLink.onclick = func;
		yesLink.appendChild(document.createTextNode('SI'));
		yesLink.id='yesconfirmlink';
		var noLink = document.createElement('a');
		yesLink.href='#';
		noLink.appendChild(document.createTextNode('NO'));
		noLink.href='#';
		noLink.id='noconfirmlink';		
		noLink.onclick = removeConfirm;
		var my_div = document.createElement('div');
		my_div.id = 'confirm';
		my_div.onclick = removeConfirm;						
		var question = document.createElement('p');
		question.appendChild(document.createTextNode(msg));
		my_div.appendChild(question);
		my_div.appendChild(yesLink);
		my_div.appendChild(noLink);
		$('confirm_container').appendChild(my_div);
		appearConfirm();			
	}
	return false;
}
function appearConfirm(){
	new Effect.BlindDown('confirm_container');
}
function removeConfirm(){
	new Effect.BlindUp('confirm_container', {
		afterFinish: reallyChildConfirm
	});
}
function reallyChildConfirm(){
	$('confirm_container').removeChild($('confirm'));
}
function onEnterDO(e,func_todo)
{
var keynum;

if(window.event) // IE
  {
  keynum = e.keyCode;
  }
else if(e.which) // Netscape/Firefox/Opera
  {
  keynum = e.which;
  }
ret=true;
if (keynum==13){
	func_todo();
	ret=false
}
return ret;
}
