function ControlWindowOpen(url,windowName,width,height,directories,location,menubar,scrollbars,status,toolbar,resizable)
  {
   var features =
               "width="        + width +
               ",height="      + height +
               ",directories=" + directories +
               ",location="    + location +
               ",menubar="     + menubar +
               ",scrollbars="  + scrollbars +
               ",status="      + status +
               ",toolbar="     + toolbar +
               ",resizable="   + resizable;
   
    msgWindow=window.open(url, windowName, features);
    if (msgWindow.opener == null) msgWindow.opener= self;
   }

function PrintForm()
  {
   document.FormInenco.buttonprint.style.visibility="hidden";
   document.FormInenco.buttonclosewindow.style.visibility="hidden";
   self.print();
   document.FormInenco.buttonprint.style.visibility="visible";
   document.FormInenco.buttonclosewindow.style.visibility="visible";
  }

var timerID = null;
var timerRunning = false;

function stopclock ()
  {
  if (timerRunning) clearTimerout(timerID);
  timerRunning = false;
  }

function startclock ()
  {
  stopclock();
  showtime();
  }

function showtime ()
  {
  var now = new Date();
  TheDate = "" + now.getDate() + "." + (now.getMonth()+1) + "." + now.getYear()
  var hours   = now.getHours();
  var minutes = now.getMinutes();
  var seconds = now.getSeconds();
  var timeValue = ""  + hours + (((minutes<10) ? ":0" : ":")+minutes) + (((seconds<10) ? ":0" : ":")+seconds);
  document.clock.time.value = " " + showdate() + " - " + timeValue;
  timerID = setTimeout("showtime()",1000);
  timerRunning = true;
  }

function showdate ()
  {
  // Get today's current date.
  var now = new Date();

  // Array list of days.
  var days = new Array('Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');

  // Array list of months.
  var months = new       Array('January','February','March','April','May','June','July','August','September','October','November','December');

  // Calculate the number of the current day in the week.
  var date = ((now.getDate()<10) ? "0" : "")+ now.getDate();

  // Calculate four digit year.
  function fourdigits(number)
    {
     return (number < 1000) ? number + 1900 : number;
    }

  // Join it all together
  today =  days[now.getDay()] + " " +
           months[now.getMonth()] + " " +
           date + ", " +
           (fourdigits(now.getYear())) ;

  // Print out the data.
  // document.clock.fulldate.value = today;
  return today;

  }


function showmonthyear ()
  {
  // Get today's current date.
  var now = new Date();

  // Array list of months.
  var months = new       Array('January','February','March','April','May','June','July','August','September','October','November','December');

  // Calculate four digit year.
  function fourdigits(number)
    {
     return (number < 1000) ? number + 1900 : number;
    }

  // Join it all together
  today =  months[now.getMonth()] + " " + (fourdigits(now.getYear()));

  // Print out the data.
  // document.clock.fulldate.value = today;
  return today;

  }


var DEFAULT_TIMELEFT = 5; 

var timeLeft = DEFAULT_TIMELEFT; 


function countDown() { 
 
timeLeft--; 

setTimeout("countDown()", 1000); 

updateUICounter(); 

if (timeLeft <= 0) { 

document.webcam.src = "webcam/ccam.jpg" + "?" + new Date().getTime(); 

timeLeft = DEFAULT_TIMELEFT; 

} 

} 

function updateUICounter() { 

msg = "Image will reload in " + timeLeft + " " + 

((timeLeft != 1) ? "seconds" : "second") + "..." 

if ((navigator.appName.indexOf("Internet Explorer") != -1) && 

(navigator.appVersion.indexOf("4.") != -1)) 

{ 

lblCounter.innerHTML = msg; 

} 

else 
 
{ 

// on incapable browsers, we update statusbar instead of 

// printing it below image 

window.status = msg; 

} 

}

