//automatic update
var msgchecker=0;
function checkmsg(){
	msgchecker++;
	idt=window.setTimeout("checkmsg();",1000);
	
	if(msgchecker==5){
		onlinecheck();
		
	}
	if(document.useridform.userid.value!=""){
	
		if(msgchecker==10){
			msgasync();
		}
	}
	if(msgchecker==15){
		msgchecker=0;
	}
}
//automatic update ends
function searchtool(){
	document.getElementById('toolbar_update').innerHTML='<img src="images/toolbar_update1.png" width="250" border="0" align="absbottom" onMouseout="searchtool1();" onClick="searchtool1();" />';	
}
function searchtool1(){
	document.getElementById('toolbar_update').innerHTML='<img src="images/toolbar_update.png" width="250" border="0" align="absbottom" usemap="#Map" />';	
}
//async begins



function defualt(){
	
		var myurl = "defualt.php";
		http.open("GET", myurl, true); 
		http.onreadystatechange = useHttpResponsedefualt;
		http.send(null);
}


function useHttpResponsedefualt(){
	if(http.readyState == 4){
		if(http.status==200){
			try{
			
			var mytextdefualt=http.responseText;
					document.getElementById('fpage').innerHTML=mytextdefualt;
			}
	catch(err4){alert(err4.description);}
		}
	}
	else{
	
		document.getElementById('fpage').innerHTML='<img src="images/bsyrnd.gif" title="Please wait while the list is retreived...." />';
	}
}

//CHECK ONLINE/OFFLINE STATUS OF LIVESTAFF
function onlinecheck(){
		var myurlOC = "onlinecheck.php";
		httplivestaff.open("GET", myurlOC, true); 
		httplivestaff.onreadystatechange = useHttpResponseoc;
		httplivestaff.send(null);
}


function useHttpResponseoc(){
	if(httplivestaff.readyState == 4){
		if(httplivestaff.status==200){
			try{
			
			var mytextoc=httplivestaff.responseText;
			var fpage=document.getElementById('extsite').innerHTML;
				if((mytextoc.indexOf('NNBF')>-1 && fpage.indexOf('NNBF')<0) ||(mytextoc.indexOf('NNBF')<0 && fpage.indexOf('NNBF')>-1) || fpage.indexOf('Please')>-1){
				document.getElementById('extsite').innerHTML=mytextoc;
				}
			}
	catch(err4){alert(err4.description);}
		}
	}
}
//ONLINE CHECK ENDS
//async ends
function showytoolbar(){
		document.getElementById("ytoolbar").innerHTML="newnigeria.biz toolbar helps you check for updates like: <br><strong>1. New topics and comment in the forum room<br>2. New market posts<br>3. New posted jobs<br>4. What is new in newnigeria.biz<br>...and many more</strong><br> The toolbar acts as a watch man that brings in all that is happening within the website to your desktop unannounced.";
	}
function hideytoolbar(){
	document.getElementById("ytoolbar").innerHTML="";
}

function unsignedchat()
{
  window.open('chat/usignedchat.html', 'uschat','toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,copyhistory=yes,width=400,height=500');
}
