var xmlHttp

function showRes()
{ 
xmlHttp=GetXmlHttpObject()
if (xmlHttp==null)
 {
 alert ("Browser does not support HTTP Request")
 return
 }
 
/* the following cycle through the select boxes and create strings for each box that list everything that was selected.
ex: inquiry;handsminds; 
see if you can make it into a function to save space!
*/
 
len = document.search3.profDev.length
i = 0
chosen = ""

for (i = 0; i < len; i++) {
if (document.search3.profDev[i].selected) {
chosen = chosen + document.search3.profDev[i].value + ";"
}
}
var standard = chosen



len = document.search3.sciCon.length
i = 0
chosen = ""

for (i = 0; i < len; i++) {
if (document.search3.sciCon[i].selected) {
chosen = chosen + document.search3.sciCon[i].value + ";"
}
}
var scicon = chosen





len = document.search3.btp.length
i = 0
chosen = ""

for (i = 0; i < len; i++) {
if (document.search3.btp[i].selected) {
chosen = chosen + document.search3.btp[i].value + ";"
}
}
var btp = chosen




/* old plain values (only works with one value each)
var standard = document.getElementById('standard').value;
var grade = document.getElementById('grade').value;
var scicon = document.getElementById('scicon').value;
var btp = document.getElementById('btp').value;
*/
var url="p4search.php" // create the url to send to php
url=url+"?q="+standard
url=url+"&s="+scicon
url=url+"&b="+btp
url=url+"&sid="+Math.random()
xmlHttp.onreadystatechange=stateChanged 
xmlHttp.open("GET",url,true)
xmlHttp.send(null)
}

function stateChanged() // ajax stuff
{ 
 if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete")
 { 
 document.getElementById("txtHint").innerHTML=xmlHttp.responseText 
 $('.ab1').hide();
 $('.he1').hover(function() {
  $(this).addClass('pretty-hover');
}, function() {
  $(this).removeClass('pretty-hover');
});



$('.bu').click(function() {
	$(this).find('p').toggleClass('hide1').parent().parent().toggleClass('pretty-hover2').next().find('.ab1').slideToggle('fast');
	 $('.bu p').empty().html('VIEW ABSTRACT');
	 $('.bu p.hide1').empty().html('HIDE ABSTRACT');
  }).hover(function() {
  $(this).addClass('buh');
}, function() {
  $(this).removeClass('buh');
});

 $('p[@name=but1]').toggle(function(){
   $(this).html("Click to hide all abstracts.");
 },function(){
   $(this).html("Click to show all abstracts.");
 }).click(function() {
 $('.he1').toggleClass('pretty-hover2');
 $('.ab1').slideToggle('fast');
 $('.bu p').toggleClass('hide1');
 $('.bu p').empty().html('VIEW ABSTRACT');
 $('.bu p.hide1').empty().html('HIDE ABSTRACT');
 });
 

 
  } 
}

function GetXmlHttpObject() // ajax stuff
{
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;
}