// JavaScript Document

// GLOBAL VAR
CUR_IMG=1;
CUR_LBL=1;
CUR_VIS=2;
CUR_CAR=1;

function noop() {}

function swapImgGallery(iImg,NiImg) {
 var i,dis;
 document.getElementById('gal_li_' + CUR_IMG).className='';
 CUR_IMG=iImg;
 document.getElementById('gal_li_' + CUR_IMG).className='sel'; 
 for (var i=1;i<=NiImg;i++) { 
 	//if (i==iImg) {dis='block';roll='on';} else {dis='none';roll='off';}	
	if (i==iImg) {dis='block';} else {dis='none';}	
	document.getElementById('DivGallery_' + i).style.display=dis;
	document.getElementById('Img_Des_' + i).style.display=dis;
 	//ii='0'+i;
	//document.getElementById('iImg_' + i).src='img/galleria/' + ii.substring(ii.length-2,ii.length) + '_' + roll + '.gif';
 }
}

function swapLabel(imgName,id,sfx_lg) {
	var ii,dis,roll
	var LblImg=new Array()
	LblImg[0]='sistemi';LblImg[1]='caratteristiche';LblImg[2]='3d';LblImg[3]='accessori';LblImg[4]='disegno';
	document.getElementById('LabelScheda' + CUR_LBL).className='';	
	CUR_LBL=id;
	document.getElementById('LabelScheda' + CUR_LBL).className='sel';		
	for (ii=1;ii<=5;ii++) { 
	 	if (ii==id) {dis='block';roll='on';} else {dis='none';roll='off';}	
		document.getElementById('Scheda' + ii).style.display=dis;
		//document.getElementById('LabelScheda' + ii).src='img/p_' + LblImg[ii-1] + '_' + roll + '_s' + sfx_lg + '.gif'; //img/p_disegno_on_s.gif
	 }
}

function swapDis(id) {
	CUR_VIS=id;
	var color;
	for (ii=1;ii<=4;ii++) {
		//if (ii==id) {dis='block';roll='on';} else {dis='none';roll='off';}	
		if (ii==id) {color='#B22F16'} else {color=''}	
			if (document.getElementById('SPn_Vis' + ii)) document.getElementById('SPn_Vis' + ii).style.color=color;
			//if (document.getElementById('IcoVista' + ii)) document.getElementById('IcoVista' + ii).src='img/ico_disegno0' + ii + '_' + roll + '.gif'; 
	} 
}

function changeDis( id, fileswf ) {
	
	swapDis( id );
	
	if ( document.all ) {
		
		document.getElementById('DisImgSWF').movie = fileswf;
		
	} else {
		
		if ( document.embeds['DisImgSWF'].src = fileswf ) {			
					
			if ( document.embeds['DisImgSWF'].style.display == 'table' ) {				
				document.embeds['DisImgSWF'].style.display = 'block';				 
			} else {				
				document.embeds['DisImgSWF'].style.display = 'table';				 
			}
							
		}
		
	}
	
}

function swapCar(id,num,elem) {
	CUR_CAR=id;
	for (ii=1;ii<=num;ii++) {
		if (ii==id) {dis='block';color='#B22F16';} else {dis='none';color='';}	
		document.getElementById('Div' + elem + ii).style.display=dis;
		document.getElementById('Link_Var'+ ii).style.color=color;
		
	}
}




var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
// Handle all the FSCommand messages in a Flash movie.
function tree_menu_DoFSCommand(command, args) {
	var tree_menuObj = isInternetExplorer ? document.all.tree_menu : document.tree_menu;
	//
	// Place your code here.
	//
}
// Hook for Internet Explorer.
if (navigator.appName && navigator.appName.indexOf("Microsoft") != -1 && navigator.userAgent.indexOf("Windows") != -1 && navigator.userAgent.indexOf("Windows 3.1") == -1) {
	document.write('<script language=\"VBScript\"\>\n');
	document.write('On Error Resume Next\n');
	document.write('Sub tree_menu_FSCommand(ByVal command, ByVal args)\n');
	document.write('	Call tree_menu_DoFSCommand(command, args)\n');
	document.write('End Sub\n');
	document.write('</script\>\n');
}

function ShowAndHide(id1){
if(document.getElementById){
    el1=document.getElementById(id1);
    if(el1.style.display=="none"){
        el1.style.display="block";
        }
    else{
        el1.style.display="none";
        }
    }
}


//ICONE SWF
	var rollover_color = "F6871F";
	var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;
	
	function showlabel (args, value) {
	
		if ( value == "1" ) {
			// switch on label
			document.getElementById("label_"+args).style.color = "#"+rollover_color;
		} else {
			// switch off label
			document.getElementById("label_"+args).style.color = "";
		}
		// alert( "showlabel " + args + " - " + value );
	}
	
	function showicon (args, value) {
		var icona_Obj = isInternetExplorer ? document.all["icona_"+args] : document["icona_"+args];	
		if ( value == "1" ) {
			icona_Obj.TCallLabel("/functions_mc", "rollover");
		} else {
			icona_Obj.TCallLabel("/functions_mc", "rollout");
		}
	}
//FINE ICONE SWF
