			
var xmlHttp;
var xmlHttpDivID;
var xmlHttpSpooler = new Array();


function AjaxFILOPop() {
	id = xmlHttpSpooler[xmlHttpSpooler.length-1];
	xmlHttpSpooler.pop();
//	alert('pop : '+id);
	return id;
}

function AjaxFILOPush(id) {
	xmlHttpSpooler.unshift(id);
//	alert('push : '+id);
}

function AjaxGetContent(div_id, what) { 	
	var url = "pages/AjaxResponder.php?c=" + what;
	AjaxFILOPush(div_id);
	xmlHttp=GetXmlHttpObject(AjaxstateChangedContent);
/*	xmlHttp=GetXmlHttpObject(
		function AjaxstateChangedContent(div_id) { 
			if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 	
				document.getElementById(xmlHttpDivID).innerHTML=xmlHttp.responseText;
			} 
		} 
	);*/
	xmlHttp.open("GET", url , true);
	xmlHttp.send(null);
} 

function AjaxstateChangedContent() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 	
		document.getElementById(AjaxFILOPop()).innerHTML=xmlHttp.responseText;
	} 
} 

// Main function
function GetXmlHttpObject(handler) { 
	var objXmlHttp=null;
	if (navigator.userAgent.indexOf("Opera")>=0) {
		alert("This example doesn't work in Opera") 
		return 
	}
	if (navigator.userAgent.indexOf("MSIE")>=0) { 
		var strName="Msxml2.XMLHTTP"
		if (navigator.appVersion.indexOf("MSIE 5.5")>=0) {
			strName="Microsoft.XMLHTTP"
		} 
		try { 
			objXmlHttp=new ActiveXObject(strName)
			objXmlHttp.onreadystatechange=handler 
			return objXmlHttp
		} 
		catch(e) { 
			alert("Error. Scripting for ActiveX might be disabled") 
			return 
		} 
	} 
	if (navigator.userAgent.indexOf("Mozilla")>=0) {
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
	}
} 



/*
function xxx1(str,icid,srch) { 
	alert('hi again');
	//var url="membersimple.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	//alert(icid);
	//xmlHttp=GetXmlHttpObject(stateChanged)
	//xmlHttp.open("GET", url , true)
	//xmlHttp.send(null)
} 

function showVideo(str) { 	
	var url="xmlHttpResponder.php?c="+str	
	xmlHttp=GetXmlHttpObject(stateChangedVideo)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedVideo() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 	
		document.getElementById("video_id").innerHTML=xmlHttp.responseText 
	} 
} 

function showComment(str,icid) { 	
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid	
	xmlHttp=GetXmlHttpObject(stateChangedComment)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedComment() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 	
		document.getElementById("commentbox").innerHTML=xmlHttp.responseText 
	} 
} 

function countIBHit(str,icid) { // Banner hit count
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid	
	thenewwindow = window.open(url , 'hitcount','location=1,status=1,scrollbars=1,menubar=1,directories=1');
	thenewwindow.focus();      
} 

function showAvatar(str,icid,srch) { 
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	//showContactTimer(); // quickly begin the load bar
	//alert(icid);
	xmlHttp=GetXmlHttpObject(stateChanged)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChanged() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("optAvatar").innerHTML=xmlHttp.responseText 
	} 
} 

// section for upload articles
function showAritle(str) { 
	var url="getparts.php?sid=" + Math.random() + "&q=" + str 	
	//showContactTimer(); // quickly begin the load bar
	//alert(icid);
	xmlHttp=GetXmlHttpObject(stateChangedAritle)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedAritle() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("ArticleUpload").innerHTML=xmlHttp.responseText 
	} 
} 

// section for upload downlods
function showDownLoads(str,icid) { 
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid 	
	//showContactTimer(); // quickly begin the load bar
	//alert(icid);
	xmlHttp=GetXmlHttpObject(stateChangedDownloads)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedDownloads() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("DownloadUpload").innerHTML=xmlHttp.responseText 
	} 
} 

// section for video length types
function showcVideo(str,icid,srch1,srch2) {  
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch1 + "&srch2=" + srch2	
	xmlHttp=GetXmlHttpObject(stateChangedcTVideo)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedcTVideo() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("Video").innerHTML=xmlHttp.responseText 
	} 
} 

// section for video length types
function Hitcount(str,icid,srch1,srch2) {  
	alert(srch1)
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch1 + "&srch2=" + srch2	
	xmlHttp=GetXmlHttpObject(stateChangedHitCount)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedHitCount() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("count").innerHTML=xmlHttp.responseText 
	} 
} 

// select banner types
function showBanner(str,icid,srch,srch2) {  
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch + "&srch2=" + srch2
	xmlHttp=GetXmlHttpObject(stateChangedBanner)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedBanner() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("Banner").innerHTML=xmlHttp.responseText 
	} 
} 

// select pages option box

function showPages(str,icid) {  
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid
	xmlHttp=GetXmlHttpObject(stateChangedPages)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedPages() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("Pages").innerHTML=xmlHttp.responseText 
	} 
} 

// section for upload answers
function showAnswers(str,icid,srch) { 
	var url="getparts.php?sid=" + Math.random() + "&q=" + str + "&iCID=" + icid + "&srch=" + srch	
	xmlHttp=GetXmlHttpObject(stateChangedAnswers)
	xmlHttp.open("GET", url , true)
	xmlHttp.send(null)
} 

function stateChangedAnswers() { 
	if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { 
		document.getElementById("Answer").innerHTML=xmlHttp.responseText 
	} 
} 


function showContactTimer () {
	var loader = document.getElementById('loadBar');
	loader.style.display = 'block';
	sentTimer = setTimeout("hideContactTimer()",1000);
}
function hideContactTimer () {
	var loader = document.getElementById('loadBar');
	loader.style.display = "none";
}

function showContactTimer1 () {
	var loader = document.getElementById('loadBar1');
	loader.style.display = 'block';
	sentTimer = setTimeout("hideContactTimer1()",1000);
}
function hideContactTimer1 () {
	var loader = document.getElementById('loadBar1');
	loader.style.display = "none";
}

*/

