//basic xmlhttp request stuff
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;
}




//ShowMenu
//used to extend search fcn functionality
//work in progress  
function ShowMenu(num, menu, max) {
  
  //starting at one, loop through until the number chosen by the user
  for(i = 1; i <= num; i++){
  
    //add number onto end of menu
    var menu2 = menu + i;

    //change visibility to block, or 'visible'
    document.getElementById(menu2).style.display = 'block';

    }

  //make a number one more than the number inputed
  var num2 = num; num2++;

  //hide menus if the viewer selects a number lower
  //this will hide every number between the selected number
  // and the maximum
  //ex. if 3 is selected, hide the <div> cells for 4, 5,
  //and 6
  //loop until max is reached
  while(num2 <= max){
    
    var menu3 = menu + num2;
    
    //hide
    document.getElementById(menu3).style.display = 'none';
    
    //add one to loop
    num2=num2+1;
    
    }
}




//old stuff Jen found...not sure if we need it...
var newwindow;

function pop(url) {
  
  newwindow=window.open(url,'poppage', 'toolbars=0, scrollbars=1, location=0, statusbars=1, menubars=0, resizable=0, width=500, height=400');
  if (window.focus) {newwindow.focus()}
  
}

function popimg(url) {

  newwindow=window.open(url,'name', 'height=500,width=650,left=100,top=100,resizable=yes,scrollbars=yes,toolbar=yes,status=yes');
	if (window.focus) {newwindow.focus()}
  
}

var wheight = 0, wwidth = 0; 

function viewimg(url, title, iwidth, iheight, colour) { 

  var pwidth, pheight; 

  if ( !newwindow || newwindow.closed ) { 
    pwidth=iwidth+30; 
    pheight=iheight+30; 
    newwindow=window.open('','htmlname','width=' + pwidth +',height=' +pheight + ',resizable=1,top=50,left=10'); 
    wheight=iheight; 
    wwidth=iwidth; 
    } 

  if (wheight!=iheight || wwidth!=iwidth ) { 
    pwidth=iwidth+30; 
    pheight=iheight+60; 
    newwindow.resizeTo(pwidth, pheight); 
    wheight=iheight; 
    wwidth=iwidth; 
    } 

  newwindow.document.clear(); 
  newwindow.focus(); 
  newwindow.document.writeln('<html> <head> <title>' + title + '<\/title> <\/head> <body bgcolor= \"' + colour + '\"> <center>'); 
  newwindow.document.writeln('<a titl="ÅÖÛØ ÇáÕæÑÉ ááÅÛáÇÞ" href="javascript:window.close();"><img src=' + url + ' border=0></a>'); 
  newwindow.document.writeln('<\/center> <\/body> <\/html>'); 
  newwindow.document.close(); 
  newwindow.focus(); 

} 

// Routines to tidy up popup windows when page is left 
// Call with an onUnload="tidy5()" in body tag 

function tidy5() { 

  if (newwindow && !newwindow.closed) { newwindow.close(); } 

}

//end old stuff 
