function nnt2(mostra) {

 if (mostra == 'scadenzario-ct2'){
   document.getElementById('scadenzario-ct2').className = 'w270';
   document.getElementById('scadenzario-ct1').style.display = 'none';
	document.getElementById('scadenzario-ct3').style.display = 'none';
	
 }
 
 if (mostra == 'scadenzario-ct3'){
   document.getElementById('scadenzario-ct3').className = 'w270'; 
   document.getElementById('scadenzario-ct2').style.display = 'none';
	document.getElementById('scadenzario-ct1').style.display = 'none';
	
 }
 
 if (mostra == 'scadenzario-ct1'){
   document.getElementById('scadenzario-ct1').className = 'w270';
   document.getElementById('scadenzario-ct2').style.display = 'none';
	document.getElementById('scadenzario-ct3').style.display = 'none';
	
 }

}

function go(page){
window.location=page;
}

function open_window_mail(url) {

mywin = window.open(url,"win2",'toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=yes,resizable=no,width=800,height=600');

}


function WinOpen(){
	//  ( href [,target] [,x] [,y] [,"maximized"] [,"fullscreen"] [,"nocenter"] [,"scroll"] [,"return"] )
	// eg: WinOpen('http://...',400,300,'myTarget','scroll')
	if(arguments.length>0){
		_url=arguments[0];
		var x,y,o,_target="",_params=[],center=true,maximized=false,fullscreen=false,scroll=false,returnObj=false;
		if(!document.all || (document.all && navigator.userAgent.indexOf("Mac")!=-1) ){
			for(i=1;i<arguments.length;i++){
				if(arguments[i]=="fullscreen"){
					arguments[i]="maximized";
					break;
				}
			}
		}
		if(arguments.length>1){
			for(i=1;i<arguments.length;i++){
				if(isNaN(arguments[i])){
					switch(arguments[i]){
						case"nocenter":
							center=false;
						break;
						case"scroll":
							scroll=true;
						break;
						case"maximized":
							maximized=true;
							_params[_params.length]="left=0";
							_params[_params.length]="top=0";
							_params[_params.length]="width="+(screen.width-6);
							_params[_params.length]="height="+(screen.height-26);
						break;
						case"fullscreen":
							fullscreen=true;
							_params[_params.length]="fullscreen=yes";
						break;
						case"return":
							returnObj=true;
						break;
						default:
							_target=arguments[i];
						break;
					}
				}
			}
			if(!fullscreen && !window[_target])_params[_params.length]="scrollbars="+((scroll)?"1":"0");
			if(!maximized && !fullscreen &&  !window[_target]){
				for(i=1;i<arguments.length;i++){
					if(!isNaN(arguments[i]) && !maximized){
						if(x==undefined){
							x=arguments[i];
							_params[_params.length]="width="+(x*1+((scroll)?18:0));
						}else{
							y=arguments[i];
							_params[_params.length]="height="+y;
						}
					}
				}
				if(center && !window[_target]){
					_params[_params.length]="left="+((screen.width-x)/2);
					_params[_params.length]="top="+((screen.height-y)/2);
				}
			}
		}
		o=window.open(_url,_target,_params.join(","));
		if(o==undefined)alert(_LANG["popup_blocked"]);
		if(returnObj)return o;
	}
}

function CheckFieldMailAlert() {

var eMail;
var ritorno = true;
var color = "white";
var label;
var filter  = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-])+\.)+([a-zA-Z0-9]{2,4})+$/;
//var filter   = /^([a-zA-Z0-9_\.\-])+\@(([a-zA-Z0-9\-]{2,})+\.)+([a-zA-Z0-9]{2,})+$/;

for (i=1;i<4;i++) {

//	    alert(document.forms[0].elements[i].value);	
	if (document.formMailAlert.elements[i].value=="" && document.formMailAlert.elements[i].className == 'Req') {
        label = document.getElementById("lbl"+document.formMailAlert.elements[i].name);
        
		label.className="requiredFont";
        ritorno = false;
	}else{
        label = document.getElementById("lbl"+document.formMailAlert.elements[i].name);
        label.className="normalFont";
    }
}

for (i=1;i<2;i++) {
    eMail = document.formMailAlert.elements[i].value;
    if (document.formMailAlert.elements[i].className == 'Req') { 
        if (document.formMailAlert.elements[i].value!="") {	    	
	        if (!(filter.test(eMail))) {
	            ritorno = false;
	            color = "red";
                label = document.getElementById("lbl"+document.formMailAlert.elements[i].name);	    
	            label.className="requiredFont";
	         lblErrEmail.style.color=color;
			 }
        }
            
    }
}
return ritorno;
}


function print_preview() {
	
	//var disp_setting="toolbar=no,location=no,directories=no,menubar=yes"; 
	var divs = document.getElementsByTagName('div');

	for(i=0;i<divs.length;i++){

		if(divs.item(i).id == 'contenitore'){

			var itemCol_centro = divs.item(i);

			i = divs.length;

		}

	}
	var htmlBody = itemCol_centro.innerHTML;
	//alert(htmlBody);
	var boxStampa = '<div id="printf" align="right" style="visibility:visible;"><img src="/it_IT/static/images/print.gif" border="0"/><a href="#" style="" onClick="window.print()">Print Page</a>&#160;&#160;<img src="/it_IT/static/images/close_print.gif" border="0"/><a href="#" style="" onClick="window.close()">Close Window</a></div>';

	//var htmlBody = document.getElementById('container').innerHTML;
	var docprint=window.open("","","");
	docprint.document.open();
	docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" href="/css/stampa.css"/></head><body>'+boxStampa+'<div id="container"><div id="contenuti"><div class="col_centro">'+htmlBody+'</div></div></div></body></html>');
	//docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" href="/css/stampa.css"/></head><body>');
	//docprint.document.write(htmlBody);
	//docprint.document.write('</body></html>');
	//docprint.document.write('<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><link rel="stylesheet" type="text/css" href="/css/stampa.css"/><link rel="stylesheet" href="/it_IT/static/css/sIFR-print.css"/></head><body>prova per la stampa</body></html>');
	docprint.document.close();
	//docprint.focus();
	//docprint.window.print();
}	
/* SNAM MENU 2 Level */

sem={
	// CSS classes
	semClass:'sem',
	hideClass:'no',

	currentliSelId:'li-sel',	
	currentliSelOpenId:'li-sel-open',	

	init:function(){
		if(!document.getElementById || !document.createTextNode){
			return;
		}
		var uls=document.getElementsByTagName('ul');
		for(var i=0;i<uls.length;i++){
		var inneruls;
		if(!sem.cssjs('check',uls[i],sem.semClass)){continue;}
				
			var inneraRef=uls[i].getElementsByTagName('a');
			for(var k=0;k<inneraRef.length;k++){			    
                	var currentaRef,parentUL,parentLI;
	                var nlast__Pos,nlastCtrlPos,HrefLocationMenu,HrefLocationWindow
	                //Forzatura per gestire pagine non presenti nel menu
	                //Tali pagine terminano con __xx e la prima parte del nome
	                //è la stessa della pagina di riferimento/parent nel menu.
	                nlast__Pos = inneraRef[k].href.lastIndexOf('__');
	                //alert(window.location.href);	                
	                if(nlast__Pos != '-1' && window.location.href.lastIndexOf('__') != '-1') {
	                    nlastCtrlPos = inneraRef[k].href.lastIndexOf('/')+1;
	                    HrefLocationMenu = inneraRef[k].href.substring(nlastCtrlPos,nlast__Pos)
	                    nlast__Pos = window.location.href.lastIndexOf('__');
	                    nlastCtrlPos = window.location.href.lastIndexOf('/')+1;
	                    HrefLocationWindow = window.location.href.substring(nlastCtrlPos,nlast__Pos)
	                }else{	                	                		                
	                    HrefLocationMenu = inneraRef[k].href
	                    HrefLocationWindow = window.location.href
	                }	                
                
                
                
                	var sVet = window.location.href.split("/");
                	var sVMen = inneraRef[k].href.split("/");
                	//prova
                	/*alert(sVet[sVet.length - 2]);
                	alert(sVMen[sVMen.length -2] );                	*/
	                if((HrefLocationMenu == HrefLocationWindow) && (sVMen[sVet.length - 2] == sVet[sVMen.length -2])) {                                	
                	//if(inneraRef[k].href == window.location.href) {
	                  	currentaRef = inneraRef[k];
				parentUL = inneraRef[k].parentNode.parentNode
	                        if(sem.cssjs('check',parentUL,sem.semClass)){                    	
	                        //1° Livello
	                        parentLI = inneraRef[k].parentNode;                                     				
	                        if (parentLI.tagName == "LI"){
					if (parentLI.className == ""){
		    				sem.cssjs('id',inneraRef[k].parentNode,sem.currentliSelId);
			       		}else{
		                                sem.cssjs('id',inneraRef[k].parentNode,sem.currentliSelOpenId);
				        }
			 	}   
                        }else{
	                        //2° Livello	                        
	                        //alert(inneraRef[k].href);
	                        parentLI = parentUL.parentNode;               
	                        if (parentLI.tagName == "LI"){
	                        	sem.cssjs('id',parentUL.parentNode,sem.currentliSelOpenId);	                        	
	                        	currentaRef.style.color='#1a7cca';
	                        }
                        }                        
                	currentaRef.style.fontWeight = "bold";
                	currentaRef.style.textDecoration = "none";                      	
                        //currentaRef.href="javascript:void(0)";                
                	break;
                }    
            }
			
			var inneruls=uls[i].getElementsByTagName('ul');
			for(var j=0;j<inneruls.length;j++){					

				var parentLI=inneruls[j].parentNode;				

				if(parentLI.id == sem.currentliSelId || parentLI.id == sem.currentliSelOpenId){			
				}else{
				    sem.cssjs('add',inneruls[j],sem.hideClass);				
				}
			}
		}
	},
	addEvent: function(elm, evType, fn, useCapture){
		if (elm.addEventListener) 
		{
			elm.addEventListener(evType, fn, useCapture);
			return true;
		} else if (elm.attachEvent) {
			var r = elm.attachEvent('on' + evType, fn);
			return r;
		} else {
			elm['on' + evType] = fn;
		}
	},
	cssjs:function(a,o,c1,c2){
		switch (a){
			case 'swap':
				o.className=!sem.cssjs('check',o,c1)?o.className.replace(c2,c1):o.className.replace(c1,c2);
			break;
			case 'add':
				if(!sem.cssjs('check',o,c1)){o.className+=o.className?' '+c1:c1;}
			break;
			case 'id':
				if(!sem.cssjs('check',o,c1)){o.id=c1;}
			break;
			case 'remove':
				var rep=o.className.match(' '+c1)?' '+c1:c1;
				o.className=o.className.replace(rep,'');
			break;
			case 'check':
				return new RegExp("(^|\s)" + c1 + "(\s|$)").test(o.className)
			break;
		}
	}
}
sem.addEvent(window, 'load', sem.init, false);

function openReservedArea(p) {
    var path = p + "form.shtml";
	window.open(path,'mywindow','width=604,height=650,scrollbars=yes');
}



