// JavaScript Document
// file di configurazione script per mediatrading




//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)');




//	slide	
	$(function() {
				$('#tgallery').cycle({ 
					fx:     'fade', 
					speed:  5000,  
					timeout: 1
				});
		});

// slideshow foto articoli

$('#slideshow').before('<ul id="nav_img">').cycle({ 
    fx:     'fade', 
    speed:  'fast', 
    timeout: 0, 
    pager:  '#nav_img', 
     
    // callback fn that creates a thumbnail to use as pager anchor 
    pagerAnchorBuilder: function(idx, slide) { 
        return '<li><a href="#"><img src="' + slide.href + '" width="50" height="50" /></a></li>'; 
    } 
});

	
	/*gallery news home*/
	$(function() {
			$('#eslide').cycle({ 
				fx:     'fade', 
				pager:	'#pager',
	 			cleartype:  1, // enable cleartype corrections
				pause:      1,     // true to enable "pause on hover" 
				timeout: 6000
			});
	});
	
	$(function() {
			$('#eslideofferta').cycle({ 
				fx:     'fade', 
	 			cleartype:  1, // enable cleartype corrections
				pause:      1,     // true to enable "pause on hover" 
				timeout: 6000
			});
	});
	
	
	

//slide foto articoli

$('.imgtab').click(function() {	
	var idlnf=this.id;
	lnf = idlnf.substr(6);			
	$('#vidcnt'+lnf).hide('');
	$('#prevv').hide('');
	$('#nextv').hide('');
	$('#immcnt'+lnf).show('');
	$('#prev').show('');	
	$('#next').show('');	
	//$('#tab a').removeClass('act');
	$('#imgtab'+lnf).addClass('act');
	$('#vidtab'+lnf).removeClass('act');	
});


$('.vidtab').click(function() { 
	var idlnv=this.id;
	lnv = idlnv.substr(6);	
	$('#immcnt'+lnv).hide('');
	$('#prev').hide('');	
	$('#next').hide('');	
	$('#vidcnt'+lnv).show('');
	$('#prevv').show('');
	$('#nextv').show('');	
	//$('#tab a').removeClass('act');
	$('#vidtab'+lnv).addClass('act');
	$('#imgtab'+lnv).removeClass('act');
});


$(function() {
			$('#immcnt').cycle({ 
			  fx:     'scrollHorz', 
			  prev:   '#prev', 
    		  next:   '#next', 
    		  timeout: 0 
			});
	});

//slide foto articoli

$(function() {
			$('#vidcnt').cycle({ 
			  fx:     'scrollHorz', 
			  prev:   '#prevv', 
    		  next:   '#nextv', 
    		  timeout: 0 
			});
	});

		
$('#dataprenotazioneinizio').datepicker({
			changeMonth: true,
			changeYear: true
									  });

$('#dataprenotazionefine').datepicker({
			changeMonth: true,
			changeYear: true
									  });





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

						
						});

	*/
});




