#!/usr/bin/perl

use LWP::Simple;

$cam_off = 0;
$cam_eml = 1;
$cam_off_gif = "/www/html/images/cms/data/vebkamery/cam_off.gif";
$cam_eml_jpg = "/www/html/images/cms/data/vebkamery/cam2.jpg";

$url = "http://78.157.224.30/axis-cgi/jpg/image.cgi?resolution=QCIF&clock=0&date=0&text=0";

if( $cam_off ) {
    print "Content-type: image/gif\n\n";
    if( !open(FILE, $cam_off_gif)  ) {
	print "Error open gif\n";
    }
    print <FILE>;
    close(FILE);
#} elsif ( $cam_eml ) {
#    print "Content-type: image/jpeg\n\n";
#    if( !open(FILE, $cam_eml_jpg)  ) {  
#        print "Error open gif\n";       
#    }                                   
#    print <FILE>;
#    close(FILE);
} else {
    print "Content-type: image/jpeg\n\n";
    print get $url;
}
