// 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()
{
$(function()
			{
			//visualizzazione delle frecce
			var altezza = $(".scroll-pane").height();
			if ( altezza > '107') {
			$(".progdett").append($('<a></a>')
								.attr(
									{
										'href':'javascript:;', 
										'className':'scroll',
										'title':'scorri sopra',
										'id':'ftop',
										'rel':'107px'
									}
								)
								.html('sopra')
							
			);
			$(".progdett").append($('<a></a>')
								.attr(
									{
										'href':'javascript:;', 
										'className':'scroll',
										'title':'scorri sotto',
										'id':'fdwn',
										'rel':'-107px'
									}
								)
								.html('sotto')
			);
			};

			
			
			
			
			// this initialises the demo scollpanes on the page.
			$('.holder').jScrollPane({showArrows:false, scrollbarWidth:0, scrollbarMargin:0, animateTo:true});
			$('.scroll').bind(
                    'click',
                    function()
                    {
                        $('.holder')[0].scrollBy(parseInt($(this).attr('rel')));
                        return false;
                    }
                );
			
			
	});


	//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
					});
			});
	*/
	$(function() {
			$('#supersize').cycle({ 
				fx:     'fade',
				speed:  10000,  
				timeout: 20000,
				prev:   '#prev',
				next:   '#next',
				delay:   0     // additional delay (in ms) for first transition (hint: can be negative) 
			});
	});
	$(function(){
			$.fn.supersized.options = {  
				startwidth: 640,  
				startheight: 480,
				vertical_center: 1,
				slideshow: 1,
				navigation: 1,
				transition: 0, //0-None, 1-Fade, 2-slide top, 3-slide right, 4-slide bottom, 5-slide left
				pause_hover: 0,
				slide_counter: 1,
				slide_captions: 1,
				slide_interval: 3000  
			};
	        $('#supersize').supersized(); 
	    });
	

	
	/*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() {
			$('#rassegna').cycle({ 
				fx:     'fade', 
				speed:  1500,  
				prev:   '#prevr',
				next:   '#nextr',
				timeout: 0
			});
	});
		$(function() {
			$('#content').cycle({ 
				fx:     'fade', 
				speed:  1500,  
				prev:   '#prev',
				next:   '#next',
				timeout: 0
			});
	});
	
	$(function() {
			$('#progetti').cycle({ 
				fx:     'scrollVert', 
				speed:  1500,  
				prev:   '#prev',
				next:   '#next',
				pager:	'#pager',
	 			cleartype:  1, // enable cleartype corrections
				timeout: 0
			});
	});
	



/****************************gallery progetti*******************************/

	$('#slidecontainer').hover(
					function(){
					$('#progcoldx').animate( {width: '56px' }, 'fast' ); 
					$('#bgcoldx').animate( {width: '56px' }, 'fast' ); 
					$('#slidecontainer #next').animate( {width: '56px' }, 'fast' );
					$('#slidecontainer #prev').animate( {width: '56px' }, 'fast' );
					  },
					 function(){
					$('#progcoldx').animate( {width: '0px'}, 'fast' );
					$('#bgcoldx').animate( {width: '0px' }, 'fast' );
					$('#slidecontainer #next').animate( {width: '0px'}, 'fast' );
					$('#slidecontainer #prev').animate( {width: '0px'}, 'fast' );
					  }
	);
	
	
		
	$('#progcoldx').cycle({ 
					fx:     'scrollVert', 
					speed:  1500,  
					prev:   '#prev',
					next:   '#next',
					pause:      1,     // true to enable "pause on hover" 
					timeout: 6000
	});
		
	
	$('#progslide').cycle({ 
		fx:     'turnDown', 
		speed:  'slow', 
		timeout: 0, 
		pager:  '#progcoldx', 
		 
		// callback fn that creates a thumbnail to use as pager anchor 
		pagerAnchorBuilder: function(idx, slide) { 
			//return '<li><a href="#"><img src="' + slide.src + '" /></a></li>'; 
			return '#progcoldx a:eq(' + idx + ') img'; 
		} 
	});
		
	
	

	

/****************************gallery progetti*******************************/



	












	
	

/********************mediagallery******************************/




$('a#t1').click(function() {
		$("#mediagallery").animate({ height:"110px"}, 1000 );				 
		$("#mediagallery div").hide();
		$("#tc").show('slow');
		$("#fimm").show('slow');
		$("#immagini").slideToggle("slow");
		/*$("#immagini div").show('slow');*/
	});

$('a#t2').click(function() {
		$("#mediagallery").animate({ height:"110px"}, 1000 );					 
		$("#mediagallery div").hide();
		$("#tc").show('slow');
		$("#fvid").show('slow');
		$("#video").slideToggle("slow");
	});
$('a#t3').click(function() {
		$("#mediagallery").animate({ height:"110px"}, 1000 );					 
		$("#mediagallery div").hide();
		$("#tc").show('slow');
		$("#fdoc").show('slow');
		$("#docs").slideToggle("slow");
	});
$('a#t4').click(function() {
		$("#mediagallery").animate({ height:"110px"}, 1000 );					 
		$("#mediagallery div").hide();
		$("#tc").show('slow');
		$("#furl").show('slow');
		$("#link").slideToggle("slow");
	});
$('a#tc').click(function() {
		$("#mediagallery").animate({ height:"20px"}, 1000 );					 
		$("#tabs div").hide("slow");
		$("#tc").hide();
	});

/*elenco media gallery*/
		$(function() {
				$('#immagini').cycle({ 
					fx:     'fade', 
					speed:  1500,  
					prev:   '#tprevimg',
					next:   '#tnextimg',
					timeout: 0
				});
				
		});
	
		
		$(function() {
				$('#video').cycle({ 
					fx:     'fade', 
					speed:  1500,  
					prev:   '#tprevvid',
					next:   '#tnextvid', 
					timeout: 0
				});
				
		});
		$(function() {
				$('#docs').cycle({ 
					fx:     'scrollHorz', 
					speed:  1500,  
					prev:   '#tprevdoc',
					next:   '#tnextdoc',
					timeout: 0
				});
				
		});
	
		$(function() {
				$('#link').cycle({ 
					fx:     'scrollHorz', 
					speed:  1500,  
					prev:   '#tprevurl',
					next:   '#tnexturl', 
					timeout: 0
				});
				
		});
		







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

						
						});

	*/
	
/*****************************************************************************blog***************************************************************************/	

		$(function() {
				$('#sponsorsblog').cycle({ 
					fx:     'scrollHorz', 
					speed:  1500,  
					timeout: 1
				});
				
		});

/*****************************************************************************blog***************************************************************************/	
	
});




