﻿// Function to navigate and display
// team members using an AJAX page which
// returns all the results...
// Create an array of the items that
// we want to swap in and out...
var myArray = new Array(5);
myArray[0] = 401;
myArray[1] = 402;
myArray[2] = 403;
myArray[3] = 404;
myArray[4] = 405;
// Global array position
var i = 1;

function fSplashAnimated(i)
{
   //  $("#LinkFlyOutPanel").slideToggle();
    
    // Set the complete path to pass to the AJAX file
	var r = parseInt(Math.random() * 999999);
	var strFullURL = strBridgingPath + "ajax/ajax_SplashAnimated.aspx?i=" + myArray[i] + "&r=" + r;
	// Make our AJAX call
	var httpXML;
	try {
		// Firefox, Opera 8.0+, Safari
		httpXML = new XMLHttpRequest();
	} catch(e) {
		// Internet Explorer
		try{
			httpXML= new ActiveXObject("Msxml2.XMLHTTP");
		} catch(e) {
			try{
				httpXML = new ActiveXObject("Microsoft.XMLHTTP");
			}catch(e){
				// We've run out of options so return false
				return false;
			}
		}
	}
	httpXML.onreadystatechange=function(){
		if (httpXML.readyState == 4) {
			if (httpXML.status == 200) {
				var textDoc = httpXML.responseText;				
				if (textDoc == "") {
					// Return true
					document.getElementById('LinkFlyOutPanel').innerHTML = httpXML.responseText;
					
				} else {
					// Write out the returned results
					document.getElementById('LinkFlyOutPanel').innerHTML = httpXML.responseText;
					
				}
			} else {
				// Write out an error
				// $("#LinkFlyOutPanel").slideDown();
				document.getElementById('LinkFlyOutPanel').innerHTML = 'Cannot find the content that you were looking for. Sorry!';
			}
		} else {
			// 
		}
	}
	httpXML.open('GET', strFullURL, true);
	httpXML.send(null);
}