
/**************************/

var ImgSx=new Array();
var ImgDx=new Array();
var idsx=1,iddx=1;
var k=20;

function movePhoto(a){    
    var img_photo= document.getElementById(a);
    if(img_photo.style.visibility == 'hidden'){
        img_photo.style.visibility='visible';
    }
    img_photo.style.top=parseInt(img_photo.style.top)+1;
    if(parseInt(img_photo.style.top) == 700){
        img_photo.style.top=0;
        if(img_photo.id=='photo_left'){
            idsx=Math.floor(Math.random()*k);
            img_photo.src=ImgSx[idsx].src;            
            if(idsx == (ImgSx.length)){
                idsx=0;
            }
        }else{
            iddx=Math.floor(Math.random()*k);
            img_photo.src=ImgDx[iddx].src;            
            if(iddx == (ImgDx.length)){
                iddx=0;
            }
        }
    }

}
function goCicle(){
    for(var i=0;i<k;i++){
        ImgDx[i]=new Image();
        ImgDx[i].src='../img_photoscroll/photo'+(i+1)+'.JPG';
    }
    document.getElementById('photo_right').src=ImgDx[Math.floor(Math.random()*k)].src;
    setInterval("movePhoto('photo_right')",50);
}
function goInverseCicle(){
    for(var i=0;i<k;i++){
        ImgSx[i]=new Image();
        ImgSx[i].src='../img_photoscroll/photo'+(k-i)+'.JPG';
    }
    document.getElementById('photo_left').src=ImgSx[Math.floor(Math.random()*k)].src;
    setInterval("movePhoto('photo_left')",50);
}

/**************************/


function onHover(a){
    document.getElementById(a).style.border='2px #00F outset';
}

function outHover(a){
    if(a=='speleo')
        document.getElementById(a).style.border='1px #000 solid';
    else
        document.getElementById(a).style.border='0';
				 
}

function clickHover(){
    window.open('photo_gallery.htm','','left=1,top=1,width=900,height=600,resizable=1,');
}

function clickHoverMap(){
    window.open('mappa.htm','','left=1,top=1,width=900,height=600,resizable=1,');
}

function clickHoverSentiero(){
    window.open('mappa_sentiero.htm','','left=1,top=1,width=900,height=600,resizable=1,');
}


navHover = function() {
    var lis = document.getElementById("navmenu-h").getElementsByTagName("LI");
    for (var i=0; i<lis.length; i++) {
        lis[i].onmouseover=function() {
            this.className+=" iehover";
        }
        lis[i].onmouseout=function() {
            this.className=this.className.replace(new RegExp(" iehover\\b"), "");
        }
    }
}
if (window.attachEvent) window.attachEvent("onload", navHover);


