﻿// JScript File

function ViewPopup(winname,url){    
    var popwidth=screen.availWidth - 300;
    var popheight=screen.availHeight - 300;
    var popleft = Math.round((screen.availWidth - popwidth) / 2);
    var poptop = Math.round((screen.availHeight - popheight) / 2);
	var args = 'toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=no,scrollbars=yes,width='+ popwidth+',height='+ popheight+',left='+ popleft+',top='+ poptop;	
 window.open(url, winname, args);	

}
function ViewPopup2(winname,url){    
    var popwidth=screen.availWidth - 150;
    var popheight=screen.availHeight - 150;
    var popleft = Math.round((screen.availWidth - popwidth) / 2);
    var poptop = Math.round((screen.availHeight - popheight) / 2);
	var args = 'toolbar=no,status=no,menubar=no,location=no,directories=no,resizable=yes,scrollbars=yes,width='+ popwidth+',height='+ popheight+',left='+ popleft+',top='+ poptop;	
 window.open(url, winname, args);	

}



var imgNo=0;
var i=1;
var imgCount;

function ChangePic(PicPath,picno)
{
imgNo=picno;
i=picno.id;

var PicPath2=PicPath;
document.getElementById('ctl00_ContentPlaceHolder1_FIMG').src= PicPath2 ;
document.getElementById('ctl00_ContentPlaceHolder1_FIMG').focus();
document.getElementById('txtpicno').value=picno;

}


var timerID = 0;
var tStart  = null;


function UpdateTimer() {
   if(timerID) {
      clearTimeout(timerID);
      clockID  = 0;
   }
   

   if(!tStart)
      tStart   = new Date();

   var   tDate = new Date();
   var   tDiff = tDate.getTime() - tStart.getTime();

   tDate.setTime(tDiff);

  // document.theTimer.theTime.value = "" 
                                 //  + tDate.getMinutes() + ":" 
                                 //  + tDate.getSeconds();
                                 var x;
                                 var t;
                                 x=1;
                                 t=i;
                                 if (i==imgCount)
                                 {
                                  i=1;
                             
                                 }
                                 else
                                 {
                                  i= parseInt(t) + parseInt(x);
                                 }
                               
                             
                                 var srcsrc;
                                 srcsrc = document.getElementById(i).src;
                              
                                 srcsrc=srcsrc.replace(/1m/, "1l")
                                  document.getElementById('ctl00_ContentPlaceHolder1_FIMG').src = srcsrc;

   
   timerID = setTimeout("UpdateTimer()", 3000);
}


function Start(imgcp) {

   tStart   = new Date();
   imgCount = imgcp;

   //document.theTimer.theTime.value = "00:00";

   timerID  = setTimeout("UpdateTimer()", 3000);
}


function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }

   tStart = null;
}


function Reset() {
   tStart = null;

   //document.theTimer.theTime.value = "00:00";
   
}
