//  ****** IMPORTANT NOTE ******
//  You must have a full size picture named "*.jpg" and an icon of the same picture
//  named "*_icon.jpg".  Icons height = 60 pixels.
//
//  To add a new picture you must do the two next steps:
//
//  1. Increment (+1) the variable "NumberOfPicture" below;
//
//  2. Insert in the array "PictureArray" the name (without extension) of the new picture at the 
//     beginning of the list.
//
// The first picture in the array will appear in the weekly picture section.
// The second picture in the array will appear in the beginning (#1) of the archive picture section.
// The third picture = #2 in archive section, ...
// 

var CurrentPicture = 1;

var NumberOfPicture = 57;  // Increment this number when you add a new picture

PictureArray = new Array("48","59","47","46","45","58","57","56","55","54","53","52","51","50","49","44","43","42","41","40","39","38","37","36","35","34","33","32","31","30","29","28","27","26","25","24","23","22","21","20","19","18","17","16","15","14","13","12","11","10","9","8","7","6","5","4","3","2","1")  



// This function init pictures in the page
function InitPicture()
{
    document.ArchivePicture.src = "http://www3.sympatico.ca/robergee/album/" + PictureArray[CurrentPicture] + "_icon.jpg";
    document.WeeklyPicture.src = "http://www3.sympatico.ca/robergee/album/" + PictureArray[0] + "_icon.jpg";
}

// This function set the previous picture
function PreviousPicture()
{
    if(CurrentPicture != 1)  // first picture
    {
        CurrentPicture = CurrentPicture - 1;
        SetNewPicture(CurrentPicture);
    }
}

// This function set the next picture
function NextPicture()
{
    if(CurrentPicture != NumberOfPicture)  // last picture
    {
        CurrentPicture = CurrentPicture + 1;
        SetNewPicture(CurrentPicture);
    }
}

// This function set a new archive picture in the page
function SetNewPicture(pi_CurrentPicture)
{
    document.ArchivePicture.src = "http://www3.sympatico.ca/robergee/album/" + PictureArray[pi_CurrentPicture] + "_icon.jpg";
}

// This function open a new window with a specific image
function OpenNewWindow(pi_SectionId)
{
    Window2=open("","abonnement","scrollbars=yes,width=850,height=700,top=10,left=10,resizable=yes");
    Window2.document.write("<HEAD><TITLE>Patrouille de ski du Massif du Sud</TITLE>")
    Window2.document.write("<LINK REL=STYLESHEET TYPE='TEXT/CSS' HREF='fonctions/style.css'></HEAD><center>")
    if(pi_SectionId == 1)  // Weekly picture
    {
        Window2.document.write("<IMG SRC='http://www3.sympatico.ca/robergee/album/" + PictureArray[0] + ".jpg'>")
    }
    else
    {
        Window2.document.write("<IMG SRC='http://www3.sympatico.ca/robergee/album/" + PictureArray[CurrentPicture] + ".jpg'>")
    }
        Window2.document.write("<FORM><INPUT TYPE='button' class='button' VALUE='Fermer' onClick='window.close();return true;'></FORM>")
}


//  The rest of the code is to change arrows when your mouse pass over  ===================================

isamap = new Object();
isamap[0] = "_df"    // Default
isamap[1] = "_ov"    // MouseOver
isamap[2] = "_ot"    // MouseOut
isamap[3] = "_dn"    // MouseDown

function isimgact(id, act)
{
    if(document.images) 
        document.images[id].src = eval( "isimages." + id + isamap[act] + ".src");
}

if (document.images)   // ensure browser can do JavaScript rollovers.
{ 
    isimages = new Object();

    // image = ArrowLeft

    isimages.arrowleft_df = new Image();
    isimages.arrowleft_df.src = "images/arrowleft.jpg";
    isimages.arrowleft_ov = new Image();
    isimages.arrowleft_ov.src = "images/arrowleft_ov.jpg";
    isimages.arrowleft_ot = new Image();
    isimages.arrowleft_ot.src = "images/arrowleft.jpg";
    isimages.arrowleft_dn = new Image();
    isimages.arrowleft_dn.src = "images/arrowleft_ov.jpg";

    // image = ArrowRight

    isimages.arrowright_df = new Image();
    isimages.arrowright_df.src = "images/arrowright.jpg";
    isimages.arrowright_ov = new Image();
    isimages.arrowright_ov.src = "images/arrowright_ov.jpg";
    isimages.arrowright_ot = new Image();
    isimages.arrowright_ot.src = "images/arrowright.jpg";
    isimages.arrowright_dn = new Image();
    isimages.arrowright_dn.src = "images/arrowright_ov.jpg";
}

// ========================================================================================================

