﻿$(document).ready(function() {
    $("img.morehelp").bt({
        positions: 'most',
        padding: 20,
        width: 200,
        spikeLength: 20,
        spikeGirth: 20,
        cornerRadius: 20,
        fill: 'rgba(6, 59, 112, .8)',
        strokeWidth: 3,
        textzIndex: 9999,
        boxzIndex: 9998,
        wrapperzIndex: 9997,
        strokeStyle: '#FC6600',
        cssStyles: { color: '#FFF', fontWeight: 'bold', fontFamily: 'Arial', fontSize: '11px', lineHeight: '15px' },
        trigger: ['mouseover', 'mouseout'],
        showTip: function(box) {
            $(box).show();
        },
        hideTip: function(box, callback) {
            $(box).hide();
        }
    });
});
$(document).ready(function() {
    $("span.infoHelper").bt({
        positions: 'most',
        padding: 20,
        width: 200,
        spikeLength: 20,
        spikeGirth: 20,
        cornerRadius: 20,
        fill: 'rgba(6, 59, 112, .8)',
        strokeWidth: 3,
        textzIndex: 9999,
        boxzIndex: 9998,
        wrapperzIndex: 9997,
        strokeStyle: '#FC6600',
        cssStyles: { color: '#FFF', fontWeight: 'bold', fontFamily: 'Arial', fontSize: '11px', lineHeight: '15px' },
        trigger: ['mouseover', 'mouseout'],
        showTip: function(box) {
            $(box).show();
        },
        hideTip: function(box, callback) {
            $(box).hide();
        }
    });
});
function PopupComunicazioneOpen() {
    $.fn.popOpen = function() {
        popID = 'popupComunicazione'; //Get Popup Name
        popURL = '#?w=500'; //Get Popup href to define size
        //Pull Query & Variables from href URL
        query = popURL.split('?');
        dim = query[1].split('&');
        popWidth = dim[0].split('=')[1]; //Gets the first query string value
        //Fade in the Popup and add close button
        $('#' + popID).fadeIn().css({ 'width': Number(popWidth) }).prepend('<a href="#" class="close"><img src="/App_Themes/EPLAZA/Images/dummy.gif" class="btn_close" title="Chiudi" alt="Chiudi" /></a>');
        //Define margin for center alignment (vertical + horizontal) - we add 80 to the height/width to accomodate for the padding + border width defined in the css
        var popMargTop = ($('#' + popID).height() + 80) / 2;
        var popMargLeft = ($('#' + popID).width() + 80) / 2;
        //Apply Margin to Popup
        $('#' + popID).css({
            'margin-top': -popMargTop,
            'margin-left': -popMargLeft
        });
        //Fade in Background
        $('body').append('<div id="fade"></div>'); //Add the fade layer to bottom of the body tag.
        $('#fade').css({ 'filter': 'alpha(opacity=80)' }).fadeIn(); //Fade in the fade layer 
    };
    //Close Popups and Fade Layer
    $('a.close, #fade').live('click', function() { //When clicking on the close or fade layer...
        $('#fade , .popup_block').fadeOut(); //fade them both out
        $('#fade').remove();
        return false;
    });
    $('#popupComunicazione').popOpen(); //Run popOpen function once on load
}
function recordOutboundLink(link, category, action) {
    try {
        var pageTracker = _gat._getTracker("UA-7651093-5");
        pageTracker._trackEvent(category, action);
        setTimeout('document.location = "' + link.href + '"', 100)
    } catch (err) { }
}
