// 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);



//	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' 
		});
	
	

		//columnizer
		/*	$('#testoart').columnize({ 
					columns: 2, 
					lastNeverTallest:true 
								});
			
			
			});
		*/

		//	slide	
				$(function() {
					$('#fotohome').cycle({ 
						fx:     'fade', 
						pager:	'#pager',
						cleartype:  1, // enable cleartype corrections
						pause:      1,     // true to enable "pause on hover" 
						timeout: 6000
					});
			});
				
				
		
		//slide foto articoli
		$(function() {
					$('#immcnt').cycle({ 
					  fx:     'scrollHorz', 
					  prev:   '#prev', 
					  next:   '#next', 
					  timeout: 0 
					});
			});
		
		
		
					$(function()
					{
						// this initialises the demo scollpanes on the page.
						$('.holder').jScrollPane();
					})
					



		//slide foto articoli
		//$("fotozoom").click(function () {
			  //$(this).effect("size", { to: {width: 350,height: 286} },from: {width: 0,height: 0} }, 1000);
		//});
				
				
		/*gestione della fotozoom*/
		
		
		
		
		
		
		
		$('#immcnt a').click(
					function(){
						
		$("#fotozoom a img").hide().attr({"src": $(this).attr("href")/*, "title": $("> img", this).attr("title")*/});
		$("#fotozoom a").attr({"href":this.href/*,"title":this.href */});	
						
					/*$('#fotozoom span').html( "<img src="+this.href+"/>");  */
					$('#testoarticolo').animate( {width: '0' }, 'slow' );
					$('#fotozoom').animate( {width: '390px' }, 'slow' );  
				//	$('#fotozoom').animate( {width: '360px', padding: '10px 15px' }, 'slow' );  
					//$('#chiudifotozoom').animate( {width: '345px', padding: '0px 15px'  }, 'slow' );
					$('#chiudifotozoom').show('slow' );
					 return false;
					 }
				  );
		$('#chiudifotozoom').click(
					function(){
					$('#testoarticolo').animate( {width: '390px' }, 'slow' );	
					$('#fotozoom').animate( {width: '0' }, 'slow' ); 
				//	$('#fotozoom').animate( {width: '0', padding: '0' }, 'slow' );  
					//$('#chiudifotozoom').animate( {width: '0', padding: '0'  }, 'slow' );
					$('#chiudifotozoom').hide('slow' );
					return false;
					  }
				  );		 
				
		/* cerchiamo di caricare la foto grande	
		
		$('#immaginielenco img').click(
					function(){
					$('#fotozoom span').html( "<img src="+this.src+"/>");  

					  }
				  );*/	
		
/* duplico il totale da pagare	*/		
$("#totalidx").html($("#totalevalore").html());		

});
				


