/* initializes images in an array for pre loading */ function initialize(imgArray){ for (i=0; i < imgArray.length; i++) { var loadedImage = new Image(); loadedImage.src = imgArray[i]; } } /* Swaps images when a mouse over event occurs */ function swapImages(itemName,imageID,imageURL) { document.getElementById(imageID).src=imageURL; showText(itemName); } /*populates a 2 dimentional array and populates it from the istcs database employee table This is needed for the swapImages and initialize functions */ var Image_List = new Array('http://idahoscitech.com/images/employees/1.jpg','http://idahoscitech.com/images/employees/2.jpg','http://idahoscitech.com/images/employees/3.jpg','http://idahoscitech.com/images/employees/4.jpg','http://idahoscitech.com/images/employees/5.jpg','http://idahoscitech.com/images/employees/6.jpg','http://idahoscitech.com/images/employees/7.jpg','http://idahoscitech.com/images/employees/8.jpg','images/employees/noimg.jpg','http://idahoscitech.com/images/employees/10.jpg',''); /* executes the image initialization command */ initialize(Image_List); var employee_list = new Array(Image_List); /* Ajax function that allows the text descriptions to be pulled from the Fred's database and swapped with the images swatchtext.php called below does the actual query to the database */ var xmlHttp; function showText(str){ xmlHttp=GetXmlHttpObject(); if (xmlHttp==null) { alert ("Browser does not support HTTP Request"); return; } var url="scripts/swatchtext.php"; url=url+"?q="+str; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged; xmlHttp.open("GET",url,true); xmlHttp.send(null); }function stateChanged() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("facultydesc").innerHTML=xmlHttp.responseText; } }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; } function showContent(thisFilename,thisURL){ xmlHttp=GetXmlHttpObject(); if (xmlHttp==null){ alert ("Browser does not support HTTP Request"); return; } var url=thisURL; url=url+"?q="+thisFilename; url=url+"&sid="+Math.random(); xmlHttp.onreadystatechange=stateChanged2; xmlHttp.open("GET",url,true); xmlHttp.send(null); } function stateChanged2() { if (xmlHttp.readyState==4 || xmlHttp.readyState=="complete") { document.getElementById("show").innerHTML=xmlHttp.responseText; } }