// 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');
$("input[type='radio']").addClass('styled');
//$("label:has(input[type='checkbox'])").addClass('check');
$("input[type='checkbox']").addClass('styled');

//il primo ed ultimo fieldset
$("fieldset:first").addClass('first');
$("fieldset:last").addClass('last');

//i campi hidden
$("input[type='hidden']").css('display','none');
//i campi di testo
$("input[type='text']").each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});



//i campi di password
$("input[type='password']").each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});

$("textarea").each(function() {
    var default_value = this.value;
    $(this).focus(function() {
        if(this.value == default_value) {
            this.value = '';
        }
    });
    $(this).blur(function() {
        if(this.value == '') {
            this.value = default_value;
        }
    });
});




//$("button[type='reset']").css('background-image','url(../images/ico/reset_msg.gif)');





//////////////////////////////////////////////////menu top//////////////////////////////////////////////////////////////////

/*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();
	$('#sm'+cat).show();
	
	$(".smenu .act").removeClass('act');
	//$('#sm'+cat+' a:first').addClass('act');
	}
	);
/* la chiusura de menu */
   $(".smenu").mouseleave(
	function(){	
	//$("#sottocat").hide();
	$(".home").removeClass('act');
	$("#head ul a").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//////////////////////////////////////////////////////////////////	
//j corners per i box


/*$('.box span').corner("bevel");*/
//$('.box span').corner("bevel bl 225px");

//	slide	
/*	$(function() {
				$('#tgallery').cycle({ 
					fx:     'fade', 
					speed:  5000,  
					timeout: 1
				});
		});
*/


	
	/*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()
{
	$('.media').jScrollPane();
	$('.mediav').jScrollPane();
	$('#testocorsi #pane').jScrollPane();
});





//columnize
	/*$('#agdetail #txt').columnize({
						
						
						columns: 4, 
						lastNeverTallest:true 
						});
	$('#contenitore #txtartimg').columnize({
						width:150

						
						});

	*/
});




