﻿// visa webbkamera-fönstret
function ShowCam(url, w, h, info)
{    
    Get("CamWindow").style.display = "block";
    Get("CamWindow").style.width = w + "px";
    Get("CamWindow").style.height = h + "px";
    Get("CamWindow").style.top = (380 - h / 2) + "px";
    Get("CamWindow").style.left = 220 + (Get("MapFrame").clientWidth - w) / 2 + "px";
            
    Get("CamFrame").style.width = w + "px";
    Get("CamFrame").style.height = (h - 15) + "px";
    
    Get("CamInfo").innerHTML = info;
    
    Get("CamFrame").src = url;
} 

// stäng webbkamera-fönstret
function CloseCam()
{
    Get("CamWindow").style.display = "none"; 
    Get("CamFrame").src = "";
} 

// anropas när fönstret ändrar storlek
function ResizeWebcamModule()
{
    // centrera om webbkamerafönstret ifall det visas
    if (Get("CamWindow").style.display == "block") Get("CamWindow").style.left = 220 + (Get("MapFrame").clientWidth - Get("CamWindow").clientWidth) / 2 + "px";
}
        
// initialisering av modulen
function InitWebcamModule()
{

}
