
/* SUMMER-PLUS FORM VALIDATION, AJAX, POPULATES DIV/SPAN; ALL IN THIS PAGE  */

var xmlhttp


function GetXmlHttpObject()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {
  // code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();
  return xmlhttp;
  }
else if (window.ActiveXObject)
  {
  // code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  return xmlhttp;
  }
  
else
  {
  	alert("Your browser does not support XMLHTTP!.");
  }
  
}





function RetrieveListingDisplay1(){

	if(xmlhttp.readyState==4)
	  {
		document.getElementById('SummperPlusSearchResults2').style.border = "1px #999999 solid";
		document.getElementById('SummperPlusSearchResults2').innerHTML = xmlhttp.responseText;  // SummperPlusSearchResults1
	  }
}


function clearDivs(){

	document.getElementById('SummperPlusSearchResults1Span').style.border = "0px #000000 solid";
	document.getElementById('SummperPlusSearchResults1Span').innerHTML = '';  // SummperPlusSearchResults1
		 
	document.getElementById('SummperPlusSearchResults2').style.border = "0px #000000 solid";
	document.getElementById('SummperPlusSearchResults2').innerHTML =''; 

}



function RetrieveListing(cPK)
{  

	//document.getElementById('SummperPlusSearchResults1Span').style.border = "0px #000000 solid";
	//document.getElementById('SummperPlusSearchResults1Span').innerHTML = '';  // SummperPlusSearchResults1
		 
	document.getElementById('SummperPlusSearchResults2').style.border = "1px #999999 solid";
	//document.getElementById('SummperPlusSearchResults2').innerHTML =''; 
		 
		 
		 
    xmlhttp=GetXmlHttpObject();
    
	if (xmlhttp==null)
	{
	  alert ("Your browser does not support XMLHTTP!");
	  return;
	}

	var url="includes/functions/js/summerPlusForm2.asp?cPK="+cPK+"&sid="+Math.random();

	xmlhttp.onreadystatechange=RetrieveListingDisplay1;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);

}



	
	

function SubForm1(){


	if(xmlhttp.readyState==4)
	  {
	  	document.getElementById('SummperPlusSearchResults1Span').style.border = "1px #999999 solid";
		 document.getElementById('SummperPlusSearchResults1Span').innerHTML = xmlhttp.responseText;
	  }
}








function processForm1(frmIn){

// show/clear results pane 1; hide results pane 2
	document.getElementById('SummperPlusSearchResults1Span').innerHTML ='';
	document.getElementById('SummperPlusSearchResults1Span').style.display = "block";
	
	document.getElementById('SummperPlusSearchResults2').style.display = "none";
	document.getElementById('SummperPlusSearchResults2').innerHTML =''; 
 
 
 
 
	xmlhttp=GetXmlHttpObject();
	
	if (xmlhttp==null)
	{
	  alert ("Your browser does not support XMLHTTP!..");
	  return;
	}
	  
	var SchName = frmIn.SchName.value;
	var country = frmIn.country.value;
	var TypeSch = frmIn.TypeSch.value;
 	var ProdSch = frmIn.ProdSch.value;
 	var SvcsSch = frmIn.SvcsSch.value; 	
 	
	var url="includes/functions/js/DirectoryForm1.asp";
	url=url+"?SchName="+SchName;
	url=url+"&country="+country;
	url=url+"&TypeSch="+TypeSch;
	url=url+"&ProdSch="+ProdSch;
	url=url+"&SvcsSch="+SvcsSch;
	url=url+"&sid="+Math.random();
	
	xmlhttp.onreadystatechange=SubForm1;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	
}


function clearDIVs(){
		document.getElementById('SummperPlusSearchResults1Span').style.display = "none";
		document.getElementById('SummperPlusSearchResults2').style.display = "none";
}

function RetrieveListing(IdIn){

	document.getElementById('SummperPlusSearchResults2').style.display = "block";






	xmlhttp=GetXmlHttpObject();
	
	if (xmlhttp==null)
	{
	  alert ("Your browser does not support XMLHTTP");
	  return;
	}

	var url="includes/functions/js/DirectoryForm2.asp";
	url=url+"?IdIn="+IdIn;
	url=url+"&sid="+Math.random()+"#results4";


	xmlhttp.onreadystatechange=SubForm2;
	xmlhttp.open("GET",url,true);
	xmlhttp.send(null);
	
}



function SubForm2(){


	if(xmlhttp.readyState==4)
	  {
	  	document.getElementById('SummperPlusSearchResults2').style.border = "1px #999999 solid";
		 document.getElementById('SummperPlusSearchResults2').innerHTML = xmlhttp.responseText;
	  }
}




