// JavaScript Document
// file di configurazione script per Getra area istituzionale




//shadow box



Shadowbox.init({
    language:   "it",
    players:  ['flv', 'html', 'iframe', 'img', 'qt', 'swf', 'wmp'],
	enableKeys:			true,
	continuous:			true
 
   
});

$(document).ready(function()
{
//attiva  pngfix 
$(document).pngFix();

	//apre i link in esterno in base all'url
	$("a.ext").click(function() {  
		window.open(this.href,'','');
		return false;
	}); 
	
	
//animazione in apertura delle pagina
//il menu apertura e chiusura
//
//$(filter).animateClass(newClass,[oldClass], duration);

//gestiamo radio button $ chekbox
/*$("label:has(input[type='radio'])").addClass('radio');
$("label:has(input[type='checkbox'])").addClass('check');
*/
//il primo ed ultimo fieldset
$("fieldset:first").addClass('first');
$("fieldset:last").addClass('last');
//i campi hidden
$("input[type='hidden']").css('display','none');
//$("button[type='reset']").css('background-image','url(../images/ico/reset_msg.gif)');

//i pulsanti file
 $("input[type=file]").filestyle({ 
     image: "/images/elementi/bg_btn_scegli_ist.gif",
     imageheight : 14,
     imagewidth : 14,
     width : 105
 });







//////////////////////////////////////////////////menu top//////////////////////////////////////////////////////////////////
/*il menu prima la pop up interna*/
   $(".smenu a.ln").hover(
	function(){
	$(".smenu .act").removeClass('act');
	var idln=this.id;
	ln = idln.substr(2);
	//alert (ln);
	$('#ln'+ln).addClass('act');
	$('#im'+ln).addClass('act');
	$('#no'+ln).addClass('act');
	}
	);
/*il menu poi la gestione esterna*/   
   $("#head ul a").hover(
	function(){
	var idcat=this.id;
	cat = idcat.substr(3);
	//alert(cat);
	$("#head ul a").removeClass('act');
	$('#cat'+cat).addClass('act');
	$(".smenu").hide();
	$("#sottocat").show();
	$("#bgm").show();
	$('#sm'+cat).show();
	
	$(".smenu .act").removeClass('act');
	//$('#sm'+cat+' a:first').addClass('act');
	$('#sm'+cat+' .imgh:first').addClass('act');
	$('#sm'+cat+' p:first').addClass('act');
	}
	);
/* la chiusura de menu */
   $("#sottocat").mouseleave(
	function(){	
	$("#sottocat").hide();
	$(".home").removeClass('act');
	
	}					 
	);
/*i casi in cui mancano le sottocategorie il menu non si deve aprire*/   
     $(".nomenu").hover(
	function(){	
	$("#sottocat").hide();
		$("#head ul a").removeClass('act');
	},
	function(){	
	$("#sottocat").hide();
		$("#head ul a").removeClass('act');
	}
	);
//////////////////////////////////////////////////fine menu top//////////////////////////////////////////////////////////////////	 
//////////////////////////////////////////////////gallery news home//////////////////////////////////////////////////////////////////	 

	$(function() {
			$('#videohome .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevvh',
					next:   '#nextvh',
					timeout: 0
			});
	});
	
	$(function() {
			$('#newshome .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevnh',
					next:   '#nextnh',
					timeout: 0
			});
	});	
	
	$(function() {
			$('#casehome .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevch',
					next:   '#nextch',
					timeout: 0
			});
	});
	$(function() {
			$('#ev').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevchev',
					next:   '#nextchev',
					timeout: 0
			});
	});	
//////////////////////////////////////////////////fine gallery news home//////////////////////////////////////////////////////////////////	 	
	
		$(function() {
			$('#boxdx .cnt').cycle({ 
					fx:     'scrollUp', 
					speed:  1500,
					pause:  1,
					timeout: 5000
			});
	});	


////////////////////////////////////////////////// gallery dettaglio news//////////////////////////////////////////////////////////////////	 

	
	$(function() {
			$('#gnews .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevg',
					next:   '#nextg',
					timeout: 0
			});
	});
	$(function() {
			$('#gvnews .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevgv',
					next:   '#nextgv',
					timeout: 0
			});
	});

	
	$(function() {
			$('.elmatch #gnews .item').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevg',
					next:   '#nextg',
					timeout: 0
			});
	});
	$(function() {
			$('.elmatch #gvnews .item').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevgv',
					next:   '#nextgv',
					timeout: 0
			});
	});




	$(function() {
			$('#docs .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevd',
					next:   '#nextd',
					timeout: 0
			});
	});
	$(function() {
			$('#link .cnt').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prevl',
					next:   '#nextl',
					timeout: 0
			});
	});
	
	
	

////////////////////////////////////////////////// gallery dettaglio news//////////////////////////////////////////////////////////////////	 


//tooltip
$("#tools a[title]").tooltip({ position: "top right",
							   offset:[0, -20],
							   opacity: 0.8
							   });
$("#ttool a[title]").tooltip({ position: "top right",
							   offset:[0, -20],
							   opacity: 0.8
							   });
$(".nav a[title]").tooltip({ position: "top right",
							   offset:[0, -20], 
							   opacity: 0.8
							   });


//tabs
$("#tabs ul").tabs("div#panes > div.pane");

	$(function() {
			$('#imgp .cnt').cycle({ 
					fx:     'scrollUp', 
					speed:  1500,  
					next:   '#nextp',
					timeout: 0
			});
	});
	
	$(function() {
			$('#imgp .cnt').cycle({ 
					fx:     'scrollDown', 
					speed:  1500,  
					prev:   '#prevp',
					timeout: 0
			});
	});
	
	
		$(function() {
			$('#vidp .cnt').cycle({ 
					fx:     'scrollUp', 
					speed:  1500,  
					next:   '#nextvid',
					timeout: 0
			});
	});	
	
	$(function() {
			$('#vidp .cnt').cycle({ 
					fx:     'scrollDown', 
					speed:  1500,  
					prev:   '#prevvid',
					timeout: 0
			});
	});
	
	
	


//paginazione
 $("#vai").mouseover(
	function(){
	
	//alert(cat);
	$("#pag").animate	({	"width": "300px", "opacity": "show"}, { duration: "slow", queue: false });
	$('#vai').addClass('act');
	}
	);
 $("#pag").mouseleave(
	function(){
	//alert(cat);
	$("#pag").animate	({	"width": "0px", "opacity": "hide"}, { duration: "fast", queue: false });
	$('#vai').removeClass('act');
	}
	); 




//columnize
	/*$('#agdetail #txt').columnize({
						
						
						columns: 4, 
						lastNeverTallest:true 
						});
	$('#contenitore #txtartimg').columnize({
						width:150

						
						});

	*/
	
//e in holding gestiamo i livelli nascosti	
	
	
	

	
	$("#testo h6").click(
	function(){
	var idln=this.id;
	ln = idln.substr(1);
	//alert (ln);
	$('#sl'+ln).slideToggle('slow');

	}
	);
	



	
	
});




