// JavaScript Document
function showallpg()
{
if (xmllHttp.readyState==4 || xmllHttp.readyState=="complete")
{
var s =xmllHttp.responseText;
s = s.replace(/\s/g, ' ');
s = s.replace(new RegExp('^.*?<body[^>]*>(.*?)</body>.*?$', 'i'), '$1');
switch(towindow)
{
case 1:
window.parent.document.getElementById(content_to_div).innerHTML = s;
break;
default :
document.getElementById(content_to_div).innerHTML = s;
break;
}
WaitOff();
}
}

var xmlHttp

 function WaitOn() {
	document.body.style.cursor="wait";
}

 function WaitOff() {
	document.body.style.cursor="auto";
}

function GetXmlHttpObject(handler) { 
	var objXmlHttp=null

	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 
		} 
	} 
	else {
		objXmlHttp=new XMLHttpRequest()
		objXmlHttp.onload=handler
		objXmlHttp.onerror=handler 
		return objXmlHttp
	}
}

	
	
var xmllHttp;
var content_to_div;
var towindow=1;
function ajaxclik(url,div_to,to_window)
{
		WaitOn();
		content_to_div=div_to;	
		if(to_window)
		  towindow=to_window;
		else
		  towindow=1;
		xmllHttp=GetXmlHttpObject(showallpg)
		xmllHttp.open("GET", url , true)
		xmllHttp.send(null)
}
