
// inizializzaizone 
jQuery(document).ready(function($) {
  
  //Funzione per generare le animazioni di zoom delle immagini 
 !function AnimateZoomImage($) {

        var appendTo = "body";
        $(".img-to-zoom").hoverIntent(function () {
            var $this = $(this);
            var width = $this.width();
            var height = $this.height();
            var offset = $this.offset();

            var $clone = $this
                    .stop()
                    .clone()
                    .appendTo(appendTo);

					$clone.css({
						width: "auto",
						height: "auto"
					});
					
			var cloneWidth = $clone.width()  ;
            var cloneHeight = $clone.height() ;
			
			
		
            $clone
					.addClass ("zoomed-image")
                    .css({
                        position: "absolute",
                        zIndex: "10000",
                        top: offset.top,
                        left: offset.left,
                        width: width,
                       height: height,
						margin: 0
                    })
                    .animate({
                        width: cloneWidth + "px",
                        height: cloneHeight + "px",
					//	left: offset.left - (cloneWidth) + width
                    }, 500)
                    .mouseout(function () {
                        $(this)
                            .stop()
                            .animate({
                                width: width,
                                height: height,
								left: offset.left
                            }, 300, function () {
                                $(this).remove();
                        });
                    });

        }, function () { });	
  
  	} (jQuery);

});





function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}



// ============ Apre la Newsletter in pop-up

function ApriNewsletter()
{
    var t = jQuery('#dvNewsletterOver #dvLgnCnt');
    jQuery('#dvNewsletterOver').jqm({ 
        overlay: 50, 
        //ajax:'/login.aspx',
        target: t,
        modal: true/*, /* FORCE FOCUS */
        /*onHide: function(h) { 
        	t.html('Please Wait...');  // Clear Content HTML on Hide.
			h.o.remove(); // remove overlay
            h.w.fadeOut(888); // hide window 
        }*/
    });
    jQuery('#dvNewsletterOver').jqmShow();
    
    //document.getElementById('ctl00_incLogin_txtUsr').focus();
}


// apre / chiude

var oldid='';
function Apri(div) {

	var obj;
	obj = MM_findObj('div_'+div);

	obj.className = 'dvShow';

}

function Chiudi(div) {

	var obj;
	obj = MM_findObj('div_'+div);

		obj.className = 'dvHide' ;

}

var newid=-1;
function ApriChiudi(ID, Max)
{
	if (newid!=ID)
	{
		newid = ID;
		for(var i = 0; i < Max; i++)
		{
			Chiudi(i+1);
		}
		Apri(ID);
	}
	else
	{
		newid = -1;
		Chiudi(ID);
	}
}



/* ================ */

function ApriPopImg(Url, Wid, Hei)
{
	window.open (Url, 'Window', 'toolbar=no,status=no,menubar=no,scrollbars=no,resizable=no,width='+Wid+',height='+Hei);
}





