// 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()
{
	
	//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);





//	slide	
	$(function() {
				$('#galleryslide').cycle({ 
					fx:     'turnDown', 
					speed:  1500,  
					prev:   '#prev1', 
					next:   '#next1', 
					before:   onAfter,
					timeout: 0
				});
				function onAfter() {
					$('#output1').html(this.title);
				}
		});



		$(function() {
				$('#portgallery').cycle({ 
					fx:     'fade', 
					speed:  1500,  
					prev:   '#prev', 
					next:   '#next', 
					before:   onAfter,
					timeout: 0
				});
				function onAfter() {
					$('#output').html(this.title);
				}
		});
	
	/*
		$('#portslide') 
		.cycle({ 
			fx:     'turnDown', 
			speed:  'slow', 
			timeout: 0,
			pause:   1,
			pager:  '#paginate' 
			
			// callback fn that creates a thumbnail to use as pager anchor 
			pagerAnchorBuilder: function(idx, slide) { 
			return '<a href="#"><img src="' + slide.src + '" width="50" height="50" /></a>'; 
			}
		});
	
	
	$('#slideshow').before('<ul id="portcoldx">').cycle({ 
    fx:     'turnDown', 
    speed:  'slow', 
    timeout: 0, 
    pager:  '#portcoldx', 
     
    // 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>'; 
    } 
});
	
	$('#slideshow').click(
					function(){
					$('#portcoldx').animate( {width: '140px' }, 'fast' );  
					
					  }
	);
	
	$('#portcoldx').hover(
					function(){
					$('#portcoldx').animate( {width: '140px' }, 'fast' );  
					
					  },
					 function(){
					$('#portcoldx').animate( {width: '0px'}, 'fast' );
					
					
					  }
	);
	
*/
	//columnize
	$('#agdetail #txt').columnize({
						
						
						columns: 4, 
						lastNeverTallest:true 
						});
	$('#contenitore #txtartimg').columnize({
						width:150

						
						});



	//altridocumenti
	

	
	//scrollpane
	$(function()
		{
			// this initialises the demo scollpanes on the page.
			$('.holder').jScrollPane();
		});


		$("a#moredocs").click(function() {  
			$("#moredocuments").toggleClass('docsact');

		}); 
	$("a#close").click(function() {  
			$("#moredocuments").toggleClass('docsact');

		}); 
	
	//footer archivio blog
	
	
	
	//distruggo il livello movie
/*	$('#closediv').click(function() {
								  $('#newweb').remove();
								  
								  
								  });
						 
*/

						 




$('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:     'scrollHorz', 
					speed:  1500,  
					prev:   '#tprevimg',
					next:   '#tnextimg',
					timeout: 0
				});
				
		});
	
		
		$(function() {
				$('#video').cycle({ 
					fx:     'scrollHorz', 
					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
				});
				
		});
		
				
	/*case history*/

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


				
	/*portfolio documenti*/

		$(function() {
				$('#documenti').cycle({ 
					fx:     'scrollHorz', 
					speed:  1500,  
					prev:   '#prev1',
					next:   '#next1', 
					timeout: 0
				});
				
		});

/*portfolio immagini e video*/

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


//alert ("test"); 

