// JavaScript Document
function ajaxFunction(opti,pageno) {
	var xmlHttp, xmlResp, fromurl;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			xmlResp = xmlHttp.responseText
			//xmlResp = xmlResp.replace(/</,"&lt;");
			//xmlResp = xmlResp.replace(/>/,"&gt;");
			//alert(xmlResp);
			if (opti==1) {
				document.getElementById("attachedlist").innerHTML=xmlResp;
			}
			if (opti==2) {
				document.getElementById("pagelist").innerHTML=xmlResp;
			}
		}
	}
	fromurl = "/admin0805/pages/jmCatStruct_attach.asp?opt=" + opti + "&pg=" + pageno;
	xmlHttp.open("GET",fromurl,true);
	xmlHttp.send(null);
}

//Search Results Paging
function getResults(opti,pageno) {
	var xmlHttp, xmlResp, fromurl;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			xmlResp = xmlHttp.responseText
			//xmlResp = xmlResp.replace(/</,"&lt;");
			//xmlResp = xmlResp.replace(/>/,"&gt;");
			//alert(xmlResp);
			if (opti==1) {
				document.getElementById("sea_attachedlist").innerHTML=xmlResp;
			}
			if (opti==2) {
				document.getElementById("sea_pagelist").innerHTML=xmlResp;
			}
		}
	}
	fromurl = "/pages/pgaug07/include/aj_search.asp?opt=" + opti + "&pg=" + pageno;
	xmlHttp.open("GET",fromurl,true);
	xmlHttp.send(null);
}

// Article Paging
function getArticles(opti,pageno) {
	var xmlHttp, xmlResp, fromurl;
	try {
		// Firefox, Opera 8.0+, Safari
		xmlHttp=new XMLHttpRequest();
	}
	catch (e) {
		// Internet Explorer
		try {
			xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
		}
		catch (e) {
			try {
				xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
			}
			catch (e) {
				alert("Your browser does not support AJAX!");
				return false;
			}
		}
	}
	xmlHttp.onreadystatechange=function() {
		if(xmlHttp.readyState==4) {
			xmlResp = xmlHttp.responseText
			//xmlResp = xmlResp.replace(/</,"&lt;");
			//xmlResp = xmlResp.replace(/>/,"&gt;");
			//alert(xmlResp);
			if (opti==1) {
				document.getElementById("art_attachedlist").innerHTML=xmlResp;
			}
			if (opti==2) {
				document.getElementById("art_pagelist").innerHTML=xmlResp;
			}
		}
	}
	fromurl = "/pages/pgaug07/include/aj_articleList.asp?opt=" + opti + "&pg=" + pageno;
	xmlHttp.open("GET",fromurl,true);
	xmlHttp.send(null);
}
