Can't Make Same Ajac call from two different Onclicks?

I’m trying to call the same Ajax get PHP from two different elements Onclick. The second one isn’t working.

Index.js


function getproduct(p){
if(p==' '){
document.getElementById('f1').innerHTML=' ';
}
if (window.XMLHttpRequest)
{// code for IE7+, Firefox, Chrome, Opera, Safari
xmlhttp=new XMLHttpRequest();
}
else{// code for IE6, IE5
xmlhttp=new ActiveXObject('Microsoft.XMLHTTP');
}
xmlhttp.onreadystatechange=function()
{
if (xmlhttp.readyState==4 && xmlhttp.status==200)
{
document.getElementById('f1').innerHTML=xmlhttp.responseText;
}
}
xmlhttp.open('GET','getproduct.php?q='+p,true);
xmlhttp.send();
}//the function I'm trying to call from two different Onclicks

var products=new Array();
var sidebarli=document.getElementById('sidebar').getElementsByTagName('li');   
for(i=0;i<sidebarli.length;i++){   
if(sidebarli[i].className=='item' && sidebarli[i].parentNode.className=='prod'){ 
sidebarli[i].onclick=function(){   
EvalSound1();
var p=this.id;
alert(p+': Is sending your request.');
products.push(p);
getproduct(p);
document.getElementById('logo').className=p;
f1.className='product';
document.getElementById('blank').src='scripts/product.js';
hidewelcome();
};
}//function works

var breturn=document.getElementById('breturn');
addEvent(breturn,'click',function(){
var p=document.getElementById('productreturn').value;
alert('Getting product: '+p);
getproduct(p);
f1prompt.style.display='none';
EvalSound2();
},false);//function doesn't work????????

Any help greatly appreciated:p

Sorry, I forgot I had nested the second Ajax Call within a Function that querried the className of div id ‘f1’ which was class ‘htmlpage’ and needed to be changed to class ‘product’ before it could run the second function like so
Index.js


var breturn=document.getElementById('breturn');
addEvent(breturn,'click',function(){
f1.className='product'; //had to change div className back to appropriate class
var p=document.getElementById('productreturn').value;
alert('Getting product: '+p);
getproduct(p);
f1prompt.style.display='none';
EvalSound2();
},false);//Now works!!!

Lesson for the day, If your going to call a function more than once make sure that you haven’t set any conditions that block it???:nono: