// Test del Browser:
agent = navigator.userAgent
browser = 0

if (agent.indexOf("a/3",1) == 6 || agent.indexOf("a/4",1) == 6) {browser = 1} else {browser = 0}


/*
// Cache delle immagini:
if (browser == 1) {

//Carica Immagini

//Normale
ball_n = new Image(10,10);
ball_n.src = "../../images/ball_n.gif";

//Over
ball_h = new Image(10,10);
ball_h.src = "../../images/ball_h.gif";

//Click
ball_s = new Image(10,10);
ball_s.src = "../../images/ball_n.gif";

}
*/

aImages="undefined";

//Carica Immagini
//Precarica Tag Image
//Name Rappresenta il nome del file associato all' oggetto
//Id Rappresenta il nome dell' oggetto
function PreloadImg() {

sPathImg="../../images/";
aImages=new Array;

for (i=0; i<document.images.length; i+=1)
{
	if (document.images(i).className=="myImage")
	{
		aImages[document.images(i).id]=new Array(3);
		
		//1° Cella valorizzata ID Tag Image x future use
		aImages[document.images(i).id][0]=document.images(i).id;
		
		//2° Cella contenente immagine non selezionata
		aImages[document.images(i).id][1]=new Image(10,10);
		aImages[document.images(i).id][1].src=sPathImg + document.images(i).name + "_n.gif";
		
		//3° Cella contenente immagine selezionata
		aImages[document.images(i).id][2]=new Image(10,10);
		aImages[document.images(i).id][2].src=sPathImg + document.images(i).name + "_h.gif";
		
	}
	
}

}

//Sotto NT4 il Netscape ha dei problemi con il refresh delle immagini...
function nt4(img) {

/*
if (agent.indexOf("WinNT") == -1) {
                return;
        } 
                else {
                document.images[img].src = eval(img + "_c.src")
        }
*/

}

function ShowImage(IDtagImg,tipo) 
{

if (aImages=="undefined")
{
	return;
}
if (browser == 1)	
{
	
	if (tipo == 'h') 
	{
		
		document.images[IDtagImg].src = aImages[IDtagImg][2].src;
	}


	if (tipo == 'n') 
	{
		document.images[IDtagImg].src = aImages[IDtagImg][1].src;
	}
}
}

function screen_resolution() {

document.writeln("<FRAMESET border=0 cols=15%,* frameBorder=0 frameSpacing=0>");
 
if (screen.height==600)
{
    document.writeln("<frame name='sx' src='html/800x600/sx.htm' marginheight=0 marginwidth=0 scrolling='no' noresize>");
    document.writeln("<frame name='cx' src='html/800x600/main.htm' scrolling='no'>");

}
else if (screen.height==768)
{
    document.writeln("<frame name='sx' src='html/1024x768/sx.htm' marginheight=0 marginwidth=0 scrolling='no' noresize>");
    document.writeln("<frame name='cx' src='html/1024x768/main.htm' scrolling='no'>");
}

document.writeln("</FRAMESET>");
    
}