/*
Embedded/Include File.  
Embedded in: default.asp
Calls this Functional File: fxAddParent.asp
Passes these Parameters: last name, password
This file will create an xml http object and pass
it the parameters to do it's functions.
*/
function GetXmlHttpObject()
{
  var xmlHttp=null;
  try
    {
    // Firefox, Opera 8.0+, Safari
    xmlHttp=new XMLHttpRequest();
    }
  catch (e)
    {
    // Internet Explorer
    try
      {
      xmlHttp=new ActiveXObject("Msxml2.XMLHTTP");
      }
    catch (e)
      {
      xmlHttp=new ActiveXObject("Microsoft.XMLHTTP");
      }
    }
  return xmlHttp;
}   
  
var element;

//This function will be called when the form is submited
function saveData(pass,lname,div) {
 element = div;
 var urlstring = "include/fxAddParent.asp?lname=" + lname + "&pwd=" + pass
 //By calling this file, we have saved the data.
 show(urlstring);
  
 return false;//Prevent the form from being submited
}  
    

//use this one for forms...
function show(url){

	xmlHttp=GetXmlHttpObject()
	
	if (xmlHttp==null){
	  alert ("Your browser does not support AJAX!");
	  return;
	} 
	url=url+"&sid="+Math.random();
	xmlHttp.onreadystatechange=stateChanged;
	xmlHttp.open("GET",url,true);
	xmlHttp.setRequestHeader('Content-Type', 'application/x-www-form-urlencoded');
	xmlHttp.send(null);
} 

function stateChanged() { 
	if (xmlHttp.readyState==4) { 
		document.getElementById(element).innerHTML=xmlHttp.responseText;
	}
}




