function tbspeciale( foto1, foto2, foto3, foto4, foto5, foto6, foto7, foto8 ){
 
   if( foto1 == undefined || foto1 == "" || foto1 == "foto_speciali/" || foto1 == "foto_annunci/"){
   	  $('#falso1').attr('rel', '' );
   } else {
   	  $('#falso1').attr('rel', 'fotog' );
   	  $('#falso1').attr('href', foto1 );
   }
   if( foto2 == undefined || foto2 == "" || foto2 == "foto_speciali/" || foto2 == "foto_annunci/" ){
   	  $('#falso2').attr('rel', '' );
   } else {
   	  $('#falso2').attr('rel', 'fotog' );
   	  $('#falso2').attr('href', foto2 );
   }
   if( foto3 == undefined || foto3 == "" || foto3 == "foto_speciali/" || foto3 == "foto_annunci/" ){
   	  $('#falso3').attr('rel', '' );
   } else {
   	  $('#falso3').attr('rel', 'fotog' );
   	  $('#falso3').attr('href', foto3 );
   }
   if( foto4 == undefined || foto4 == "" || foto4 == "foto_speciali/" || foto4 == "foto_annunci/" ){
   	  $('#falso4').attr('rel', '' );
   } else {
   	  $('#falso4').attr('rel', 'fotog' );
   	  $('#falso4').attr('href', foto4 );
   }
   
   if( foto5 == undefined || foto5 == "" || foto5 == "foto_speciali/" || foto5 == "foto_annunci/" ){
   	  $('#falso5').attr('rel', '' );
   } else {
   	  $('#falso5').attr('rel', 'fotog' );
   	  $('#falso5').attr('href', foto5 );
   }   
   
   if( foto6 == undefined || foto6 == "" || foto6 == "foto_speciali/" || foto6 == "foto_annunci/" ){
   	  $('#falso6').attr('rel', '' );
   } else {
   	  $('#falso6').attr('rel', 'fotog' );
   	  $('#falso6').attr('href', foto6 );
   }   
   
   if( foto7 == undefined || foto7 == "" || foto7 == "foto_speciali/" || foto7 == "foto_annunci/" ){
   	  $('#falso7').attr('rel', '' );
   } else {
   	  $('#falso7').attr('rel', 'fotog' );
   	  $('#falso7').attr('href', foto7 );
   }

   if( foto8 == undefined || foto8 == "" || foto8 == "foto_speciali/" || foto8 == "foto_annunci/" ){
   	  $('#falso8').attr('rel', '' );
   } else {
   	  $('#falso8').attr('rel', 'fotog' );
   	  $('#falso8').attr('href', foto8 );
   }
   
   $('#falso1').trigger('click');
   

   return false;
}

// INIZIO CARICAMENTO MACRO NO CATEGORIA
//function carico_macro_nocategoria( ricevo ){
function carico_macro_nocategoria( ){
	$("#caricamento").empty();
	$("#caricamento").append(carico);
	$.getJSON("ajax_categorie.php?azione=macro_nocategoria", function(datiDiRitorno){
		righe_macro = datiDiRitorno;
		//alert(datiDiRitorno);
		mostra_macro_nocategoria(0, 0);
	});
}
// INIZIO CARICAMENTO MACRO NO CATEGORIA
/*
function doBlink() {
	var blink = document.all.tags("BLINK")
	for (var i=0; i<blink.length; i++)
		blink[i].style.visibility = blink[i].style.visibility == "" ? "hidden" : "" 
}

function startBlink() {
	if (document.all)
		setInterval("doBlink()",500)
}
*/

function abilito_stelle(ricevo)
{
   if (ricevo==1)
   {
   	 $('#des_stelle').show();
   	 $('#i_stelle').show();
   }
   else
   { 
     $("#i_stelle").val("0");
   	 $('#des_stelle').hide();
	 $('#i_stelle').hide();
   }
}
function getx(obj){
	var x = 0;
	if(obj.offsetParent){
		while(obj.offsetParent){
			x += obj.offsetLeft
			obj = obj.offsetParent;
		}
	}
	else if(obj.x)
		x += obj.x;
	return x;
} // getx

function gety(obj){
	var y = 0;
	if (obj.offsetParent){
		while (obj.offsetParent){
			y += obj.offsetTop
			obj = obj.offsetParent;
		}
	}
	else if (obj.y)
		y += obj.y;
	return y;
} // gety

function getid(id){
	if(document.getElementById){return document.getElementById(id);}
	else if(document.all)      {return eval("document.all."+id);}
	else if(document.layers)   {return eval("document."+id);}
	else                       {return document.all[id];}
} // getid

var scrolltotimeout;
function scrollto(x,y){
	clearTimeout(scrolltotimeout);	// prevent multiple scrolling clutter ups
	if(y==null){
		y=gety(x);
		x=getx(x);
	}	// if only 1 argument, use it's posx and posy (can be any object)
//	document.body.scrollTop = y;		// voor instant scroll
//	document.body.scrollLeft = x;		// voor instant scroll
	if(y > document.body.scrollTop)      document.body.scrollTop += Math.max(1,((y - document.body.scrollTop) / 4));
	else if(y < document.body.scrollTop) document.body.scrollTop += Math.min(1,((y - document.body.scrollTop) / 4));
	if(document.body.scrollTop != y){scrolltotimeout = setTimeout('scrollto('+x+','+y+')',50);}
} // scrollto



function carico_singolo( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
	//$("#girello").show();
	
    $.get("gettpl.php?tpl=scheda_annuncio_2008&"+ricevo, function(datiDiRitorno){
	   $('#mymaps1_contenitore').html(datiDiRitorno);
	 } );	  	
	//$("#girello").hide(); 
    $("#caricamento").empty();
    $("#caricamento").append(scarico);
    scrollto(getid('body'));
	start_nifty();
}
function carico_singolo_vetrina( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
	//$("#girello").show();
	
    $.get("gettpl.php?tpl=scheda_vetrina_2008&"+ricevo, function(datiDiRitorno){
	   //alert(datiDiRitorno);
	   $('#mymaps1_contenitore').html(datiDiRitorno);
	 } );	  	
    //$("#girello").hide();
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
    scrollto(getid('body'));
	start_nifty();
}



 
// 
function carico_(){
 $("#caricamento").empty();
 $("#caricamento").append(carico);
 //$("#girello").show();
} 
 
function vis_maps(){
 $("#map").show();
} 

function hide_maps(){
 $("#map").hide();
} 

function toggle_maps(){
 $("#map").toggle();
} 

// click annunci privati
function annunci_privati(){
	 $("#caricamento").empty();
     $("#caricamento").append(carico);
	 //$("#girello").show();
	 
	 $("#mymaps1_contenitore").html("");
	 
	 $.get("gettpl.php?tpl=categorie_ajax_bis", function(datiDiRitorno){
	 $('#tagcloud').html(datiDiRitorno);
	 carico_categorie('azione=cat_vis_random&id_ini=0');
	 } );
    
 	 $('#colonna_privati').show();
	 
	 $('#privati').removeClass();
	 $('#business').removeClass();
	 
	 $('#privati').addClass("topMenuRight on");
	 $('#business').addClass("topMenuRight off");
	 
	 $('#123').hide();
	 $('#tagcloud').show();
	 
	 $('#ricerca_annunci').hide();

	 //$("#titolo_annunci1").html("<b>privati</b>");
	 start_nifty();
	 //$("#girello").hide();	  
	 $("#caricamento").empty();
     $("#caricamento").append(scarico);

} 
// click annunci business
function annunci_business(){
  $("#caricamento").empty();
  $("#caricamento").append(carico);
  //$("#girello").show();
  $("#mymaps1_contenitore").html("");
  
  if ( (ricevo.indexOf( 'scegli' ) >= 0) || (ricevo.indexOf( 'choose' ) >= 0) ){
    return false;
  }
  $.get("gettpl.php?tpl=carico_vetrina", function(datiDiRitorno){
  $('#tagcloud').html(datiDiRitorno);
  carico_speciali('azione=speciali_random&id_inis=0');
});

	 $('#business').removeClass();
	 $('#privati').removeClass();
	 
	 $('#business').addClass("topMenuRight on");
	 $('#privati').addClass("topMenuRight off");
	 
	 $('#123').hide();
		 
     //$('#business').css({ color: "#FF9900", background: "#FFFFFF" });
	 //$('#privati').css({ color: "#00ADEF", background: "#F3F3EE" });
	 
	 $('#tagcloud').show();
	 $('#ricerca_annunci').hide();
	 //$("#titolo_annunci1").html("<b>vetrina</b>");
	 start_nifty();
     //$("#girello").hide();
	 $("#caricamento").empty();
     $("#caricamento").append(scarico);
} 




function highlight(field) {
  field.focus();
  //field.select();
  field.value = "";
}

function Clone(_ArryToClone)
   	{
       var _Clone = new Array();
	   for (_IdClone in _ArryToClone)
    	  if (_ArryToClone[_IdClone].Constructor == Array)
        	 Clone(_ArryToClone[_IdClone])
	      else
    	     _Clone[_IdClone] = _ArryToClone[_IdClone]
	   return _Clone
     }	

// Ricerca su annunci
	 function f_filtro( fval ){
                //$("#caricamento").empty();
                //$("#caricamento").append(carico);
				//$("#girello").show();
	 		if( fval.length < 2 ){ 
				 righe_cat = Clone( righeIniziali );
				 
				 //mostra_categorie( 0 );
				 mostra_categorie_new( 0 );
				 
				 //load_dati('tutte_categorie');
                //$("#caricamento").empty();
                //$("#caricamento").append(scarico);
			} else {
                //$("#caricamento").empty();
                //$("#caricamento").append(carico);
				 righe_cat.length = 0;
				 for( i = 0; i < righeIniziali.length; i ++ ){
				 	if( righeIniziali[i].titolo_annuncio.indexOf( fval ) >= 0 || righeIniziali[i].annuncio.indexOf( fval ) >= 0 ){
						righe_cat.push( righeIniziali[i] );
					}
				 }
				 //mostra_categorie( 0 );
				 mostra_categorie_new( 0 );
				 
				 //load_dati('tutte_categorie');
				//$("#caricamento").empty();
                //$("#caricamento").append(scarico);
			}
	 }


	 
// INIZIO stato
function stato_ajax( ricevo ){
	//alert ('ricevo:'+ricevo);
	//$("#caricamento").empty();
    //$("#caricamento").append(carico);
	if( (ricevo.substr(0, 6)=='scegli') && ( ricevo.substr(0, 6)=='choose') )
    {
  		 //$('#i_provincia').hide();
	     $('#i_regione').html = '';
         //$("#caricamento").empty();
         //$("#caricamento").append(scarico);
	}
	else
	{
        if(ricevo!='Italia')
		{
		  $('#i_regione').html = '';
		  $('#i_provincia').html = '';
	      $('#i_regione').hide();
		  $('#i_provincia').hide();
		}
		else
		{
		 $.get("ajax_regioni_registrazione.php", function(datiDiRitorno){
			 
			 if( datiDiRitorno.length > 50 ) {
			   $('#i_regione').html(datiDiRitorno);
			   $('option:first','#i_regione').attr( "selected", "selected" );
	           $('#i_regione').show();
	         } else {
			   $('#i_regione').html = '';
	           $('#i_regione').hide();
			 }
		
			 } );


		  $('#i_regione').show();
		  $('#i_provincia').show();
		}
		
    }

}	 
// FINE stato
	 
	 
	 
	 
// INIZIO regioni
function regioniric_ajax( ricevo ){
	$("#caricamento").empty();
    $("#caricamento").append(carico);
	//$("#girello").show();
	
	parametri = ricevo.split('|');
	
    //alert('parametri0:'+parametri[0]+'parametri1:>'+parametri[1]+'<');
		
	if( parametri[1]=='')
    {
	   $('#i_regione').html = '';
       $('#i_regione').hide();
       $('#i_provincia').hide();
	}
	else
	{
		 if( parametri[1]=='Italia')
		 {
			 $.get("ajax_regioni.php", { id_categoria: parametri[0], stato: parametri[1]  }, function(datiDiRitorno){
			 if( datiDiRitorno.length > 50 ) {
			   $('#i_regione').html(datiDiRitorno);
			   $('option:first','#i_regione').attr( "selected", "selected" );
	           $('#i_regione').show();
	         } else {
			   $('#i_regione').html = '';
	           $('#i_regione').hide();
	           $('#i_provincia').hide();
			 }

			 } );
		 }
		 else
		 {
			    //alert('lancio ricerca con solo lo stato');
		 		$('#i_regione').html = '';
	            $('#i_provincia').html = '';
				$('#i_regione').hide();
	            $('#i_provincia').hide();
		 }
		 
		 carico_speciali('azione=vis_cat_spe&id_cate='+parametri[0]+'&id_stato='+parametri[1]+'&id_speciale=');
	
	}
        //$("#girello").hide();
		//$("#caricamento").empty();
	    //$("#caricamento").append(scarico);
}	 
// FINE regioni


	 
// INIZIO provincie
function province_ajax( ricevo ){
	//alert ('ricevo:'+ricevo);
	$("#caricamento").empty();
    $("#caricamento").append(carico);
	if( (ricevo.substr(0, 6)=='scegli') && ( ricevo.substr(0, 6)=='choose') )
    {
  		 //$('#i_provincia').hide();
	     $('#i_provincia').html = '';
         //$("#caricamento").empty();
         //$("#caricamento").append(scarico);
	}
	else
	{
		 $.get("ajax_province_registrazione.php", { stringa: ricevo }, function(datiDiRitorno){
  			//$('#i_provincia').show();
			$('#i_provincia').html(datiDiRitorno);
			$('option:first','#i_provincia').attr( "selected", "selected" );
		    $('#i_provincia').show(datiDiRitorno);
			//alert('datidiritorno'+datiDiRitorno);
		 } );	  	
		$("#caricamento").empty();
	    $("#caricamento").append(scarico);
    }

}	 
// FINE provincie 
	 
// INIZIO provincie ricerca
function provinceric_ajax( ricevo ){
	//alert ('ricevo:'+ricevo);	
	$("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
	parametri = ricevo.split('|');
    //alert('id_categoria:'+parametri[0]+'stato:'+parametri[1]+'regione:'+parametri[2]);
	if( parametri[2]=='')
    {
	   $('#i_provincia').html = '';
       $('#i_provincia').hide();
	}
	
	//else
	//{
		 $.get("ajax_province.php", { id_categoria: parametri[0], stato: parametri[1], regione: parametri[2]  }, function(datiDiRitorno){
		 if( datiDiRitorno.length > 50 ) {
		 
		 //alert(datiDiRitorno);
		 
		   $('#i_provincia').html(datiDiRitorno);
		   $('option:first','#i_provincia').attr( "selected", "selected" );
           $('#i_provincia').show();
         } else {
		   $('#i_provincia').html = '';
           $('#i_provincia').hide();
		 }

		 } );
		 carico_speciali('azione=vis_cat_spe&id_cate='+parametri[0]+'&id_stato='+parametri[1]+'&id_regione='+parametri[2]+'&id_speciale=');
    //}

		//$("#girello").hide();
		//$("#caricamento").empty();
	    //$("#caricamento").append(scarico);
}	 
// FINE provincie 
	 
	 
// go home
function go_home( ricevo ){
	$("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
	window.location = ricevo;

}

function showResponse_password( data )  { 
	if(data[0].ok == 'N')
	{
	   $('#errore_password').html(data[0].errore_cerca_password);
       $('#errore_password').show();
	}
	else
	{
	   $('#colonnacentrale').html(data[0].dati_ritorno);	
	}
	
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
    //$("#girello").hide();
} 
	
function showResponse_utente( data )  { 
	
	if(data[0].ok == 'N')
	{
	   $('#errore_utente_ajax').html(data[0].errore_utente_ajax);
       $('#errore_utente_ajax').show();
	}
	else
	{
	     $('#colonnacentrale').html(data[0].dati_ritorno);	
	}
	
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
	//$("#girello").hide();
	scrollto(getid('body'));
} 	
 
function showResponse_modifica( data )  { 
	
	alert(''+data[0].ok);
	
    /*
	if(data[0].ok == 'N')
	{
	   $('#errore_utente_ajax').html(data[0].errore_utente_ajax);
       $('#errore_utente_ajax').show();
	}
	else
	{
	
	   alert('rit:'+data[0].dati_ritorno);
	
       if( data[0].dati_ritorno.substr(0,1)=='@' )	
	   {
	     //window.location = data[0].dati_ritorno.substr(1,(data[0].dati_ritorno.length-1));
	     $('#colonnacentrale').html(data[0].dati_ritorno);	
	   }
	   else
	   {
	     $('#colonnacentrale').html(data[0].dati_ritorno);	
	   }
	
	}
	
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
	scrollto(getid('body'));
    */
} 	

// INIZIO CONTACTS
function contatti_ajax( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
    $.get("gettpl.php?tpl=contacts_2007_ajax", function(datiDiRitorno){
	$('#colonnacentrale').html(datiDiRitorno);
	 } );	  	

    $('#titolo').empty();
    $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">contacts</h2>');
	utentionline_ajax();
	//$("#girello").hide();
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
	scrollto(getid('body'));
}	 
// FINE CONTACTS



// INIZIO PASS SMARRITA AJAX
function password_smarrita_ajax( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
    $.get("gettpl.php?tpl=password_smarrita_ajax&SCRIPT_NAME=password_cerca_ajax.php&SCRIPT_NAME_RITORNO="+ricevo, function(datiDiRitorno){
	$('#colonnacentrale').html(datiDiRitorno);
	$('#password_smarrita').ajaxForm( { dataType: 'json', beforeSubmit: carico_, success: showResponse_password } ); 	
    //$("#caricamento").empty();
    //$("#caricamento").append(carico);
	 } );	  	

    $('#titolo').empty();
    $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">password smarrita</h2>');
	//$("#girello").hide();
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
}	 
// FINE PASS SMARRITA AJAX

// INIZIO REGISTRAZIONE AJAX
function registrati_ajax( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
	$.get("ajax_registrazione.php?SCRIPT_NAME=aggiungi_utente_ajax.php&SCRIPT_NAME_RITORNO="+ricevo, function(datiDiRitorno){
	//alert(datiDiRitorno);
	$('#colonnacentrale').html(datiDiRitorno);
	load_registrazione();
	$('#iscrizione').ajaxForm( { dataType: 'json', beforeSubmit: Vai_ajax, success: showResponse_utente } ); 	
	} );	  	
	
    $('#titolo').empty();
    $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">registrazione</h2>');
    //$("#girello").hide();
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
	
}	 
// FINE REGISTRAZIONE AJAX	 

// INIZIO MODIFICA REGISTRAZIONE AJAX
function modifica_ajax( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
	$.get("ajax_modifica_registrazione.php?SCRIPT_NAME=modifica_utente_ajax.php&SCRIPT_NAME_RITORNO="+ricevo, function(datiDiRitorno){
	//alert(datiDiRitorno);
	$('#colonnacentrale').html(datiDiRitorno);
	load_registrazione();
	$('#iscrizione').ajaxForm( { dataType: 'json', beforeSubmit: Vai_ajax, success: showResponse_modifica } ); 	
	} );	  	
	
    $('#titolo').empty();
    $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">modifica i tuoi dati personali</h2>');
    
	//$("#girello").hide();
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
	
}	 
// FINE MODIFICA REGISTRAZIONE AJAX	 

	 
// INIZIO LOGIN AJAX
function login_ajax( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
	//$("#girello").show();
	$.getJSON("ajax_login.php?"+ricevo, function(datiDiRitorno){
	login = datiDiRitorno;
	
	if(login[0].ok=='N')
	{
	  $('#errore_utente').html('<td style="font-family:Verdana, Tahoma, Arial; color: #ff0000; text-decoration: none; font-size: 11px;"><b>'+login[0].errore_utente+'<b></td>');
	  $('#errore_utente').show();
    }
	else
	{
	  $('#errore_utente').hide();
	  $('#username').val('');
	  $('#password').val('');
	  $('#form_login').hide();
	  script_name="'script_name="+login[0].script_name+"'";
	
	  $.get("gettpl.php?tpl=login_ok_2007&SCRIPT_NAME="+login[0].script_name + "&cognome=" +login[0].cognome+ "&nome=" +login[0].nome, function(datiDiRitorno){
	  $('#logged').html(datiDiRitorno); } );	  
	  $('#logged').show();  

	  $.get("gettpl.php?tpl=proponi_categoria_2007&SCRIPT_NAME="+login[0].script_name, function(datiDiRitorno){
	  $('#yy').html('<div id="proposta_cat">'+datiDiRitorno+'</div>'); } );	  
	  $('#yy').show();
	  
	  start_nifty();
	}
	  //$("#girello").hide();
	  $("#caricamento").empty();
      $("#caricamento").append(scarico);
	});
}
// FINE LOGIN AJAX
	 
// INIZIO LOGOUT AJAX
function logout_ajax(ricevo){
     $("#caricamento").empty();
     $("#caricamento").append(carico);
	 //$("#girello").show();
     $.get("ajax_logout.php?"+ricevo, function(ritorno){

	 $('div#yy').hide();
     $("#errore_categoria").empty(); 		 
	 
	 //$('#form_login').empty();
	 $.get("gettpl.php?tpl=login_2007_caricare&SCRIPT_NAME="+ricevo, function(datiDiRitorno){
	 $('#form_login').html(datiDiRitorno); } );	  
	 $('#logged').hide();
	 $('#form_login').show();
	 
	 //$("#girello").hide();
	 $("#caricamento").empty();
     $("#caricamento").append(scarico);
	 });
}
// FINE LOGOUT AJAX
	 
// INIZIO CLICK AJAX
function skype_click_ajax(param){
     //alert('parametri'+parametri);
	 $("#caricamento").empty();
     $("#caricamento").append(carico);
	 //$("#girello").show();
	 $.getJSON("lancio_header_skype.php?"+param, function(datiDiRitorno){
	 utente = datiDiRitorno;
	 
	 //alert('dati:'+utente[0].comando);
	 //$("#girello").hide();
	 $("#caricamento").empty();
     $("#caricamento").append(scarico);
     
	 location.href = 'skype:'+utente[0].comando;
	 
	 });
}
// FINE CLICK AJAX	 
	 
	 
// INIZIO UTENTI ONLINE AJAX
function utentionline_ajax(){
     $("#caricamento").empty();
     $("#caricamento").append(carico);
     //$("#girello").show();
	 
	 $.get("ajax_utentionline.php?", function(ritorno){
	 
	 $('#refresh_dati').html(ritorno);
	 $('#dataora').html(ritorno);
	 
	 //$('#dati').highlightFade({color:'yellow', speed:900});
	 //$("#girello").hide();
	 $("#caricamento").empty();
     $("#caricamento").append(scarico);
	 });
}
// FINE UTENTI ONLINE AJAX

// INIZIO CONTROLLO CATEGORIE PROPOSTE
function proponi_categoria( ricevo ){
    $("#caricamento").empty();
    $("#caricamento").append(carico);
	//$("#girello").show();
	$.getJSON("ajax_proponi_categoria.php?"+ricevo, function(datiDiRitorno){
	righe = datiDiRitorno;
	
    $('#errore_categoria').empty();
	$('#errore_categoria').append(righe[0].errore);
	document.proponi_categoria.categoria_proposta.value='';
	//$("#girello").hide();
	$("#caricamento").empty();
    $("#caricamento").append(scarico);
	});
}
// FINE CONTROLLO CATEGORIE PROPOSTE

// INIZIO MOSTRA SPECIALI
function mostra_speciali( start1, ric1 ){
			 recordPerPagina = 10;
			 max = ( start1 + recordPerPagina );
			 if( max > righe_spe.length ){
			 	max = righe_spe.length;
			 }
			 s = '';
			 if(ric1 == undefined){ric1 = '';}
			 des = righe_spe[0].descrizione_categoria;
			 var result = des.toUpperCase();
			 if ( disp1 == 1 )
			 {
               s += '<br><div class="lineDivide5"></div>';
			   s += '<span class="testo"><b>&raquo;&nbsp;'+result+'</b><br>&nbsp;&nbsp;&nbsp;'+righe_spe[0].descrizione_provincia+':&nbsp;<b>'+righe_spe[0].n_r_s+'</b></span><br><br>';
               sped1 = "'tutti_speciali|'";               
			   s += '&nbsp;&nbsp;<a class="ttip" href="javascript: load_dati('+sped1+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a><br>';			   
             }
			 else
			 {
			   s += '';
			   //s += '<p class="testo12nero">In questa sezione sono elencate le attività commerciali per un contatto immediato attraverso <a href="http://www.skype.com" target="_blank"><b>&copy;SKYPE</b></a>. La mappa di <a href="http://maps.google.it/" target="_blank"><b>&copy;GOOGLE</b></a> permette una localizzazione geografica dell’attività. Per il momento questa sezione è completamente gestita da Suskype dopo preventivo contatto con il cliente interessato. email: <a href="mailto:info@suskype.com"><b>info@suskype.com</b></a></p>';
             }
			 
		 
			 ctr=0;
			 for( i = start1; i < max; i++ )
			 {
			    ctr = ctr+1;
				s += '<div id="item2'+ctr+'">';
         
        sped_new = "'speciali|"+i+"'";        
				if (righe_spe[i].peso >= 200)
				{
         if ( righe_spe[i].vis_gog == 'S' )
            {
                s += '<div id="Categorie_arancio_test2" class="mytitle" onClick="load_dati('+sped_new+');"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
				    }
            else
            {
                s += '<div id="Categorie_arancio_test2" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
            } 
        }
                else
				{
				  if ( righe_spe[i].vis_gog == 'S' )
            {
				     s += '<div id="Categorie_arancio_test1" class="mytitle" onClick="load_dati('+sped_new+');"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';
				   }
				   else
				   {
				     s += '<div id="Categorie_arancio_test1" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';           
           }
        }
				
				//s += '<div id="Categorie_arancio_test1" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'</div>';
				s += '<div class="mycontent">';
                if(righe_spe[i].fotopiccola != '')
				{
                s += '<img src="foto_speciali/'+righe_spe[i].fotopiccola+'" border="0">';
				}
				
				//stato skype
				if (righe_spe[i].vis_sky == 'S')
                {
				//s += '<img src="http://mystatus.skype.com/balloon/'+righe_spe[i].utenteskype+'" border="0" align="top" hspace="18"><br>';
				//s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="http://mystatus.skype.com/balloon/'+righe_spe[i].utenteskype+'" border="0"></a><br>';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=skype')\"><img src=\"http://mystatus.skype.com/balloon/"+righe_spe[i].utenteskype+"\" border=\"0\"></a>&nbsp;";
                }
				
				s += '<br>'+righe_spe[i].messaggio+'<br><br>'; 
                
                if(righe_spe[i].indirizzo != '')
				{				
				 s += righe_spe[i].indirizzo+'<br>';
                }
                
				if(righe_spe[i].cap != '')
				{				
				 s += righe_spe[i].cap+'&nbsp;';
                }
				
				if(righe_spe[i].citta != '')
				{				
				 s += righe_spe[i].citta+'&nbsp;('+righe_spe[i].descrizione_provincia+')<br>';
                }
				
				if( (righe_spe[i].telefono != '+39') && (righe_spe[i].vis_tel == 'S'))
				{	
                  s += righe_spe[i].telefono+'<br>';
                }                
				
				if( (righe_spe[i].telefonocell != '+39') && (righe_spe[i].vis_cel == 'S'))
				{	
                  s += righe_spe[i].telefonocell+'<br>';
                }   				
				
				if( (righe_spe[i].fax != '+39') && (righe_spe[i].vis_fax == 'S'))
				{	
                  s += righe_spe[i].fax+'<br>';
                }   

				s += '<br>';
				if(righe_spe[i].foto_1 != '')
				{
                s += '<a id="photo_' + righe_spe[i].id +  '" href="foto_speciali/'+righe_spe[i].foto_1+'" title="foto gallery" class="thickbox ttip" rel="mia'+ctr+'"><img src="images/suskype_photo.gif" border="0"></a>&nbsp;';
				}
                if(righe_spe[i].foto_2 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_2+'" title="" class="thickbox" rel="mia'+ctr+'">foto2</a>';
				}
                if(righe_spe[i].foto_3 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_3+'" title="" class="thickbox" rel="mia'+ctr+'">foto3</a>';
				}
                if(righe_spe[i].foto_4 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_4+'" title="" class="thickbox" rel="mia'+ctr+'">foto4</a>';
				}
                if(righe_spe[i].foto_5 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_5+'" title="" class="thickbox" rel="mia'+ctr+'">foto5</a>';
				}
                if(righe_spe[i].foto_6 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_6+'" title="" class="thickbox" rel="mia'+ctr+'">foto6</a>';
				}
                if(righe_spe[i].foto_7 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_7+'" title="" class="thickbox" rel="mia'+ctr+'">foto7</a>';
				}
                if(righe_spe[i].foto_8 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_8+'" title="" class="thickbox" rel="mia'+ctr+'">foto8</a>';
				}				
				
                //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="images/suskype_skypeme.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;Profilo skype&nbsp;"><img src="images/suskype_info.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;chat con skype&nbsp;"><img src="images/suskype_chat.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_phone.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;chiama al cellulare con skype&nbsp;"><img src="images/suskype_cellphone.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;spedisci email&nbsp;"><img src="images/suskype_email.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;vai al sito web&nbsp;"><img src="images/suskype_www.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;visualizza google earth&nbsp;"><img src="images/suskype_earth.gif" border="0"></a>';
				if (righe_spe[i].vis_sky == 'S')
                {
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="images/suskype_skypeme.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?userinfo" onclick="return skypeCheck();" title="&raquo;&nbsp;Profilo skype&nbsp;"><img src="images/suskype_info.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?chat" onclick="return skypeCheck();"title="&raquo;&nbsp;chat con skype&nbsp;"><img src="images/suskype_chat.gif" border="0"></a>&nbsp;';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=skype')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiamami con skype&nbsp;\"><img src=\"images/suskype_skypeme.gif\" border=\"0\"></a>&nbsp;";
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=profilo')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;Profilo skype&nbsp;\"><img src=\"images/suskype_info.gif\" border=\"0\"></a>&nbsp;";				  
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=chat')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chat con skype&nbsp;\"><img src=\"images/suskype_chat.gif\" border=\"0\"></a>&nbsp;";
                }


				if ( (righe_spe[i].vis_tel == 'S') && (righe_spe[i].telefono != '+39') )
                {
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].telefono+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_phone.gif" border="0"></a>&nbsp;';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=telefono')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiama al telefono con skype&nbsp;\"><img src=\"images/suskype_phone.gif\" border=\"0\"></a>&nbsp;";                
				}
				if ( (righe_spe[i].vis_cel == 'S') && (righe_spe[i].telefonocell != '+39') )
                {
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].telefonocell+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_cellphone.gif" border="0"></a>&nbsp;';
                  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=cellulare')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiama al telefono con skype&nbsp;\"><img src=\"images/suskype_cellphone.gif\" border=\"0\"></a>&nbsp;";                                
				}

				
                if ( righe_spe[i].vis_eml == 'S' )
                {
                  s += '<a class="ttip" href="mailto:'+righe_spe[i].email+'" title="&raquo;&nbsp;spedisci email&nbsp;"><img src="images/suskype_email.gif" border="0"></a>&nbsp;';
                }				
				
				if ( (righe_spe[i].vis_web == 'S') && (righe_spe[i].sitoweb != '') )
                {
                  s += '<a class="ttip" href="http://'+righe_spe[i].sitoweb+'" target="_blank" title="&raquo;&nbsp;vai al sito web&nbsp;"><img src="images/suskype_www.gif" border="0"></a>&nbsp;';
                }
				
				if ( righe_spe[i].vis_gog == 'S' )
                {
				          //sped = "'speciali|"+i+"'";
				          vai = "'body'";
                  s += '<a class="ttip" href="http://www.suskype.com/google_earth.php?id_record='+righe_spe[i].id+'&ut='+righe_spe[i].utenteskype+'&lat='+righe_spe[i].lat+'&lng='+righe_spe[i].lng+'&azione_g=vis_cat_spe" title="&raquo;&nbsp;visualizza su google earth&nbsp"><img src="images/suskype_earth.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="javascript: load_dati('+sped+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>&nbsp;';
                  s += '<a class="ttip" href="javascript: scrollto(getid('+vai+'));" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>&nbsp;';
                
                }
				
				if ( righe_spe[i].video_1 == 'S' )
                {
                s += '<a class="thickbox ttip" href="mostra_video.php?id_video='+righe_spe[i].id+'&KeepThis=true&TB_iframe=true&height=360&width=435" title="&raquo;&nbsp;mostra video&nbsp;"><img src="images/suskype_video.gif" border="0"></a>';				
                }
				
				s += '<br>';

				
				s += '</div>';
				s += '</div>';
			 }


			 s += '<div id="iwl_pagination"><p>';


			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start1 > 0 ){
			 //s += "<a href='#' onClick='javascript: mostra_speciali( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_speciali(" + ( start1 - recordPerPagina) + ");' onClick='javascript: mostra_speciali(" + ( start1 - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='#' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_speciali( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start1 + recordPerPagina < righe_spe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_speciali(" + ( start1 + recordPerPagina) + ");' onClick='javascript: mostra_speciali(" + ( start1 + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;";
				 //s += "<a href='#' onClick='javascript: mostra_speciali(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
			$("#caricamento").empty();
			$("#caricamento").append(scarico);
			//$("#girello").hide();
            $('#list2').empty();
            $('#list2').append(s);


				$(".ttip").Tooltip({showURL: false });
 
                //$(document).ready(TB_init);
				//TB_init();
				
				
				//utentionline_ajax();

	 }
// FINE MOSTRA SPECIALI


	  
// INIZIO CARICAMENTO CANALI
function carico_speciali( ricevo ){

$('#123').hide();

$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$.getJSON("ajax_categorie.php?"+ricevo, function(datiDiRitorno){
righe_spe = datiDiRitorno;
// per visualizzare o meno il titolo e le ricerche categorie
if ( ricevo.indexOf( 'vis_cat_spe' ) >= 0 ){disp1 = 1;}
else{disp1 = 0;}
//alert(righe_spe.length);
//mostra_speciali( 0, ricevo );
//mostra_speciali_new( 0, ricevo );
mostra_speciali_paginati( 0, ricevo );
//alert(righe_spe[0].id_inis);
//if(righe_spe[0].id_inis !='0')
//{
//   salto = 1;
//   id_inis = righe_spe[0].id_inis;
//   load_dati('speciali|0');
//}
//else
//{
	//if(salto==0)
	//{
	//salto = 1;
	//}
	//else
	//{
	//load_dati('tutti_speciali');
	//}
//}
/*
s = '';
for( i = 0; i < righe.length; i ++ ){
s += righe[i].html;
//s += 'Azienda:<b>'+righe[i].azienda+'</b>Categoria:'+righe[i].id_cate+' - '+righe[i].descrizione_categoria+' Provincia:'+righe[i].id_prov+' - '+righe[i].descrizione_provincia+'<br>';
}
//s += '</p>';

$('#colonnacentrale').empty();
$('#colonnacentrale').append(s);
$('#titolo').empty();
$('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">Canali Suskype</h2>');

$("#caricamento").empty();
$("#caricamento").append(scarico);
*/
});
}
// FINE CARICAMENTO CANALI


// INIZIO MOSTRA SPECIALI RICERCA
function mostra_specialiric( start1, ric1 ){
			 recordPerPagina = 10;
			 max = ( start1 + recordPerPagina );
			 if( max > righe_spe.length ){
			 	max = righe_spe.length;
			 }
			 s = '';
			 if(ric1 == undefined){ric1 = '';}
			 des = righe_spe[0].descrizione_categoria;
			 var result = des.toUpperCase();
			 if ( disp1 == 1 )
			 {
               s += '<br><div class="lineDivide5"></div>';
			   s += '<span class="testo"><b>&raquo;&nbsp;'+result+'</b><br>&nbsp;&nbsp;&nbsp;'+righe_spe[0].descrizione_provincia+':&nbsp;<b>'+righe_spe[0].n_r_s+'</b></span><br><br>';
               sped1 = "'tutti_speciali|'";               
			   s += '&nbsp;&nbsp;<a class="ttip" href="javascript: load_dati('+sped1+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a><br>';			   
             }
			 else
			 {
			   s += '';
             }
			 
		 
			 ctr=0;
			 for( i = start1; i < max; i++ )
			 {
			    ctr = ctr+1;
				s += '<div id="item2'+ctr+'">';
         
        sped_new = "'speciali|"+i+"'";        
				if (righe_spe[i].peso >= 200)
				{
         if ( righe_spe[i].vis_gog == 'S' )
            {
                s += '<div id="Categorie_arancio_test2" class="mytitle" onClick="load_dati('+sped_new+');"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
                ////s += '<div id="Categorie_arancio_test2" class="mytitle" onClick="myclick(i);"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
				    }
            else
            {
                s += '<div id="Categorie_arancio_test2" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
            } 
        }
                else
				{
				  if ( righe_spe[i].vis_gog == 'S' )
            {
				     s += '<div id="Categorie_arancio_test1" class="mytitle" onClick="load_dati('+sped_new+');"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';
				     ////s += '<div id="Categorie_arancio_test1" class="mytitle" onClick="myclick(i);"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';
				   }
				   else
				   {
				     s += '<div id="Categorie_arancio_test1" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';           
           }
        }
				

				
				s += '<br>';

				
				s += '</div>';
				//s += '</div>';
			 }


			 s += '<div id="iwl_pagination"><p>';


			 
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start1 > 0 ){
			 s += "<a href='javascript: mostra_speciali(" + ( start1 - recordPerPagina) + ");' onClick='javascript: mostra_speciali(" + ( start1 - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;";
			 
			 }
			 if ( start1 + recordPerPagina < righe_spe.length ) {
				 s += "<a href='javascript: mostra_speciali(" + ( start1 + recordPerPagina) + ");' onClick='javascript: mostra_speciali(" + ( start1 + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;";
			 }
			 s += '</p></div><br>';
			 
			$("#caricamento").empty();
			$("#caricamento").append(scarico);
			 
             $('#list2').empty();
             $('#list2').append(s);

				$(".ttip").Tooltip({showURL: false });
 
                //$(document).ready(TB_init);
				//TB_init();
				
				
				//utentionline_ajax();

	 }
// FINE MOSTRA SPECIALI RICERCA

// INIZIO CARICAMENTO NAZIONI
function carico_nazioni( ricevo ){
	  //alert ('ricevo:'+ricevo);	
	  $("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
	
	$("#catspe").val(ricevo);
	
	if( (ricevo.substr(0, 6)=='scegli') || ( ricevo.substr(0, 6)=='choose') )
    {
         $('#i_stato').hide();
         $('#i_regione').hide();
         $('#i_provincia').hide();
  }
	else
	{
	     //$('#titolo').empty();
         //$('#titolo').append(ricevo); 
	
		 $.get("ajax_nazioni.php", { stringa: ricevo }, function(datiDiRitorno){
		 if( datiDiRitorno.length > 50 ) {
		   $('#i_stato').html(datiDiRitorno);
		   $('option:first','#i_stato').attr( "selected", "selected" );
           $('#i_stato').show();
		   $('#i_regione').hide();
		   $('#i_provincia').hide();
         } else {
		   $('#i_stato').html = '';
           $('#i_stato').hide();
           $('#i_provincia').hide();
		 }

		 // PROVA
		 //alert('categoria:'+$('#catspe').val()+' stato:'+$('#i_stato').val());
		 //regioniric_ajax($('#catspe').val()+'|'+$('#i_stato').val());
		 $("#i_stato").trigger("onchange");
		 //carico_speciali('azione=vis_cat_spe&id_cate='+$('#catspe').val()+'&id_stato='+$('#i_stato').val()+'&id_speciale=');
		 
		 } );	  	
		//$("#girello").hide();
    }
		
    $("#caricamento").empty();
	  $("#caricamento").append(scarico);

}
// FINE CARICAMENTO NAZIONI





// INIZIO CARICAMENTO VETRINA DA RICERCA
function carico_specialiric( ricevo ){
	//alert ('ricevo:'+ricevo);	
	$("#caricamento").empty();
    $("#caricamento").append(carico);
    //$("#girello").show();
	parametri = ricevo.split('|');
    carico_speciali('azione=vis_cat_spe&id_cate='+parametri[0]+'&id_stato='+parametri[1]+'&id_regione='+parametri[2]+'&id_prov='+parametri[3]+'&id_speciale=');
    //$("#girello").hide();
	//$("#caricamento").empty();
	//$("#caricamento").append(scarico);
}
// FINE CARICAMENTO VETRINA DA RICERCA



function myTBShow( a1, a2, a3 ){
	TB_show( a1, 'http://192.168.0.11/suskypenew/' + a2, a3 );
	return false;
}

function attivaLink( s ){

  		// get caption: either title or name attribute
  		
  	var pp = $('a#'+s);
  	
  	alert(pp);
		var caption = pp.title || pp.name || "";
		
  	alert(pp.toString());
		// get rel attribute for image groups
		var group = pp.rel || false;
		
		// display the box for the elements href
		TB_show(caption, pp.href, group);
   return false;

}

// INIZIO MOSTRA CATEGORIE
function mostra_categorie( start, ric ){
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe_cat.length ){
			 	max = righe_cat.length;
			 }
             if(ric == undefined)
			 {
			   ric = '';
			 }
			 
			 //alert('disp:'+disp+' - ric: '+ric);
			 //alert('start:'+start);
			 
			 if ( disp == 1)
			 {
			   if(max > 0)
			   {
			   des = righe_cat[0].descrizione_categoria;
			   var result = des.toUpperCase();
			   //s += '<br><span class="testo"><b>&raquo;&nbsp;'+result+'</b><br>&nbsp;&nbsp;&nbsp;annunci:&nbsp;<b>'+righe_cat[0].n_r_t+'</b></span><br><br>';
               s += '<br><div class="lineDivide5"></div>';
			   s += '<span class="testo"><b>&raquo;&nbsp;'+result+'</b><br>&nbsp;&nbsp;&nbsp;annunci:&nbsp;<b>'+righe_cat.length+'</b></span><br><br>';
               sped1 = "'tutte_categorie|'";               
			   s += '&nbsp;&nbsp;<a class="ttip" href="javascript: load_dati('+sped1+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a><br>';
			   }
			   else
			   {
			   s += '<br><span class="testo"><b>Nessun annuncio trovato</b></span>';			   
			   }
			 }
			 else
			 {
               s += '';
			   //s += '<p class="testo12nero">In questa sezione gli utenti iscritti possono pubblicare gli annunci per categoria associandogli il contatto <a href="http://www.skype.com" target="_blank"><b>&copy;SKYPE</b></a> e la localizzazione con le mappe di <a href="http://maps.google.it/" target="_blank"><b>&copy;GOOGLE</b></a>.</p>';
             }
			 
			 ctr=0;
			 for( i = start; i < max; i++ )
			 {
			   ctr = ctr+1;
			   sped_c = "'categoria|"+i+"'";
				s += '<div id="item3'+ctr+'">';
				if ( righe_cat[i].vis_gog == 'S' )
           {
            s += '<div id="Categorie_arancio_test1" class="mytitle1" onClick="load_dati('+sped_c+');"><b>'+righe_cat[i].titolo_annuncio+'</b><br>'+righe_cat[i].descrizione_categoria+'<br>id:&nbsp;<b>'+righe_cat[i].id_annuncio+'</b></div>';
				   }
				   else
				   {
              s += '<div id="Categorie_arancio_test1" class="mytitle1"><b>'+righe_cat[i].titolo_annuncio+'</b><br>'+righe_cat[i].descrizione_categoria+'<br>id:&nbsp;<b>'+righe_cat[i].id_annuncio+'</b></div>';            
           }
             s += '<div class="mycontent">';
				//stato skype
				if (righe_cat[i].vis_sky == 'S')
                {
				//s += '<a class="ttip" href="skype:'+righe_cat[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="http://mystatus.skype.com/balloon/'+righe_cat[i].utenteskype+'" border="0"></a><br>';
		        s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=A&id_utente="+righe_cat[i].id_utente+"&id_categoria="+righe_cat[i].id_categoria+"&id_annuncio="+righe_cat[i].id_annuncio+"&comando=skype')\"><img src=\"http://mystatus.skype.com/balloon/"+righe_cat[i].utenteskype+"\" border=\"0\"></a>&nbsp;";
                }
				
				
				
				s += righe_cat[i].annuncio+'<br><br>';
                
				if (righe_cat[i].fotopiccola != '')
				{
                  s += '<a class="thickbox ttip" href="foto_annunci/'+righe_cat[i].fotopiccola+'" title="foto annuncio" rel="annu'+ctr+'"><img src="images/suskype_photo.gif" border="0"></a>&nbsp;';
                }
				if (righe_cat[i].fotogrande != '')
				{
                  s += '<a style="display:none;" class="thickbox ttip" href="foto_annunci/'+righe_cat[i].fotogrande+'" title="foto annuncio"  rel="annu'+ctr+'">...</a>';
                }

				if (righe_cat[i].vis_sky == 'S')
                {
                  //s += '<a class="ttip" href="skype:'+righe_cat[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="images/suskype_skypeme.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="skype:'+righe_cat[i].utenteskype+'?userinfo" onclick="return skypeCheck();" title="&raquo;&nbsp;Profilo skype&nbsp;"><img src="images/suskype_info.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="skype:'+righe_cat[i].utenteskype+'?chat" onclick="return skypeCheck();"title="&raquo;&nbsp;chat con skype&nbsp;"><img src="images/suskype_chat.gif" border="0"></a>&nbsp;';
   				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=A&id_utente="+righe_cat[i].id_utente+"&id_categoria="+righe_cat[i].id_categoria+"&id_annuncio="+righe_cat[i].id_annuncio+"&comando=skype')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiamami con skype&nbsp;\"><img src=\"images/suskype_skypeme.gif\" border=\"0\"></a>&nbsp;";
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=A&id_utente="+righe_cat[i].id_utente+"&id_categoria="+righe_cat[i].id_categoria+"&id_annuncio="+righe_cat[i].id_annuncio+"&comando=profilo')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;Profilo skype&nbsp;\"><img src=\"images/suskype_info.gif\" border=\"0\"></a>&nbsp;";				  
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=A&id_utente="+righe_cat[i].id_utente+"&id_categoria="+righe_cat[i].id_categoria+"&id_annuncio="+righe_cat[i].id_annuncio+"&comando=chat')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chat con skype&nbsp;\"><img src=\"images/suskype_chat.gif\" border=\"0\"></a>&nbsp;";
				}
				if ( (righe_cat[i].vis_tel == 'S') && (righe_cat[i].telefono != '+39') )
                {
                  //s += '<a class="ttip" href="skype:'+righe_cat[i].telefono+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_phone.gif" border="0"></a>&nbsp;';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=A&id_utente="+righe_cat[i].id_utente+"&id_categoria="+righe_cat[i].id_categoria+"&id_annuncio="+righe_cat[i].id_annuncio+"&comando=telefono')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiama al telefono con skype&nbsp;\"><img src=\"images/suskype_phone.gif\" border=\"0\"></a>&nbsp;";                
				}
				if ( (righe_cat[i].vis_cel == 'S') && (righe_cat[i].telefonocell != '+39') )
                {
                  //s += '<a class="ttip" href="skype:'+righe_cat[i].telefonocell+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiama al telefono cellulare con skype&nbsp;"><img src="images/suskype_cellphone.gif" border="0"></a>&nbsp;';
                  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=A&id_utente="+righe_cat[i].id_utente+"&id_categoria="+righe_cat[i].id_categoria+"&id_annuncio="+righe_cat[i].id_annuncio+"&comando=cellulare')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiama al telefono cellulare con skype&nbsp;\"><img src=\"images/suskype_cellphone.gif\" border=\"0\"></a>&nbsp;";                                
				}
                if ( righe_cat[i].vis_eml == 'S' )
                {
                  s += '<a class="ttip" href="mailto:'+righe_cat[i].email+'" title="&raquo;&nbsp;spedisci email&nbsp;"><img src="images/suskype_email.gif" border="0"></a>&nbsp;';
                }				
				
				if ( (righe_cat[i].vis_web == 'S') && (righe_cat[i].sitoweb != '') )
                {
                  s += '<a class="ttip" href="http://'+righe_cat[i].sitoweb+'" target="_blank" title="&raquo;&nbsp;vai al sito web&nbsp;"><img src="images/suskype_www.gif" border="0"></a>&nbsp;';
                }
				
				if ( righe_cat[i].vis_gog == 'S' )
                {
                  //sped = "'categoria|"+i+"'";
                  vai = "'body'";
				          //s += '<a class="ttip" href="http://www.suskype.com/google_earth.php?ut='+righe_cat[i].utenteskype+'&lat='+righe_cat[i].lat+'&lng='+righe_cat[i].lng+'&azione_g=" title="&raquo;&nbsp;visualizza su google earth&nbsp"><img src="images/suskype_earth.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="javascript: load_dati('+sped+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>';
                  s += '<a class="ttip" href="javascript: scrollto(getid('+vai+'));" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>';
                  //scrollto(getid('body'));
                }
				if (righe_cat[i].ebay_annuncio != '')
                {
				  s += '<br><br><a class="ttip" href="http://cgi.ebay.it/ws/eBayISAPI.dll?ViewItem&rd=1&item='+righe_cat[i].ebay_annuncio+'&ssPageName=STRK:MESE:IT" target="_blank" title="&raquo;&nbsp;click per accedere direttamente alla vendita sul sito &copy;Ebay"><img src="images/ebay.gif" border="0" alt="Click"></a>&nbsp;asta&nbsp;<a href="http://www.ebay.it" target="_blank" class="testo"><b>&copy;Ebay</b></a>';
                }
				s += '<br>';

				s += '</div>';
				s += '</div>';
			 }
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='#' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_categorie(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_categorie(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='#' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe_cat.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_categorie(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_categorie(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;";
				 //s += "<a href='#' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
			 $("#caricamento").empty();
			 $("#caricamento").append(scarico);
			 
             $('#list2').empty();
             $('#list2').append(s);
             
			 //$('#list3').highlightFade({color:'#AAD74E'});

			$(".ttip").Tooltip({showURL: false });
               
			   //$(document).ready(TB_init);
			   //TB_init();
			   
utentionline_ajax();
	 }
// FINE MOSTRA CATEGORIE


// INIZIO CARICAMENTO ANNUNCI
function carico_categorie( ricevo ){

$("#caricamento").empty();
$("#caricamento").append(carico);

$('#123').hide();

$("#filtro").val('');

//$("#girello").show();
$.getJSON("ajax_categorie.php?"+ricevo, function(datiDiRitorno){
righe_cat = datiDiRitorno;
righeIniziali = Clone( datiDiRitorno );
// per visualizzare o meno il titolo e le ricerche categorie
if ( ricevo.indexOf( 'vis_cat' ) >= 0 )
{
 disp = 1;
 // Abilito ricerca
 Nifty("div#ricerca_annunci","8px");
 $("#ricerca_annunci").show();
 $('#titolo').empty();
 $('#titolo').append(righe_cat[0].descrizione_categoria); 
 //$("#filtro").value('Live search');
}
else{
disp = 0;
 $('#titolo').empty();
 $('#titolo').append(righe_cat[0].titolo); 
}

mostra_categorie_new( 0, ricevo );
//load_dati('tutte_categorie');

});
}
// FINE CARICAMENTO ANNUNCI

// INIZIO MOSTRA NEWS
function mostra_news( start ){
             //$("#caricamento").empty();
			 //$("#caricamento").append(carico);
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage" id="news_normali">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';

             $("#caricamento").empty();
	         $("#caricamento").append(scarico);
             //$("#girello").hide();
			 		
             $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');

             utentionline_ajax();
             scrollto(getid('body'));
	 }
// FINE MOSTRA NEWS

// INIZIO MOSTRA NEWS PLUGIN
function mostra_news_plugin( start ){
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news_plugin/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
             $("#caricamento").empty();
			 $("#caricamento").append(scarico);
             //$("#girello").hide();
             
			 $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');
             utentionline_ajax();
             scrollto(getid('body'));
	 }
// FINE MOSTRA NEWS PLUGIN


// INIZIO MOSTRA NEWS TUTORIAL
function mostra_news_tutorial( start ){
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news_tutorial/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news_tutorial(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news_tutorial(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
             $("#caricamento").empty();
			 $("#caricamento").append(scarico);
			 //$("#girello").hide();
             $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');
             utentionline_ajax();
             scrollto(getid('body'));
	 }
// FINE MOSTRA NEWS TUTORIAL


// INIZIO MOSTRA NEWS VOIP
function mostra_news_voip( start ){
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news_voip/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news_voip(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news_voip(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
             $("#caricamento").empty();
			 $("#caricamento").append(scarico);
             //$("#girello").hide();
			 
             $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');
             utentionline_ajax();
             scrollto(getid('body'));
	 }
// FINE MOSTRA NEWS VOIP

// INIZIO MOSTRA NEWS TECNOLOGIE
function mostra_news_tecnologie( start ){
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news_tecnologie/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news_tecnologie(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news_tecnologie(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
             $("#caricamento").empty();
			 $("#caricamento").append(scarico);
			 //$("#girello").hide();
             $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');
             utentionline_ajax();
             scrollto(getid('body'));
	 }
// FINE MOSTRA NEWS TECNOLOGIE

// INIZIO MOSTRA NEWS GOOGLE EARTH
function mostra_news_googleearth( start ){
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news_googleearth/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news_googleearth(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news_googleearth(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
             $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');
             utentionline_ajax();
             scrollto(getid('body'));
             $("#caricamento").empty();
			 $("#caricamento").append(scarico);
             //$("#girello").hide();

	 }
// FINE MOSTRA NEWS GOOGLE EARTH

// INIZIO MOSTRA NEWS JOOST
function mostra_news_joost( start ){
			 
			 s = '';
			 recordPerPagina = 10;
			 max = ( start + recordPerPagina );
			 if( max > righe.length ){
			 	max = righe.length;
			 }
			 
			 for( i = start; i < max; i++ ){

               s += '<div class="textimage">';
               s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
               if (righe[i].fotopiccola != '')
               {
                  s += '<img src="foto_news_joost/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
               }
               s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
               s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
               s += '<div class="clearer">&nbsp;</div>';
               s += '</div>';
			 }
			 
			 //s += '</div>'; // chiudo list 1
			 //s += '<div class="lineDivideSolid">&nbsp;</div>';
			 s += '<div id="iwl_pagination"><p>';
			 
			 //if (max > 0)
			 //{
			 //s += 'Record trovati: <b>' + righe.length +'</b>&nbsp;Page: ';
			 //}
			 //else
			 if (max = 0)
			 {
			  s += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 if( start > 0 ){
			 //s += "<a href='javascript: mostra_news( 0 );' onClick='javascript: mostra_news( 0 );'>First</a>&nbsp;&nbsp;";
			 s += "<a href='javascript: mostra_news_joost(" + ( start - recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;pagina precedente</a>&nbsp;&nbsp;";
			 
			 }
			 // pagine singole -----
			 //for ( p = 1; p <= Math.ceil( righe.length / recordPerPagina ); p++ )
			 //{
			 // s += "<a href='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );' "+(start / recordPerPagina == p-1 ? 'class="active"':'');
			 // s += "onClick='javascript: mostra_news_plugin( "+((p-1)*recordPerPagina)+" );'>"+p+"</a>&nbsp;"
			 //}
             // fine pagine singole				 
			 if ( start + recordPerPagina < righe.length ) {
				 //alert ('start:'+start);
				 s += "<a href='javascript: mostra_news_joost(" + ( start + recordPerPagina) + ");' onClick='javascript: mostra_news_plugin(" + ( start + recordPerPagina) + ");'>pagina seguente&nbsp;&raquo;</a>&nbsp;&nbsp;";
				 //s += "<a href='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");' onClick='javascript: mostra_news(" + ( Math.floor( righe.length / recordPerPagina ) * recordPerPagina - recordPerPagina)  + ");'>Last</a>&nbsp;&nbsp;";
			 }
			 s += '</p></div><br>';
			 
             $("#caricamento").empty();
			 $("#caricamento").append(scarico);
             //$("#girello").hide();
						  
             $('#colonnacentrale').empty();
             $('#colonnacentrale').append(s);

             $('.textimage').highlightFade({color:'yellow', speed:900});

             $('#titolo').empty();
             $('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">'+righe[0].data_da_vedere+'</h2>');
             utentionline_ajax();
             scrollto(getid('body'));
	 }
// FINE MOSTRA NEWS JOOST



// INIZIO CARICAMENTO NEWS
function carico_news( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
//$("#caricamentoincorso").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;

mostra_news( 0 );

/*
s = '';
for( i = 0; i < righe.length; i ++ ){
s += '<div class="textimage">';
s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
if (righe[i].fotopiccola != '')
   {
   s += '<img src="foto_news/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
   }
   s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
   s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
   s += '<div class="clearer">&nbsp;</div>';
   s += '</div>';
}

$('#colonnacentrale').empty();
$('#colonnacentrale').append(s);

$('#titolo').empty();
$('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">News</h2>');

$("#caricamento").show();
$("#caricamentoincorso").hide();
*/
});
}
// FINE CARICAMENTO NEWS

// INIZIO CARICAMENTO NEWS PLUGIN
function carico_news_plugin( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news_plugin.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;

mostra_news_plugin( 0 );

/*
s = '';
for( i = 0; i < righe.length; i ++ ){
s += '<div class="textimage">';
s += '&nbsp;&raquo;&nbsp;'+righe[i].data;
if (righe[i].fotopiccola != '')
   {
   s += '<img src="foto_news/'+righe[i].fotopiccola+'" border="0" align="right" alt="">';
   }
   s += '<h2 style="color:#00adef;"><b>'+righe[i].titolo+'</b></h2>';
   s += '<p style="text-align: justify; font-family: Verdana, Tahoma, Arial; font-size: 11px;">'+righe[i].descrizione+'</p>';
   s += '<div class="clearer">&nbsp;</div>';
   s += '</div>';
}
$('#colonnacentrale').empty();
$('#colonnacentrale').append(s);

$('#titolo').empty();
$('#titolo').append('<h2 style="color:#00adef; font-size: 18px;">News plugin</h2>');

$("#caricamento").show();
$("#caricamentoincorso").hide();
*/


});
}
// FINE CARICAMENTO NEWS PLUGIN

// INIZIO CARICAMENTO NEWS TUTORIAL
function carico_news_tutorial( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news_tutorial.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;
mostra_news_tutorial( 0 );

});
}
// FINE CARICAMENTO NEWS TUTORIAL

// INIZIO CARICAMENTO NEWS VOIP
function carico_news_voip( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news_voip.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;


mostra_news_voip( 0 );

});
}
// FINE CARICAMENTO NEWS VOIP

// INIZIO CARICAMENTO NEWS TECNOLOGIE
function carico_news_tecnologie( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news_tecnologie.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;


mostra_news_tecnologie( 0 );

});
}
// FINE CARICAMENTO NEWS TECNOLOGIE

// INIZIO CARICAMENTO NEWS GOOGLE EARTH
function carico_news_googleearth( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news_googleearth.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;


mostra_news_googleearth( 0 );

});
}
// FINE CARICAMENTO NEWS GOOGLE EARTH


// INIZIO CARICAMENTO NEWS JOOST
function carico_news_joost( ricevo ){
$("#caricamento").empty();
$("#caricamento").append(carico);
//$("#girello").show();
$('#errore_categoria').empty();

$.getJSON("ajax_news_joost.php?"+ricevo, function(datiDiRitorno){
righe = datiDiRitorno;

mostra_news_joost( 0 );

});
}
// FINE CARICAMENTO NEWS GOOGLE JOOST

function no_spam (user,domain) {
  locationstring = "mailto:" + user + "@" + domain;
  window.location = locationstring;
}



// INIZIO MOSTRA SPECIALI NEW
function mostra_speciali_new( start1, ric1 ){
			 recordPerPagina = 10;
			 recordTrovati = righe_spe[0].n_r_s;
			 
			 if( ( recordTrovati % recordPerPagina )==0) {
				   var pages = ( recordTrovati / recordPerPagina );
			 }else {
				   pages = parseInt(( recordTrovati / recordPerPagina )+1);
			 }			 
	 
			 if(start1==0){
			  pagina = 1;
			 }
			 else {
              pagina = (start1 / recordPerPagina)+1;
			 }
			 
			 //alert('start1:'+start1);
			 
			 max = ( start1 + recordPerPagina );
			 if( max > righe_spe.length ){
			 	max = righe_spe.length;
			 }
			 s = '';
			 /*
			 if(ric1 == undefined){ric1 = '';}
			 des = righe_spe[0].descrizione_categoria;
			 var result = des.toUpperCase();
			 if ( disp1 == 1 )
			 {
               s += '<br><div class="lineDivide5"></div>';
			   s += '<span class="testo"><b>&raquo;&nbsp;'+result+'</b><br>&nbsp;&nbsp;&nbsp;'+righe_spe[0].descrizione_provincia+':&nbsp;<b>'+righe_spe[0].n_r_s+'</b></span><br><br>';
               sped1 = "'tutti_speciali|'";               
			   s += '&nbsp;&nbsp;<a class="ttip" href="javascript: load_dati('+sped1+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a><br>';			   
             }
			 else
			 {
			   s += '';
             }
			 */
		     ctr=0;
			 load_dati('tutti_speciali|'+start1);
			 //alert('tutti_speciali|'+start1);
			 //ctr=0;
			 for( i = start1; i < max; i++ )
			 {
			   ctr++;
			   s += '<table border="0" cellpadding="0" cellspacing="0" id="tab_1_'+ctr+'" class="table" width="240">';
		       s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMe( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].indirizzo+'<br>'+righe_spe[i].descrizione_provincia+'<br>'+righe_spe[i].descrizione_stato+'<br>'+righe_spe[i].id+'</td></tr>';
			   s += '</table>';			 
			 
		      //s += '<p><a>'+righe_spe[i].azienda+'<br>'+righe_spe[i].indirizzo+'<br>'+righe_spe[i].descrizione_provincia+'</a></p>'; 
		 
		     }
			 
/*			   
			 ctr=0;
			 for( i = start1; i < max; i++ )
			 {
			    ctr = ctr+1;
				s += '<div id="item2'+ctr+'">';
         
        sped_new = "'speciali|"+i+"'";        
				if (righe_spe[i].peso >= 200)
				{
         if ( righe_spe[i].vis_gog == 'S' )
            {
                s += '<div id="Categorie_arancio_test2" class="mytitle" onClick="load_dati('+sped_new+');"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
				    }
            else
            {
                s += '<div id="Categorie_arancio_test2" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b></div>';
            } 
        }
                else
				{
				  if ( righe_spe[i].vis_gog == 'S' )
            {
				     s += '<div id="Categorie_arancio_test1" class="mytitle" onClick="load_dati('+sped_new+');"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';
				   }
				   else
				   {
				     s += '<div id="Categorie_arancio_test1" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'<br>id:&nbsp;<b>'+righe_spe[i].id+'</b><br></div>';           
           }
        }
				
				//s += '<div id="Categorie_arancio_test1" class="mytitle"><b>'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].descrizione_categoria+'&nbsp;-&nbsp;'+righe_spe[i].descrizione_provincia+'</div>';
				s += '<div class="mycontent">';
                if(righe_spe[i].fotopiccola != '')
				{
                s += '<img src="foto_speciali/'+righe_spe[i].fotopiccola+'" border="0">';
				}
				
				//stato skype
				if (righe_spe[i].vis_sky == 'S')
                {
				//s += '<img src="http://mystatus.skype.com/balloon/'+righe_spe[i].utenteskype+'" border="0" align="top" hspace="18"><br>';
				//s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="http://mystatus.skype.com/balloon/'+righe_spe[i].utenteskype+'" border="0"></a><br>';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=skype')\"><img src=\"http://mystatus.skype.com/balloon/"+righe_spe[i].utenteskype+"\" border=\"0\"></a>&nbsp;";
                }
				
				s += '<br>'+righe_spe[i].messaggio+'<br><br>'; 
                
                if(righe_spe[i].indirizzo != '')
				{				
				 s += righe_spe[i].indirizzo+'<br>';
                }
                
				if(righe_spe[i].cap != '')
				{				
				 s += righe_spe[i].cap+'&nbsp;';
                }
				
				if(righe_spe[i].citta != '')
				{				
				 s += righe_spe[i].citta+'&nbsp;('+righe_spe[i].descrizione_provincia+')<br>';
                }
				
				if( (righe_spe[i].telefono != '+39') && (righe_spe[i].vis_tel == 'S'))
				{	
                  s += righe_spe[i].telefono+'<br>';
                }                
				
				if( (righe_spe[i].telefonocell != '+39') && (righe_spe[i].vis_cel == 'S'))
				{	
                  s += righe_spe[i].telefonocell+'<br>';
                }   				
				
				if( (righe_spe[i].fax != '+39') && (righe_spe[i].vis_fax == 'S'))
				{	
                  s += righe_spe[i].fax+'<br>';
                }   

				s += '<br>';
				if(righe_spe[i].foto_1 != '')
				{
                s += '<a id="photo_' + righe_spe[i].id +  '" href="foto_speciali/'+righe_spe[i].foto_1+'" title="foto gallery" class="thickbox ttip" rel="mia'+ctr+'"><img src="images/suskype_photo.gif" border="0"></a>&nbsp;';
				}
                if(righe_spe[i].foto_2 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_2+'" title="" class="thickbox" rel="mia'+ctr+'">foto2</a>';
				}
                if(righe_spe[i].foto_3 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_3+'" title="" class="thickbox" rel="mia'+ctr+'">foto3</a>';
				}
                if(righe_spe[i].foto_4 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_4+'" title="" class="thickbox" rel="mia'+ctr+'">foto4</a>';
				}
                if(righe_spe[i].foto_5 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_5+'" title="" class="thickbox" rel="mia'+ctr+'">foto5</a>';
				}
                if(righe_spe[i].foto_6 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_6+'" title="" class="thickbox" rel="mia'+ctr+'">foto6</a>';
				}
                if(righe_spe[i].foto_7 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_7+'" title="" class="thickbox" rel="mia'+ctr+'">foto7</a>';
				}
                if(righe_spe[i].foto_8 != '')
				{
                s += '<a style="display:none;" href="foto_speciali/'+righe_spe[i].foto_8+'" title="" class="thickbox" rel="mia'+ctr+'">foto8</a>';
				}				
				
                //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="images/suskype_skypeme.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;Profilo skype&nbsp;"><img src="images/suskype_info.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;chat con skype&nbsp;"><img src="images/suskype_chat.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_phone.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;chiama al cellulare con skype&nbsp;"><img src="images/suskype_cellphone.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;spedisci email&nbsp;"><img src="images/suskype_email.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;vai al sito web&nbsp;"><img src="images/suskype_www.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>&nbsp;<a class="ttip" href="#" title="&raquo;&nbsp;visualizza google earth&nbsp;"><img src="images/suskype_earth.gif" border="0"></a>';
				if (righe_spe[i].vis_sky == 'S')
                {
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiamami con skype&nbsp;"><img src="images/suskype_skypeme.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?userinfo" onclick="return skypeCheck();" title="&raquo;&nbsp;Profilo skype&nbsp;"><img src="images/suskype_info.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].utenteskype+'?chat" onclick="return skypeCheck();"title="&raquo;&nbsp;chat con skype&nbsp;"><img src="images/suskype_chat.gif" border="0"></a>&nbsp;';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=skype')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiamami con skype&nbsp;\"><img src=\"images/suskype_skypeme.gif\" border=\"0\"></a>&nbsp;";
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=profilo')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;Profilo skype&nbsp;\"><img src=\"images/suskype_info.gif\" border=\"0\"></a>&nbsp;";				  
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=chat')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chat con skype&nbsp;\"><img src=\"images/suskype_chat.gif\" border=\"0\"></a>&nbsp;";
                }


				if ( (righe_spe[i].vis_tel == 'S') && (righe_spe[i].telefono != '+39') )
                {
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].telefono+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_phone.gif" border="0"></a>&nbsp;';
				  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=telefono')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiama al telefono con skype&nbsp;\"><img src=\"images/suskype_phone.gif\" border=\"0\"></a>&nbsp;";                
				}
				if ( (righe_spe[i].vis_cel == 'S') && (righe_spe[i].telefonocell != '+39') )
                {
                  //s += '<a class="ttip" href="skype:'+righe_spe[i].telefonocell+'?call" onclick="return skypeCheck();" title="&raquo;&nbsp;chiama al telefono con skype&nbsp;"><img src="images/suskype_cellphone.gif" border="0"></a>&nbsp;';
                  s += "<a class=\"ttip\" href=\"javascript: skype_click_ajax('tipo=C&id_utente="+righe_spe[i].id+"&id_categoria="+righe_spe[i].id_cate+"&comando=cellulare')\" onclick=\"return skypeCheck();\" title=\"&raquo;&nbsp;chiama al telefono con skype&nbsp;\"><img src=\"images/suskype_cellphone.gif\" border=\"0\"></a>&nbsp;";                                
				}

				
                if ( righe_spe[i].vis_eml == 'S' )
                {
                  s += '<a class="ttip" href="mailto:'+righe_spe[i].email+'" title="&raquo;&nbsp;spedisci email&nbsp;"><img src="images/suskype_email.gif" border="0"></a>&nbsp;';
                }				
				
				if ( (righe_spe[i].vis_web == 'S') && (righe_spe[i].sitoweb != '') )
                {
                  s += '<a class="ttip" href="http://'+righe_spe[i].sitoweb+'" target="_blank" title="&raquo;&nbsp;vai al sito web&nbsp;"><img src="images/suskype_www.gif" border="0"></a>&nbsp;';
                }
				
				if ( righe_spe[i].vis_gog == 'S' )
                {
				          //sped = "'speciali|"+i+"'";
				          vai = "'body'";
                  s += '<a class="ttip" href="http://www.suskype.com/google_earth.php?id_record='+righe_spe[i].id+'&ut='+righe_spe[i].utenteskype+'&lat='+righe_spe[i].lat+'&lng='+righe_spe[i].lng+'&azione_g=vis_cat_spe" title="&raquo;&nbsp;visualizza su google earth&nbsp"><img src="images/suskype_earth.gif" border="0"></a>&nbsp;';
                  //s += '<a class="ttip" href="javascript: load_dati('+sped+')" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>&nbsp;';
                  s += '<a class="ttip" href="javascript: scrollto(getid('+vai+'));" title="&raquo;&nbsp;visualizza mappa google&nbsp;"><img src="images/suskype_map.gif" border="0"></a>&nbsp;';
                
                }
				
				if ( righe_spe[i].video_1 == 'S' )
                {
                s += '<a class="thickbox ttip" href="mostra_video.php?id_video='+righe_spe[i].id+'&KeepThis=true&TB_iframe=true&height=360&width=435" title="&raquo;&nbsp;mostra video&nbsp;"><img src="images/suskype_video.gif" border="0"></a>';				
                }
				
				s += '<br>';

				
				s += '</div>';
				s += '</div>';
			 }


*/			 
/*   ERA QUI */		
             q='<table border="0" cellpadding="3" cellspacing="0" width="100%" height="23"><tr>';	 
			 //q += '<div id="iwl_pagination">';
			 if (max = 0)
			 {
			  q += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 q += '<td width="50%" align="left"><span class="testo">&nbsp;found:&nbsp;<b>'+recordTrovati+'</b>&nbsp;&nbsp;</span></td>';
         	 q += '<td align="center"><span class="testo">'+pagina+'/'+pages+'</span></td>';
        	 q += '<td width="50%" align="right">';
			 if( start1 > 0 ){
			 //q += "<a href='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");' onClick='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");'>&laquo;&nbsp;PREV</a>&nbsp;";
			 q += "<a href='#' onClick='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");'>&laquo;&nbsp;PREV</a>&nbsp;";
			 }
			 else
			 {
             q += '<span class="testo">&laquo;&nbsp;PREV</span>&nbsp;';			 
			 }
			 
			 if ( start1 + recordPerPagina < righe_spe.length ) {
				 //q += "<a href='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");' onClick='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");'>NEXT&nbsp;&raquo;</a>&nbsp;";
				 q += "<a href='#' onClick='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");'>NEXT&nbsp;&raquo;</a>&nbsp;";
			 }
             else
			 {
				 q += '<span class="testo">NEXT&nbsp;&raquo;</span>&nbsp;';			 
			 }
			 q += '</td></tr></table>';
			 //q += '</div>';			 

/*   ERA QUI */			 			 
            
		
			if(q=='')
			{
			  q='Niente paginazione';
			}


			 
             $('#iwl_pagination').empty();
			 $('#listahoteltbs').empty();
             $('#iwl_pagination').append(q);
             $('#listahoteltbs').append(s);
			 $('#iwl_pagination').show();
			 
			 document.getElementById('listahoteltbs').scrollTop = 0;
			 
			 $(".ttip").Tooltip({showURL: false });
 	         start_nifty();
			 //TB_init();

			$("#caricamento").empty();
			$("#caricamento").append(scarico);

			$("#mymaps1").hide();
			
            //$("#girello").hide();

	 }
// FINE MOSTRA SPECIALI NEW


// INIZIO MOSTRA CATEGORIE NEW
function mostra_categorie_new( start, ric ){
			 recordPerPagina = 20;
			 //recordTrovati = righe_cat[0].n_r_t;
			 recordTrovati = righe_cat.length;

			 if( ( recordTrovati % recordPerPagina )==0) {
				   var pages = ( recordTrovati / recordPerPagina );
			 }else {
				   pages = parseInt(( recordTrovati / recordPerPagina )+1);
			 }			 
	 
			 if(start==0){
			  pagina = 1;
			 }
			 else {
              pagina = (start / recordPerPagina)+1;
			 }
			 
			 //alert('start1:'+start1);
			 
			 max = ( start + recordPerPagina );
			 if( max > righe_cat.length ){
			 	max = righe_cat.length;
			 }
			 s = '';
		
		     ctr=0;
			 
			 load_dati('tutte_categorie|'+start);
			 //ctr=0;
			 for( i = start; i < max; i++ )
			 {
			   ctr++;
			   s += '<table border="0" cellpadding="0" cellspacing="0" id="tab_1_'+ctr+'" class="table" width="240">';
		       // completo s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMeCat( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_cat[i].titolo_annuncio+'</b><br>'+righe_cat[i].descrizione_categoria+'<br>'+righe_cat[i].id_annuncio+'</td></tr>';


		       s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMeCat( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_cat[i].titolo_annuncio+'</b><br>'+righe_cat[i].descrizione_categoria+'<br>'
			   
			   if( righe_cat[i].cap != '' )
			   {
	   		   	   s += righe_cat[i].cap+' ';			   
			   }
			   
			   if( righe_cat[i].citta != '' )
			   {
                   s += righe_cat[i].citta;
			   }
			   
			   if( righe_cat[i].sigla_provincia != '' )
			   {
                   s += ' ('+righe_cat[i].sigla_provincia+')';
			   }
			   s += '<br>'+righe_cat[i].descrizione_stato+'</td></tr>';
			   			   
			   //+righe_cat[i].id_annuncio+'</td></tr>';
			   //s += '</td></tr>';			 
			   s += '</table>';			 
		     }
			 
			 
             q='<table border="0" cellpadding="3" cellspacing="0" width="100%" height="23"><tr>';	 
			 //q += '<div id="iwl_pagination">';
			 if (max = 0)
			 {
			  q += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 q += '<td width="45%" align="left"><span class="testo">&nbsp;found:&nbsp;</span><span class="testo" style="color: #FF9900;"><b>'+recordTrovati+'</b>&nbsp;&nbsp;</span></td>';
         	 q += '<td align="center"><span class="testo" style="color: #FF9900;"><b>'+pagina+'</b>/<b>'+pages+'</b></span></td>';
        	 q += '<td width="55%" align="right">';
			 if( start > 0 ){
			 //q += "<a href='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");' onClick='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");'>&laquo;&nbsp;PREV</a>&nbsp;";
			 q += "<a href='#' onClick='javascript: mostra_categorie_new(" + ( start - recordPerPagina) + ");' style='color: #FF9900;'><b>&laquo;&nbsp;prev</b></a>&nbsp;";
			 }
			 else
			 {
             q += '<span class="testo">&laquo;&nbsp;prev</span>&nbsp;';			 
			 }
			 
			 if ( start + recordPerPagina < righe_cat.length ) {
				 //q += "<a href='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");' onClick='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");'>NEXT&nbsp;&raquo;</a>&nbsp;";
				 q += "<a href='#' onClick='javascript: mostra_categorie_new(" + ( start + recordPerPagina) + ");' style='color: #FF9900;'><b>next&nbsp;&raquo;</b></a>&nbsp;";
			 }
             else
			 {
				 q += '<span class="testo">next&nbsp;&raquo;</span>&nbsp;';			 
			 }
			 q += '</td></tr></table>';
			 //q += '</div>';			 

/*   ERA QUI */			 			 
            
		
			if(q=='')
			{
			  q='Niente paginazione';
			}

	       
			 $('#iwl_pagination').empty();
			 $('#listahoteltbs').empty();
             $('#iwl_pagination').append(q);
             $('#listahoteltbs').append(s);
			 $('#iwl_pagination').show();
			 
			 document.getElementById('listahoteltbs').scrollTop = 0;
			 
			 $(".ttip").Tooltip({showURL: false });
 	         start_nifty();
			 //TB_init();

			$("#caricamento").empty();
			$("#caricamento").append(scarico);


            $("#mymaps1").hide();

            //$("#girello").hide();



	 }
// FINE MOSTRA CATEGORIE NEW


// INIZIO MOSTRA MACRO NOCATEGORIA
function mostra_macro_nocategoria( start, ric ){
			 recordPerPagina = 10;
			 //recordTrovati = righe_cat[0].n_r_t;
			 recordTrovati = righe_macro.length;

			 if( ( recordTrovati % recordPerPagina )==0) {
				   var pages = ( recordTrovati / recordPerPagina );
			 }else {
				   pages = parseInt(( recordTrovati / recordPerPagina )+1);
			 }			 
	 
			 if(start==0){
			  pagina = 1;
			 }
			 else {
              pagina = (start / recordPerPagina)+1;
			 }
			 
			 //alert('start1:'+start1);
			 
			 max = ( start + recordPerPagina );
			 if( max > righe_macro.length ){
			 	max = righe_macro.length;
			 }
			 s = '';
		
		     ctr=0;
			 
			 //load_dati('tutte_categorie|'+start);
			 
			 
			 
			 //ctr=0;
			 for( i = start; i < max; i++ )
			 {
			   ctr++;
			   s += '<table border="0" cellpadding="0" cellspacing="0" id="tab_1_'+ctr+'" class="table" width="240">';
	           //s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMeCat( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_cat[i].titolo_annuncio+'</b><br>'+righe_cat[i].descrizione_categoria+'<br>'+righe_cat[i].id_annuncio+'</td></tr>';
			   s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMeCat( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_macro[i].id_macro_nazione+'</b><br>'+righe_macro[i].lat+'<br>'+righe_macro[i].lng+'<br>'+righe_macro[i].tot+'</td></tr>';
			   s += '</table>';			 
		     }
			 
			 
             q='<table border="0" cellpadding="3" cellspacing="0" width="100%" height="23"><tr>';	 
			 //q += '<div id="iwl_pagination">';
			 if (max = 0)
			 {
			  q += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 
			 q += '<td width="50%" align="left"><span class="testo">&nbsp;found:&nbsp;<b>'+recordTrovati+'</b>&nbsp;&nbsp;</span></td>';
         	 q += '<td align="center"><span class="testo">'+pagina+'/'+pages+'</span></td>';
        	 q += '<td width="50%" align="right">';
			 if( start > 0 ){
			 //q += "<a href='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");' onClick='javascript: mostra_speciali_new(" + ( start1 - recordPerPagina) + ");'>&laquo;&nbsp;PREV</a>&nbsp;";
			 q += "<a href='#' onClick='javascript: mostra_macro_nocategoria(" + ( start - recordPerPagina) + ");'>&laquo;&nbsp;PREV</a>&nbsp;";
			 }
			 else
			 {
             q += '<span class="testo">&laquo;&nbsp;PREV</span>&nbsp;';			 
			 }
			 
			 if ( start + recordPerPagina < righe_macro.length ) {
				 //q += "<a href='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");' onClick='javascript: mostra_speciali_new(" + ( start1 + recordPerPagina) + ");'>NEXT&nbsp;&raquo;</a>&nbsp;";
				 q += "<a href='#' onClick='javascript: mostra_macro_nocategoria(" + ( start + recordPerPagina) + ");'>NEXT&nbsp;&raquo;</a>&nbsp;";
			 }
             else
			 {
				 q += '<span class="testo">NEXT&nbsp;&raquo;</span>&nbsp;';			 
			 }
			 q += '</td></tr></table>';
			 //q += '</div>';			 

/*   ERA QUI */			 			 
            
		
			if(q=='')
			{
			  q='Niente paginazione';
			}

	       
			 $('#iwl_pagination').empty();
			 $('#listahoteltbs').empty();
             $('#iwl_pagination').append(q);
             $('#listahoteltbs').append(s);
			 $('#iwl_pagination').show();
			 
			 document.getElementById('listahoteltbs').scrollTop = 0;
			 
			 $(".ttip").Tooltip({showURL: false });
 	         start_nifty();
			 //TB_init();

			$("#caricamento").empty();
			$("#caricamento").append(scarico);


            $("#mymaps1").hide();

            //$("#girello").hide();



	 }
// FINE MOSTRA MACRO NOCATEGORIA


// INIZIO MOSTRA SPECIALI PAGINATI
function mostra_speciali_paginati( start1, ric1 ){
			 recordPerPagina = 10;
			 recordTrovati = righe_spe[0].n_r_s;
	         s = '';
		     ctr=0;
			 load_dati('tutti_speciali|'+start1);
			 for( i = 0; i < righe_spe.length; i++ )
			 {
			   ctr++;
			   s += '<table border="0" cellpadding="0" cellspacing="0" id="tab_1_'+ctr+'" class="table" width="240">';
			   // OK s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMe( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_spe[i].azienda+'</b><br>'+righe_spe[i].indirizzo+'<br>'+righe_spe[i].descrizione_provincia+'<br>'+righe_spe[i].descrizione_stato+'<br>'+righe_spe[i].id+'</td></tr>';
			   s += '<tr><td valign="top" id="tab'+ctr+'" class="test" onmouseover="javascript: onMouseOverMe( this, '+i+','+ctr+' );" onmouseout="javascript: onMouseOutMe( this, '+i+','+ctr+' );" onclick="javascript: onClickMe( this, '+i+','+ctr+');"><b>'+ctr+'.&nbsp;'+righe_spe[i].azienda+'</b><br>';
			   if( righe_spe[i].id_cate == '1' )
			   {
			      s += '<img src="images/'+righe_spe[i].stelle+'stars.png"><br>';
			   }
			   //s += righe_spe[i].indirizzo+'<br>'+righe_spe[i].descrizione_provincia+'<br>'+righe_spe[i].descrizione_stato+'<br>'+righe_spe[i].id+'</td></tr>';
			   s += righe_spe[i].indirizzo+'<br>';
			   
			   if( righe_spe[i].cap != '' )
			   {
	   		   	   s += righe_spe[i].cap+' ';			   
			   }
			   
			   if( righe_spe[i].citta != '' )
			   {
                   s += righe_spe[i].citta;
			   }
			   
			   if( righe_spe[i].sigla_provincia != '' )
			   {
                   s += ' ('+righe_spe[i].sigla_provincia+')';
			   }

			   s += '<br>'+righe_spe[i].descrizione_stato;			   			   
			   
			   if( righe_spe[i].telefono != '' && righe_spe[i].telefono != '+39')
			   {
                   s += '<br>tel.'+righe_spe[i].telefono;
			   }
			   else
			   {
			      s += '<br>&nbsp;';
			   }
			   if( righe_spe[i].fax != ''  && righe_spe[i].fax != '+39')
			   {
                   s += '<br>fax'+righe_spe[i].fax;
			   }
			   else
			   {
			      s += '<br>&nbsp;';
			   }
			   //s += righe_spe[i].citta+' ('+righe_spe[i].sigla_provincia+')<br>';
			   
			   //if( righe_spe[i].regione != '' )
			   //{
               //  s += righe_spe[i].regione+' ';			   
			   //}
			   //else
			   //{
	   		   //	   s += '<br>';			   			   
			   //}
			   //s += righe_spe[i].descrizione_stato+'<br>'+righe_spe[i].id+'</td></tr>';			   
			   s += '</td></tr>';			   			   
			   s += '</table>';			 
		     }
             q='<table border="0" cellpadding="3" cellspacing="0" width="100%" height="23"><tr>';	 
			 //q += '<div id="iwl_pagination">';
			 if (righe_spe.length == 0)
			 {
			  q += 'Spiacente, la tua ricerca non ha prodotto risultati';
			 }
			 q += '<td width="45%" align="left"><span class="testo">&nbsp;found:&nbsp;</span><span class="testo" style="color: #FF9900;"><b>'+recordTrovati+'</b>&nbsp;&nbsp;</span></td>';
         	 q += '<td align="center"><span class="testo" style="color: #FF9900;"><b>'+righe_spe[0].page+'</b>/<b>'+righe_spe[0].tot_pages+'</b></span></td>';
        	 q += '<td width="55%" align="right">';

			 if( eval(righe_spe[0].prev_page) > 0 ){
			 q += "<a href='#' onClick='javascript: carico_speciali(\""+righe_spe[0].RICE+"&page="+righe_spe[0].prev_page+"&limit="+righe_spe[0].limit+"\");' style='color: #FF9900;'><b>&laquo;&nbsp;prev</b></a>&nbsp;";
			 }
			 else
			 {
             q += '<span class="testo"><b>&laquo;&nbsp;prev</b></span>&nbsp;';			 
			 }
			 
			 //alert('next:'+righe_spe[0].next_page+' tot_pages:'+righe_spe[0].tot_pages);
			 
			 if ( eval(righe_spe[0].next_page) <= eval(righe_spe[0].tot_pages) ) {
			    //alert('link next:'+righe_spe[0].next_page+' tot_pages:'+righe_spe[0].tot_pages);
				 q += "<a href='#' onClick='javascript: carico_speciali(\""+righe_spe[0].RICE+"&page="+righe_spe[0].next_page+"&limit="+righe_spe[0].limit+"\");' style='color: #FF9900;'><b>next&nbsp;&raquo;</b></a>&nbsp;";
			 }
             else
			 {
				 q += '<span class="testo"><b>next&nbsp;&raquo;</b></span>&nbsp;';			 
			 }
			 q += '</td></tr></table>';
			 //q += '</div>';			 

			if(q=='')
			{
			  q='Niente paginazione';
			}
             $('#iwl_pagination').empty();
			 $('#listahoteltbs').empty();
             $('#iwl_pagination').append(q);
             $('#listahoteltbs').append(s);
			 $('#iwl_pagination').show();
			 
			 document.getElementById('listahoteltbs').scrollTop = 0;
			 
			 $(".ttip").Tooltip({showURL: false });
 	         start_nifty();
			 //TB_init();

			$("#caricamento").empty();
			$("#caricamento").append(scarico);

			$("#mymaps1").hide();
	 }
// FINE MOSTRA SPECIALI PAGINATI

