// Script name:   Random iframe loading.
// Script author: Martyn Bampton (26th Sept 2001).


// Set up a variable to save our iframe string.
var iframe


// Set up an array to store our iframe list.
iframeArray = new Array()
iframeArray[0]="<IFRAME SRC='random/1.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[1]="<IFRAME SRC='random/2.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[2]="<IFRAME SRC='random/3.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[3]="<IFRAME SRC='random/4.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[4]="<IFRAME SRC='random/5.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[5]="<IFRAME SRC='random/6.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[6]="<IFRAME SRC='random/2.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[7]="<IFRAME SRC='random/3.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[8]="<IFRAME SRC='random/4.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"
iframeArray[9]="<IFRAME SRC='random/5.html' WIDTH=164 HEIGHT=170 BGCOLOR='#AAAAAA' FRAMEBORDER=0 SCROLLING=NO></IFRAME>"



// Get the current date and time and store in a variable, theTime.
var theTime = new Date()


// Get a random number by dividing the seconds portion of theTime
// by 10 and returning the value after the decimal point.
var num = (theTime.getSeconds()) % 10


// Use the random number to pull out a path stored in the array.
iframe = iframeArray[num]



//--------------------------------------------------



// Script name:   Random image loading.
// Script author: Martyn Bampton (26th Sept 2001).
// Second version for schools Websites.


// Set up a variable to save our iframe path.
var image2


// Set up an array to store our image list.
imageArray2 = new Array()
imageArray2[0]="<A HREF='http://www.merseygrid.co.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/merseygrid_banner.gif' WIDTH=400 HEIGHT=60 ALT='Merseygrid'></A>"
imageArray2[1]="<A HREF='http://www.ecolco.co.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/impact_banner.gif' WIDTH=400 HEIGHT=60 ALT='Impact'></A>"
imageArray2[2]="<A HREF='http://www.espresso.co.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/espresso_banner.gif' WIDTH=400 HEIGHT=60 ALT='Espresso'></A>"
imageArray2[3]="<A HREF='http://www.merseyside.org.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/merseypartnership_banner.gif' WIDTH=400 HEIGHT=60 ALT='Merseyside Partnership'></A>"
imageArray2[4]="<A HREF='http://www.treacletart.net' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/treacletart_banner.gif' WIDTH=400 HEIGHT=60 ALT='Treacle Tart'></A>"
imageArray2[5]="<A HREF='http://www.merseygrid.co.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/merseygrid_banner.gif' WIDTH=400 HEIGHT=60 ALT='Merseygrid'></A>"
imageArray2[6]="<A HREF='http://www.ecolco.co.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/impact_banner.gif' WIDTH=400 HEIGHT=60 ALT='Impact'></A>"
imageArray2[7]="<A HREF='http://www.espresso.co.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/espresso_banner.gif' WIDTH=400 HEIGHT=60 ALT='Espresso'></A>"
imageArray2[8]="<A HREF='http://www.merseyside.org.uk' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/merseypartnership_banner.gif' WIDTH=400 HEIGHT=60 ALT='Merseyside Partnership'></A>"
imageArray2[9]="<A HREF='http://www.treacletart.net' TARGET='_blank'><IMG BORDER=0 SRC='../../../images/banners/treacletart_banner.gif' WIDTH=400 HEIGHT=60 ALT='Treacle Tart'></A>"



// Get the current date and time and store in a variable, theTime.
var theTime2 = new Date()


// Get a random number by dividing the seconds portion of theTime
// by 10 and returning the value after the decimal point.
var num2 = (theTime.getSeconds()) % 10


// Use the random number to pull out a path stored in the array.
image2 = imageArray2[num2]



//--------------------------------------------------



// Function name  : Centre Maximum Sized Window V1.1 (November 2001).
// Function author: Martyn Bampton.
function centreMaxWindow(url, winName, fullscreen)
    {
    var winWidth = screen.availWidth - 60;
    var winHeight = screen.availHeight - 60;
    var xPos = 30;
    var yPos = 30;
    if (fullscreen == "yes")
        {
        winOptions = 'left=' + xPos + ', top=' + yPos + ', width=' + winWidth + ', height=' + winHeight + ', scrollbars, fullscreen';
        }
    else
        {
        winOptions = 'left=' + xPos + ', top=' + yPos + ', width=' + winWidth + ', height=' + winHeight + ', scrollbars';
        }
    window.open(url, winName, winOptions);
    }



//--------------------------------------------------



// Function name  : Centre Window V1.2 (June 2001).
// Function author: Martyn Bampton.
function centreWindow(winWidth, winHeight, url, winName, scroll)
    {
    var screenWidth = screen.availWidth;
    var screenHeight = screen.availHeight;
    var xPos = ((screenWidth - winWidth)/2) - 5;
    var yPos = (screenHeight - winHeight)/2;
    if (scroll == "yes")
        {
        winOptions = 'left=' + xPos + ', top=' + yPos + ', width=' + winWidth + ', height=' + winHeight + ', scrollbars';
        }
    else
        {
        winOptions = 'left=' + xPos + ', top=' + yPos + ', width=' + winWidth + ', height=' + winHeight;
        }
    window.open(url, winName, winOptions);
    }



//--------------------------------------------------



// Function name  : Close Parent V1.0 (Feb 2002).
// Function author: Martyn Bampton.
// This function is supposed to be used within popup windows.
function changeParent(changeParentUrl, close)
    {
    top.opener.location.href = changeParentUrl;     
    // If we are told to close the window.
    if (close == "yes")
        {
        top.close();
        }
    }