errorimg= 0;
camnum= 1;
ipaddr= "http://88.244.112.60:8080/cam_";

function ChangeCam(value, wid, hei)
{
        camnum = value;
        document.images.webcam.width = wid;
        document.images.webcam.height = hei;
        DoIt();
}
function LoadImage()
{
        uniq = Math.random();
        document.images.webcam.src = ipaddr+camnum+".jpg?uniq="+uniq;
        window.status = "[powered by HeMuSo]";
}
function ErrorImage()
{
        errorimg++;
        if (errorimg>1){
              document.images.webcam.onload = "";
              document.images.webcam.src = "offline.jpg";
              }else{
              uniq = Math.random();
            document.images.webcam.src = ipaddr+camnum+".jpg?uniq="+uniq;
              }
}
function DoIt()
{
        errorimg=0;
        window.setTimeout("LoadImage();", 15);
}

document.write('<table width="10" height="10" border=2 bordercolor="#000000" cellpadding="0" cellspacing="0"><tr><td>');
document.write('<img src="loading.jpg" id="webcam" name="webcam" onload="DoIt()" onerror="ErrorImage()" width=320 height=240 border=0 style="border-color:#000000; border-style:solid;">');
document.write('</td></tr></table>');

