
var all;
function loadall(){

LoadResourceall("AccAvailabilityCalendarCss", "http://web.deskline.net/resources/ColorSchemes/TRENTINO/WHITE/availability_calendar.css","css", function(){
LoadResourceall("AccAvailabilityCalendarObjects", "http://web.deskline.net/resources/js/AccAvailabilityCalendarObjects.js", "js", function(){
        var myOptions = { containerId:"ctl00_ContentPlaceHolder1_divAvailabilityDescription",
                          instanceName:"all",
                          viewMounts: 3,
                          showServiceProviderName: false,
                          showProductName: true,
                          lang: "it",
                          showLegend:true,
                          linkkey:"trentino",
                          applicationPath:"/",
                          serverHost:"http://web.deskline.net",
                          daysOfWeek:['L','M','M','G','V','S','D'],
                          months:['Gen','Feb','Mar','Apr','Mag','Giu','Lug','Ago','Set','Ott','Nov','Dic'],
                          infoIconSrc: "/images/882b77d1-9d4c-4df0-b5ba-4c77905b115b_1/99/Info.gif",
                          texts:['Legenda','disponibile','non disponibile','chiuso','gg'] };
                          
        var myCalendarData = { dbCode: "TRN", 
                               serviseProviderName: "",                                
                               productIds: ['01b2c430-eb66-4792-b33b-9d5af9f592c3','80b568b8-cc77-4725-a58e-659e7061de59','74c3fa1e-faf8-4557-872e-4eabddad3131','7b6cf23b-7311-4954-a7a7-97ecb143d70d','8ad10865-018e-492b-9e05-53da7667632b'],
                               productNames: ['Camera doppia Comfort','Camera multipla Comfort','Camera singola Comfort','Camera doppia Superior','Camera multipla Superior'],
                               startDate:201007};                                                               
        all = new AvailabilityCalendar.Calendar(myCalendarData, myOptions);
        all.add_MonthChangedHandler(function() { alert('rrr') });                                     
});});
}
function LoadResourceall(id, src, type, callback) {
    var resourceObj = document.getElementById(id);
    if (resourceObj == null || resourceObj == "undefined") {
        var head = document.getElementsByTagName("head")[0];
        if(type=="js"){
            resourceObj = document.createElement('script');
            resourceObj.id = id;
            resourceObj.type = 'text/javascript';   
            resourceObj.src = src;
            head.appendChild(resourceObj);
            if (resourceObj.attachEvent) 
                resourceObj.onreadystatechange = function() { if (this.readyState == 'complete' || this.readyState == 'loaded') { callback(); } }
            else 
                resourceObj.addEventListener('load', function() { callback(); }, false); 
        }
        if(type=="css"){
            resourceObj = document.createElement('link');
            resourceObj.id = id;
            resourceObj.rel= "stylesheet";
            resourceObj.type="text/css";
            resourceObj.href= src;
            head.appendChild(resourceObj);
            callback();
        }                     
    } else {
        if(type=="js"){
            if((typeof(AvailabilityCalendar)) != 'undefined')
                callback();
            else
                setTimeout('LoadResourceall("'+id+'","'+ src+'", "'+ type + '",'+callback+')',100);        
        }
        if(type=="css"){
            callback();
        }
    }
}

if( typeof(Sys) != "undefined" && typeof(Sys.Application) != "undefined" ){  Sys.Application.notifyScriptLoaded();}