function jb(){
  var A=null;
  try{
    A=new ActiveXObject("Msxml2.XMLHTTP")
  }catch(e){
    try{
      A=new ActiveXObject("Microsoft.XMLHTTP")
    } catch(oc){
      A=null
    }
  }
  if(!A&&typeof XMLHttpRequest!="undefined"){
    A=new XMLHttpRequest()
  }
  return A
}

function WatchListAdd(itemlotid)
{
	k=jb();
	if(k){
		k.open("GET","http://www.naalive.com/xmlhttp/watchlistadd.aspx?lotid="+itemlotid,true);
		k.onreadystatechange=function() {
			if(k.readyState==4) {
				result = k.responseText;
				while (result.substring(0,1) == ' ')
					result = result.substring(1,result.length);
				if(result == "success")
				{
					if(document.layers)
					{
						document.layers['txtWatchList'].value='This lot has been added to your WatchList';
						document.layers['btnClose'].src='graphics/btnclose.gif';
						document.layers['btnWatchListAdd'].visibility='hide';
						CtrlItem1_hlAddToWatchList.visibility='hide';
					}
					else if(document.all)
					{
						document.all['txtWatchList'].value='This lot has been added to your WatchList';
						document.all['btnClose'].src='graphics/btnclose.gif';
						document.all['btnWatchListAdd'].style.visibility='hidden';
						CtrlItem1_hlAddToWatchList.style.visibility='hidden';
					}
					else if(document.getElementById)
					{
						document.getElementById('txtWatchList').value='This lot has been added to your WatchList';
						document.getElementById('btnClose').src='graphics/btnclose.gif';
						document.getElementById('btnWatchListAdd').style.visibility='hidden';
						CtrlItem1_hlAddToWatchList.style.visibility='hidden';
					}
				}
			}
		}
		;
		k.send(null)
	//window.open('watchlistadd.aspx?lotid='+itemlotid,'_watchlist','toolbars=0,menubar=0,scrollbars=0,width=400,height=300');
	}
}
function WatchListOpen()
{
	if(document.layers)
	{
		document.layers['watchlistadded'].visibility = 'show';
	}
	else if(document.all)
	{
		document.all['watchlistadded'].style.visibility = 'visible';
	}
	else if(document.getElementById)
	{
		document.getElementById('watchlistadded').style.visibility = 'visible';
	}
}
function WatchListClose()
{
	if(document.layers)
	{
		document.layers['watchlistadded'].visibility = 'hide';
	}
	else if(document.all)
	{
		document.all['watchlistadded'].style.visibility = 'hidden';
	}
	else if(document.getElementById)
	{
		document.getElementById('watchlistadded').style.visibility = 'hidden';
	}
}

