$(document).ready(function (){    $("#map").width($(window).width()-365)    $("#map").height($(window).height() -115)    jQuery("#main_accordion").accordion({        autoheight: false,        header: "h3",        active:'.selected'    });    jQuery("#sub_1").accordion({        autoheight: false,        active:".selected"    });    jQuery("#sub_2").accordion({        autoheight: false,        active:".selected"    });    jQuery("#sub_3").accordion({        autoheight: false,        active:".selected"    });          $("#legal").fancybox({  'hideOnContentClick': false,        'callbackOnClose':function() {            $("#map").show();        }			});				$("a#legal").click(function () {        $("#map").hide();        return true;    });		    $("#privacy").fancybox({  'hideOnContentClick': false,        'callbackOnClose':function() {            $("#map").show();        }			});				$("a#privacy").click(function () {        $("#map").hide();        return true;    });					$("#feedback").fancybox({  'hideOnContentClick': false,        'callbackOnClose':function() {            $("#map").show();        }			});				$("a#feedback").click(function () {        $("#map").hide();        return true;    });							$("#cancellami").fancybox({'frameWidth':400,'frameHeight':130,  'hideOnContentClick': false,        'callbackOnClose':function() {            //$("#map").show();            window.location.reload('index.php5?p=7&oggetto=mappa');        }			});				$("a#cancellami").click(function () {        $("#map").hide();        return true;    });																	  $("a#inline").fancybox({        'hideOnContentClick': false,        'callbackOnClose':function() {            $("#map").show();        }    });											    $("a#inline").click(function () {        $("#map").hide();        return true;    });});$(function(){    $("#rangeA").daterangepicker({        dateFormat: 'yy-mm-dd',        onClose: function(){            xajax_impostaPeriodo('rangeA',xajax.getFormValues(form_periodo));        }        });});$(window).resize(function () {    $("#map").width($(window).width()-365)    $("#map").height($(window).height()-115)});function apriSecondo(){    $("#main_accordion").accordion("activate", 2)    $("#sub_3").accordion("activate", 2)}function apriPosizioni(){    $("#main_accordion").accordion("activate", 2)    $("#sub_3").accordion("activate", 0)}function apriPosizioniC(){    $("#main_accordion").accordion("activate", 2)    $("#sub_3").accordion("activate", 1)}function scroll(){    $('#pannello_scroll').jScrollPane({        scrollbarWidth:15,        scrollbarMargin:0,        reinitialiseOnImageLoad: true    });}function upload(action_url,isFriend) {    $('#loader').hide();    $('#progress').hide();    var myUpload = $('#upload_link').upload({        name: 'image',        action: action_url,        enctype: 'multipart/form-data',        params: {            upload:'Upload'        },        autoSubmit: true,        onSubmit: function() {            $('#upload_status').html('').hide();            loadingmessage('In fase di caricamento', 'show');        },        onComplete: function(response) {            loadingmessage('', 'hide');            response = unescape(response);            var risp = response.split("|");            var responseType = risp[0];            var responseMsg = risp[1];            if(responseType=="success"){                var current_width = risp[2];                var current_height = risp[3];                $('#upload_status').show().html('<p>L&apos;immagine &egrave; stata caricata correttamente</p>');                //put the image in the appropriate div                $('#uploaded_image').html('<img src="'+responseMsg+'" style="float: left; margin-right: 10px;" id="thumbnail" alt="icona utente " />')                if(isFriend=="true")                    updateFL();                else                    updateMyL();                            }else if(responseType=="error"){                $('#upload_status').show().html('<h1>Error</h1><p>'+responseMsg+'</p>');                $('#uploaded_image').html('');            }else if(responseType=="debug"){                $('#upload_status').show().html('<h1>Mesg</h1><p>'+responseMsg+'</p>');                $('#uploaded_image').html('');            }else{                $('#upload_status').show().html('<h1>Unexpected Error</h1><p>Please try again</p>'+response);                $('#uploaded_image').html('');            }        }    });}function loadingmessage(msg, show_hide){    if(show_hide=="show"){        $('#loader').show();        $('#progress').show().text(msg);        $('#uploaded_image').html('');    }else if(show_hide=="hide"){        $('#loader').hide();        $('#progress').text('').hide();    }else{        $('#loader').hide();        $('#progress').text('').hide();        $('#uploaded_image').html('');    }}