<!--

// Login box and the call for the logos to start is handled here
$(document).ready(function(){
	$("#showLoginForm").click(function(){
		if ($("#loginbox_hideable").is(":hidden")){
			$("#loginbox_hideable").slideDown("slow");
			$("#member_quote").slideUp("slow");
		}
		else{
			$("#loginbox_hideable").slideUp("slow");
			$("#member_quote").slideDown("slow");
		}
	});				
	$("#loginbox_hideable").hide();
	
	runRandomImage();
});

// Call the Logos for the bottom of the page
function ajaxRequest()
{
    
    var xmlHttp;
    
    try
    {
        xmlHttp = new XMLHttpRequest();
    }
    catch(e)
    {
        var XmlHttpVersions = new Array('MSXML2.XMLHTTP.6.0',
                                        'MSXML2.XMLHTTP.5.0',
                                        'MSXML2.XMLHTTP.4.0',
                                        'MSXML2.XMLHTTP.3.0',
                                        'MSXML2.XMLHTTP',
                                        'Microsoft.XMLHTTP');
        
        for (i = 0; i < XmlHttpVersions.length && !xmlHttp; i++)
        {
            try
            {
                xmlHttp = new ActiveXObject(XmlHttpVersions[i]);
            }
            catch(e) {}
        }
    }
    
    if (!xmlHttp)
    {
        alert("Your browser may not support XML Requests");
    }
    else
    {
        return xmlHttp;
    }
}

// Get the random image
function getRandomImage()
{
    // The id of the div you want your images to be displayed in
    var imageDisplayDiv = "logosrendered";
    // The name of the file the images will come from
    var imageFile = "phpscripts/homelogos.php";
    
    // Starts a new request
    var ajax = ajaxRequest();
    
    // Gets the out put of the image file by sending nothing and just getting its finished product
    ajax.open("GET", imageFile, true);
    ajax.send(null);    
    
    // displayes a loading text so user knows the script is working
    document.getElementById(imageDisplayDiv).innerHTML = "<p>...</p>";    
    
    // Cycles through the ajax state change
    ajax.onreadystatechange = function()
    {
        // if the ajax request is ready
        if (ajax.readyState == 4)
        {
            // Checks if it really is ready by checking status number , 200 = done
            if (ajax.status == 200)
            {
            // writes the image files output to the div
            document.getElementById(imageDisplayDiv).innerHTML = ajax.responseText;
            }
        }
    }
}


function runRandomImage() {
	getRandomImage(); // Runs image function once
	setTimeout("runRandomImage()",5000);
}
-->
