
// JS external file: erinshore.js V1.0 (4 May 2002).
// File author     : Martyn Bampton.


// Function name  : Centre  Window V2 (4 May 2002).
// Function author: Martyn Bampton.

function centreWindow(urlCentre, winNameCentre, winWidthCentre, winHeightCentre, scrollCentre, fullScreenCentre)
    {
    if (winWidthCentre == 0)
        {
        winWidthCentre = screen.availWidth - 60;
        var xPosCentre = 30;
        }
    else
        {
        var xPosCentre = (screen.availWidth - (winWidthCentre + 16))/2;
        }

    if (winHeightCentre == 0)
        {
        winHeightCentre = screen.availHeight - 60;
        var yPosCentre = 30;
        }
    else
        {
        var yPosCentre = (screen.availHeight - winHeightCentre)/2;
        } 

    if (scrollCentre == "yes")
        {
        winOptionsCentre = 'left=' + xPosCentre + ', top=' + yPosCentre + ', width=' + winWidthCentre + ', height=' + winHeightCentre + ', scrollbars, toolbar';
        }
    else if (fullScreenCentre == "yes")
        {
        winOptionsCentre = 'left=' + xPosCentre + ', top=' + yPosCentre + ', width=' + winWidthCentre + ', height=' + winHeightCentre + ', fullscreen';
        }
    else
        {
        winOptionsCentre = 'left=' + xPosCentre + ', top=' + yPosCentre + ', width=' + winWidthCentre + ', height=' + winHeightCentre + ', toolbar';
        }
    window.open(urlCentre, winNameCentre, winOptionsCentre);
    }



// 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();
        }
    }



// Function name  : Morph Window V1.5 (4 May 2002).
// Function author: Martyn Bampton.

function morphWindow(winWidthMorph, winHeightMorph)
    {
    // resize the window.
    self.resizeTo((winWidthMorph + 16), winHeightMorph);

    // Put the window in the centre of the screen.
    var xPosMorph = (screen.availWidth - (winWidthMorph + 16))/2;
    var yPosMorph = (screen.availHeight - winHeightMorph)/2;
    self.moveTo(xPosMorph, yPosMorph);

    // Make window active.
    //window.focus();
    }



// Function name  : Window Test V1.0 (5 May 2002).
// Function author: Martyn Bampton.

function windowTest(winTestWidth, winTestHeight, winTestTitleHeight)
    {
    if (min == 1)
        {
        restore(winTestWidth, winTestHeight);
        min = 0;
        }
    else
        {
        minimise(winTestWidth, winTestTitleHeight);
        min = 1;
        }
    }



// Function name  : Minimise V1.0 (4 May 2002).
// Function author: Martyn Bampton.

function minimise(winWidthMin, winHeightMin)
    {
    // Put the window in the bottom right of the screen.
    // Hint: winHeightMin should be the height of your "titlebar".
    var xPosMin = screen.availWidth - winWidthMin;
    var yPosMin = screen.availHeight - winHeightMin;
    self.moveTo(xPosMin, yPosMin);

    // Make window inactive.
    window.blur();
    }



// Function name  : Maximise V1.0 (4 May 2002).
// Function author: Martyn Bampton.

function restore(winWidthRestore, winHeightRestore)
    {
    // Put the window in the centre of the screen.
    var xPosRestore = (screen.availWidth - (winWidthRestore + 16))/2;
    var yPosRestore = (screen.availHeight - winHeightRestore)/2;
    self.moveTo(xPosRestore, yPosRestore);

    // Make window active.
    window.focus();
    }



// Set the current year as copyrightYear.
copyrightDate = new Date;
copyrightYear = copyrightDate.getFullYear();
copyrightMessage = "<DIV ALIGN=CENTER CLASS='whiteBodyText'>Copyright Martyn Bampton, 1999 to " + copyrightYear + ".</DIV>";



var form = "<FORM METHOD=POST NAME='email_form' ACTION='mailto:martyn@erinshore.com?SUBJECT=Erinshore comments.' ENCTYPE='text/plain' onSubmit='return changePage();'>"


function zoomMapIn()
    {
    genelleAreaMap.src = 'images/contact/map_genelle_street.gif';
    }
function zoomMapOut()
    {
    genelleAreaMap.src = 'images/contact/map_genelle_area.gif';
    }








// © Martyn Bampton 2002.
