function LoadRotatorImage()
{
    var containerId = "rhsRandomAdsContainer"; //the id for the container to hold the image link
    var url = "/TSControls/SideRotatorBanners/SideRotatorBanners.aspx"; //the page which processes the file request
    var candidates = new Array();

    if(bannerRandImg1.substring(1,0) == '/')
	    bannerRandImg1 = bannerRandImg1.substring(1);
    if(bannerRandImg1.length > 0 && bannerRandImg1.substring(5,0) == 'files')
	    candidates.push(bannerRandImg1);

    if(bannerRandImg2.substring(1,0) == '/')
	    bannerRandImg2 = bannerRandImg2.substring(1);
    if(bannerRandImg2.length > 0 && bannerRandImg2.substring(5,0) == 'files')
	    candidates.push(bannerRandImg2);

    if(bannerRandImg3.substring(1,0) == '/')
	    bannerRandImg3 = bannerRandImg3.substring(1);
    if(bannerRandImg3.length > 0 && bannerRandImg3.substring(5,0) == 'files')
	    candidates.push(bannerRandImg3);

    if(bannerRandImg4.substring(1,0) == '/')
	    bannerRandImg4 = bannerRandImg4.substring(1);
    if(bannerRandImg4.length > 0 && bannerRandImg4.substring(5,0) == 'files')
	    candidates.push(bannerRandImg4);

    if(bannerRandImg5.substring(1,0) == '/')
	    bannerRandImg5 = bannerRandImg5.substring(1);
    if(bannerRandImg5.length > 0 && bannerRandImg5.substring(5,0) == 'files')
	    candidates.push(bannerRandImg5);

    var randomSelectedImg;
    if(candidates.length > 0)
	    randomSelectedImg = candidates[Math.floor(Math.random()*(candidates.length))];
    else
        document.getElementById('rhsRandomAdsContainer').display = 'none';

    var httpRequest;	
    if (window.XMLHttpRequest)
	    httpRequest = new XMLHttpRequest();
    else if (window.ActiveXObject) 
	    httpRequest = new ActiveXObject("Microsoft.XMLHTTP");
    	
    if(randomSelectedImg != null && httpRequest != null)
    {
	    httpRequest.open('GET', url + "?fileId=" + randomSelectedImg, true);
	    httpRequest.send('');
	    httpRequest.onreadystatechange = function()
	    {
		    if (httpRequest.readyState == 4 && httpRequest.status == 200)
			    document.getElementById(containerId).innerHTML = httpRequest.responseText;
	    };	
    }
}
