// JavaScript Document// JavaScript Document
function ajax(href, resultdiv, keep, ischild, childstatus, img, waiting){
	var box = document.getElementById(resultdiv)
	var box2 = document.getElementById(childstatus)
  if(href>''){
	  var xmlHttp;
	  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==1){
				if(img==null){
					img = '../images/ajaxloader.gif';
				}
				if(waiting==null){
					waiting = '';
				}
					if(box2){
						box2.innerHTML = '<img style="margin:2px auto;" src="images/ajaxloader.gif" />';	
					}else{
						box.innerHTML = '<span><img src="'+img+'" style="margin:auto;"/>'+waiting+'</span>';
					}
				
			}
			if(xmlHttp.readyState==4){
				if(ischild==true){
					var newelement = document.createElement('div');
					newelement.innerHTML = xmlHttp.responseText;
					box.insertBefore(newelement, box.firstChild);
					if(box2){
						box2.innerHTML = '';
					}
				}else{
			  		box.innerHTML = xmlHttp.responseText;
				}
			}
		}
	    box.style.display = 'inline';
		xmlHttp.open("GET",href,true);
		xmlHttp.send(null);
	}else{	
		document.getElementById(resultdiv).style.display = 'none';
	}
	return false;
  }