var nlAllFetch=function(mylistId,obj){
	var T=arguments.callee;
	if(document.getElementById('nlFetchText').textContent!='▲残'){
		T.Pop(mylistId,obj);
	}else{
		T.Hide();
	}
}
nlAllFetch.HttpRequest=function(url,func,Async){
	var httpObj=new XMLHttpRequest(),R='';
	httpObj.abort();
	httpObj.open('GET',url,!!Async);
	httpObj.setRequestHeader('If-Modified-Since','Thu, 01 Jun 1970 00:00:00 GMT');
	httpObj.onload=function(){if(typeof func=='function')R=func(httpObj)}
	httpObj.send(null);
	return R;
}
nlAllFetch.Pop=function(mylistId,obj){
	var T=this,d=document;
	var pfs=d.getElementById('pop_fetch_status'),
		nlFC=d.getElementById('nlFetchCount'),
		load_status=function(){
			T.HttpRequest('/cache/fetch?status=all',function(r){
				var rText=r.responseText,
					Rsplit=rText.split(/\r\n/),
					fetchingList={},
					A=[],
					id=value='';
				for(var i=Rsplit.length;i--;){
					var RSsplit=Rsplit[i].split(': '),
						id   =RSsplit[0],
						value=RSsplit[1];
					fetchingList[id]=value;
				}
				for(var id in obj){
					if(value=fetchingList[id]){
						A.push('<div><a href="watch/'+id+'" onMouseOver="return popThumb(\'thumb/'+id+'\', 0)" onMouseOut="return nd()">'+id+'</a> : '+value+'</div>');
					}else{
						delete obj[id];
						--nlFC.textContent;
					}
				}
				if(nlFC.textContent){
					pfs.innerHTML=A.join('');
					T.timeoutID=setTimeout(load_status,1000);
				}else{
					T.AllFetchHide();
				}
			},true)
		};
	T.HttpRequest('/cache/fetch?mylist='+mylistId);
	delete obj['dummy'];
	load_status();
	d.getElementById('nlFetchText').textContent='▲残';
	d.getElementById('pop_fetch_status').setAttribute('style','display:block;');
}
nlAllFetch.Hide=function(){
	var T=this,d=document;
	clearTimeout(T.timeoutID);
	d.getElementById('nlFetchText').textContent='▼残';
	d.getElementById('pop_fetch_status').setAttribute('style','display:none;');
}
