BrowserOK =  (((navigator.appName == "Netscape") && (parseInt(navigator.appVersion) >= 3 )) || 
  ((navigator.appName == "Microsoft Internet Explorer") && (parseInt(navigator.appVersion) >= 4 )));

function ImgPreload(img){
 var a=new Image(); a.src=img; return a; 
 }  
 
if(BrowserOK) {

 a0h=ImgPreload('../imgs/img-menu.gif')
 
 a1n=ImgPreload('../imgs/img-localita.gif');
 a2n=ImgPreload('../imgs/img-hotels.gif');
 a3n=ImgPreload('../imgs/img-davedere.gif'); 
 a4n=ImgPreload('../imgs/img-manifestazioni.gif');
 a5n=ImgPreload('../imgs/img-sport.gif');
 a6n=ImgPreload('../imgs/img-arrivare.gif');
 a7n=ImgPreload('../imgs/img-mangiare.gif');
 a8n=ImgPreload('../imgs/img-richieste.gif');
 }
 
 
// funzione per far aprire un pop up
function gowindow(str, titolo,w,h) {
 openwin = window.open(str,titolo,'width='+ w +',height='+ h +',status=no,scrollbars=no,resizable=no,location=no,toolbar=no');
 }

function vai(dove) {
 sito = dove;
 window.open(sito);
}
function cursor_hand(ele) {
 ele.style.cursor = 'pointer';
}



// effetto per i consigliati 
	
$(document).ready(function() {

	//Custom settings
	var style_in = 'easeOutBounce';
	var style_out = 'jswing';
	var speed_in = 1000;
	var speed_out = 300;	

	//Calculation for corners
	var neg = Math.round($('.qitem').width() / 2) * (-1);	
	var pos = neg * (-1);	
	var out = pos * 2;
	
	$('.qitem').each(function () {
	
		//grab the anchor and image path
		url = $(this).find('a').attr('href');
		img = $(this).find('img').attr('src');
		
		//remove the image
		$('img', this).remove();
		
		//append four corners/divs into it
		$(this).append('<DIV class=topLeft></DIV><DIV class=topRight></DIV><DIV class=bottomLeft></DIV><DIV class=bottomRight></DIV>');
		
		//set the background image to all the corners
		$(this).children('div').css('background-image','url('+ img + ')');

		//set the position of corners
		$(this).find('div.topLeft').css({top:0, left:0, width:pos , height:pos});	
		$(this).find('div.topRight').css({top:0, left:pos, width:pos , height:pos});	
		$(this).find('div.bottomLeft').css({bottom:0, left:0, width:pos , height:pos});	
		$(this).find('div.bottomRight').css({bottom:0, left:pos, width:pos , height:pos});	

	}).hover(function () {
	
		//animate the position
		$(this).find('div.topLeft').stop(false, true).animate({top:neg, left:neg}, {duration:speed_out, easing:style_out});	
		$(this).find('div.topRight').stop(false, true).animate({top:neg, left:out}, {duration:speed_out, easing:style_out});	
		$(this).find('div.bottomLeft').stop(false, true).animate({bottom:neg, left:neg}, {duration:speed_out, easing:style_out});	
		$(this).find('div.bottomRight').stop(false, true).animate({bottom:neg, left:out}, {duration:speed_out, easing:style_out});	
				
	},
	
	function () {

		//put corners back to the original position
		$(this).find('div.topLeft').stop(false, true).animate({top:0, left:0}, {duration:speed_in, easing:style_in});	
		$(this).find('div.topRight').stop(false, true).animate({top:0, left:pos}, {duration:speed_in, easing:style_in});	
		$(this).find('div.bottomLeft').stop(false, true).animate({bottom:0, left:0}, {duration:speed_in, easing:style_in});	
		$(this).find('div.bottomRight').stop(false, true).animate({bottom:0, left:pos}, {duration:speed_in, easing:style_in});	
	
	}).click (function () {
		
		//go to the url
		//window.location = $(this).find('a').attr('href');	
		indirizzo = $(this).find('a').attr('href');	
		window.open(indirizzo);
	});

});