
function setPd(pd){
    document.getElementById("pd").value=pd;
}
function saveVMS(){
    xGetElementById("configButtons").style.display="none";
    xGetElementById("saveProgress").style.display="block";
    if (isNumeric(document.getElementById("pd").value))
        document.vmsConfig.setPD(document.getElementById("pd").value);
    var res = document.vmsConfig.saveSettings();    
//alert("["+res+"]");
    if (res!=true){
        alert("Error saving configuration.");
        xGetElementById("saveProgress").style.display="none";
        xGetElementById("configButtons").style.display="block";; 
    }else{
        document.formForward.vid.value = document.vmsConfig.getVMSid();      
        document.formForward.submit();
    }
}
function isNumeric(data){
    return parseFloat(data)==data;
}
function restartVMS(){
//        document.vmsConfig.restartVMS();
    location.reload();
}
function choosePhoto()
{
     location.reload();
}

function vmsResize()
{
    var w = xWidth("appletDiv");
//    document.vmsConfig.width=w;
    document.vmsConfig.width=w;
    document.vmsConfig.height=((w*4)/3);
//alert("set applet to "+w+" x "+((w*4)/3));       
}

if (document.getElementById("vmsConfig")!=null)
    vmsResize();

function init()
{
    vmsResize();
}

