﻿function over_menu(id){
    document.getElementById(id).style.backgroundColor="#bbb";
    document.getElementById(id).style.borderRight="10px solid #a40130";
    document.getElementById(id).style.padding="5px 0 5px 10px";
}

function out_menu(id){
    document.getElementById(id).style.backgroundColor="";
    document.getElementById(id).style.borderRightWidth="0";
    document.getElementById(id).style.padding="5px 0 5px 20px";
}

var imgSel=0

function display_img(id){
	a=1
	while(a<=100){
		if(a==id){
			document.getElementById("cam"+a).style.display="";
			document.getElementById("minimage"+a).style.border="1px solid #a40130";	
		}else{
			if(document.getElementById("cam"+a)&&(document.getElementById("minimage"+a))){
			document.getElementById("cam"+a).style.display="none";
			document.getElementById("minimage"+a).style.border="1px solid #ccc";
			}
		}
		a++;
	}
}

function displayBorder(id){
	document.getElementById("minimage"+id).style.border="1px solid #a40130";
}

function hideBorder(id){
	if(id!=imgSel){
	document.getElementById("minimage"+id).style.border="1px solid #ccc";
	}
}

ary_foto = new Array();
ary_foto[0]="cam41";
ary_foto[1]="cam42";
ary_foto[2]="cam43";
ary_foto[3]="cam44";
ary_foto[4]="cam45";
ary_foto[5]="cam46";
ary_foto[6]="cam47";
ary_foto[7]="cam48";
ary_foto[8]="cam49";
ary_foto[9]="cam50";
ary_foto[10]="cam52";
ary_foto[11]="cam72";
ary_foto[12]="cam53";
ary_foto[13]="cam54";
ary_foto[14]="cam55";
ary_foto[15]="cam71";
ary_foto[16]="cam56";
ary_foto[17]="cam59";
ary_foto[18]="cam60";
ary_foto[19]="cam70";
ary_foto[20]="cam61";
ary_foto[21]="cam62";
ary_foto[22]="cam63";
ary_foto[23]="cam64";
ary_foto[24]="cam65";
ary_foto[25]="cam66";
ary_foto[26]="cam67";
ary_foto[27]="cam68";
ary_foto[28]="cam69";
ary_foto[29]="cam74";
ary_foto[30]="cam75";
ary_foto[31]="cam76";


var photo_index = 0;

function changeImage(var_direction){
	change_image = false;
	max_photo_index = ary_foto.length - 1;
	id_image = ary_foto[photo_index];
	img_current = document.getElementById(id_image);
	if(var_direction == 'prev'){
		if(photo_index == 0){
			new_photo_index = 0;
		}else{
			change_image = true
			new_photo_index = photo_index - 1;
			new_id_image = ary_foto[photo_index - 1]
			new_img = document.getElementById(new_id_image);
		}
	}else{
		if(photo_index == max_photo_index){
			new_photo_index = max_photo_index;
		}else{
			change_image = true
			new_photo_index = photo_index + 1;
			new_id_image = ary_foto[photo_index + 1];
			new_img = document.getElementById(new_id_image);
		}
	}
	
	if(change_image){
	photo_index = new_photo_index;
	img_current.style.display = "none";
	new_img.style.display = "";
	
	div_contatore = document.getElementById("contatore_foto");
	div_contatore.style.visibility = "visible";
	div_contatore.innerHTML = "photo: " + (photo_index + 1) + " of " + (max_photo_index + 1)
	
	}
}

function showTooltip(var_id,var_x,var_y){
	var element_tooltip = document.getElementById(var_id);
	element_tooltip.style.visibility = "visible";
	element_tooltip.style.top = var_y + "px";
	element_tooltip.style.left = var_x + "px";
}

function hideTooltip(var_id){
	var element_tooltip = document.getElementById(var_id);
	element_tooltip.style.visibility = "hidden";
}

