
//  Arrows images loading

var imageList = new Array();
var imageCount = 0;

function loadImage(name, imageOut, imageOn) {
    if (document.images) {
        imageList[imageCount] = new Array(3);
        imageList[imageCount][0] = name;
        imageList[imageCount][1] = new Image();
        imageList[imageCount][1].src = imageOut;
        imageList[imageCount][2] = new Image();
        imageList[imageCount][2].src = imageOn;
        imageCount++;
    }
}


// Gallery and main image images loading

var imageListGall = new Array();
var imageCountGall = 0;

function loadImageGall(name, imageOut, imageOn, imageBig) {
    if (document.images) {
        imageListGall[imageCountGall] = new Array(4);
        imageListGall[imageCountGall][0] = name;
        imageListGall[imageCountGall][1] = new Image();
        imageListGall[imageCountGall][1].src = imageOut;
        imageListGall[imageCountGall][2] = new Image();
        imageListGall[imageCountGall][2].src = imageOn;
        imageListGall[imageCountGall][3] = new Image();
        imageListGall[imageCountGall][3].src = imageBig;
        imageCountGall++;
    }
}


//  Main images loading

//var imageListMain = new Array();
//var imageCountMain = 0;

//function loadImageMain(name, imageMain) {
//    if (document.images) {
//        imageListMain[imageCount] = new Array(2);
//        imageListMain[imageCount][0] = name;
//        imageListMain[imageCount][1] = new Image();
//        imageListMain[imageCount][1].src = imageMain;
//        imageCountMain++;
//    }
//}




// Arrows rollover

function imgOn(name) {
    if (document.images) {
        for (var i=0; i < imageList.length; i++) {
            if (imageList[i][0] == name) {
                document.images[name].src = imageList[i][2].src;
                break;
            }
        }
    }
}

function imgOff(name) {
    if (document.images) {
        for (var i=0; i < imageList.length; i++) {
            if (imageList[i][0] == name) {
                document.images[name].src = imageList[i][1].src;
                break;
            }
        }
    }
}




// Gallery images rollover

function imgOnGall(name) {
    if (document.images) {
        for (var i=0; i < imageListGall.length; i++) {
            if (imageListGall[i][0] == name) {
                document.images[name].src = imageListGall[i][2].src;
                break;
            }
        }
    }
}

function imgOffGall(name) {
    if (document.images) {
        for (var i=0; i < imageListGall.length; i++) {
            if (imageListGall[i][0] == name) {
                document.images[name].src = imageListGall[i][1].src;
                break;
            }
        }
    }
}

// calling nav images

loadImage("arrowup", "img/arrowup_off.gif", "img/arrowup_on.gif");
loadImage("arrowdown", "img/arrowdown_off.gif", "img/arrowdown_on.gif");
loadImage("arrowleft", "img/arrowleft_off.gif", "img/arrowleft_on.gif");
loadImage("arrowright", "img/arrowright_off.gif", "img/arrowright_on.gif");
loadImage("arrowright", "img/arrowright_off.gif", "img/arrowright_on.gif");
loadImage("arrowbarup", "img/arrowbarup_off.gif", "img/arrowbarup_on.gif");
loadImage("arrowbardown", "img/arrowbardown_off.gif", "img/arrowbardown_on.gif");
loadImage("arrowbarup_grey", "img/arrowbarup_grey_off.gif", "img/arrowbarup_grey_on.gif");
loadImage("arrowbardown_grey", "img/arrowbardown_grey_off.gif", "img/arrowbardown_grey_on.gif");
loadImage("zoom", "img/zoom_off.gif", "img/zoom_on.gif");



// The images of the different section will be called by the relative files



// Main image window pop up

function openWindon(){

//var toBeSplitted = window.mainImage.src;

//window.open()
//etc ...

}






// scrolling
// specify speed of scroll (greater=faster)
var speed=4

iens6=document.all||document.getElementById
ns4=document.layers

function movedown(){
if (window.moveupvar) clearTimeout(moveupvar)
if (iens6&&parseInt(crossobj.style.top)>=(contentheight*(-1)+100))
crossobj.style.top=parseInt(crossobj.style.top)-speed
else if (ns4&&crossobj.top>=(contentheight*(-1)+100))
crossobj.top-=speed
movedownvar=setTimeout("movedown()",100)
}

function moveup(){
if (window.movedownvar) clearTimeout(movedownvar)
if (iens6&&parseInt(crossobj.style.top)<=0)
crossobj.style.top=parseInt(crossobj.style.top)+speed
else if (ns4&&crossobj.top<=0)
crossobj.top+=speed
moveupvar=setTimeout("moveup()",100)
}

function stopscroll(){
if (window.moveupvar) clearTimeout(moveupvar)
if (window.movedownvar) clearTimeout(movedownvar)
}

function movetop(){
stopscroll()
if (iens6)
crossobj.style.top=0
else if (ns4)
crossobj.top=0
}

function getcontent_height(){
if (iens6)
contentheight=crossobj.offsetHeight
else if (ns4)
document.nscontainer.document.nscontent.visibility="show"
}

