// JavaScript Document
	//test Ipad


//-------------------------------------------------------
//----- Codice gestione Lingua --------------------------
//-------------------------------------------------------	
/*
function caricaDatiFlags(){
	var result;
	var urlAttuale = $('.current_page_item_two a').attr('href');
	/*if(urlAttuale=='./login.php'){
		urlAttuale='./index.php';
		}
	$.get(urlAttuale,			
			data = null,
			function(dat){
				result= dat;	
				//carica menu
		
				$('.group li:not(:last)').each(function(index, element) {
                	$(this).find('a').text($(result).find('.group li').eq(index).text());   
					//var url=$(this).find('a').attr('url');
					//$(this).find('a').attr('href', url + '?lang=it');
                });
				
				$('.current_page_item_two a').mouseenter();
				
				$('#loginBox').html($(result).find('#loginBox').html());
				//carica titolo sidebar
				$('.attivita').html($(result).find('.attivita').html());
				//carica menu laterale
				$('#vtab li').each(function(index, element) {
                	$(this).text($(result).find('#vtab li').eq(index).text());   
					
                });
				$('#extra div').find('h4').text($(result).find($('#extra div').find('h4').text()));
				
				//carica Contenuto
				//$('.post').html($(result).find('.post').html());
				//traduce counter
				$('#counter').html($(result).find('#counter').html());
				try{
						$('#tabs').tabs({ fx: { opacity: 'toggle', duration:'fast' }});
						}catch(e){}
				colora_barra();
				
		return false;
			});
	}

$('#flags a:first').live('click',function(){
		event.preventDefault();
		$.getScript('js/localization/messages_it.js');
		$.get('setLang.php',			
			data = { lg: 'it_IT'},
			function(dat){
				caricaDatiFlags();
			});
			//.find('a:first').mouseenter();	
});			
$('#flags a:last').live('click',function(){
	event.preventDefault();
		$.get('setLang.php',			
			data = {lg : 'en_US'},
			function(dat){
				caricaDatiFlags();
			});
});	*/		

//-------------------------------------------------------
//----- Colore Barra ------------------------------------
//-------------------------------------------------------	
function colora_barra(){
			$('.title').css({'border-bottom':'2px solid','border-color':$('#magic-line-two').css('background-color')});			
}


//-------------------------------------------------------
//----- funzione reset Mail --------------------------------------
//-------------------------------------------------------	
function resetMail(){
		$('form:first input:text').val('');
		$('form:first textarea').val('');
		$('form:first select option').removeAttr('selected');
		$('form:first select option:first').attr('selected','selected');
	}
	
//-------------------------------------------------------
//----- Funzione Menu  ----------------------------------
//-------------------------------------------------------	
function menuClick(){
			$('#example-two li').removeClass('current_page_item_two');
			$(this).parent('#example-two li').addClass('current_page_item_two');	
			$('.current_page_item_two a').mouseenter();//.mouseleave().mouseenter();
			var th = $('.current_page_item_two a');
			//alert(th.attr('href'));
			event.preventDefault();
				try{
				
					
						$('div.post').load(th.attr('href') + " div.post",function(e)
						{
						colora_barra();
						$('#tabs').tabs({ fx: { opacity: 'toggle', duration:'fast' }});
								if(!isIE){
								  $('.loader').hide();
								  $('div.post').fadeIn('fast');
								  }else{
									  $('.loader').hide();
									  $('div.post').show();
									}
								});
						
				}catch(e){
					$('div.post').load(th.attr('href') + " div.post",function(e){
						colora_barra();
						
						}
					);
			
			}
		}
