﻿// Initialize Floor Plan.
function InitializeFloorPlan(eventId, floorId) {
    var data = eventId + "|" + floorId;
    PageMethods.GetFloorData(data, OnSucceeded, OnFailed);
}

function OnSucceeded(result, userContext, methodName) {
    //$get('uxUpdateLabel').innerHTML = result;
    //var isInternetExplorer = navigator.appName.indexOf("Microsoft") != -1;

    // get flash object
    flash = getSWF("FlashFloorPlan");
    flash.LoadFloor(result);
}

function OnFailed(error, userContext, methodName) {
    //alert(error);
    //$get('uxUpdateLabel').innerHTML = "An error occured.";
}

function getSWF(movieName) {
    if (navigator.appName.indexOf("Microsoft") != -1) {
        //return window[movieName];
        return document.getElementById("FlashFloorPlan");
    }
    else {
        if (document[movieName].length != undefined) {
            return document[movieName][1];
        }
        return document[movieName];
        
    }
}

function ShowBooth(highlightBooths) {
    flash = getSWF("FlashFloorPlan");
    flash.HighlightBooth(highlightBooths);
}

function StopShowBooth(stophighlightBooths) {
    flash = getSWF("FlashFloorPlan");
    flash.StopHighlightBooth(stophighlightBooths);
}
