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.getSeconds();
   if(document.theTimer.theTime.value == 59){
		document.theTimer.minute.value = document.theTimer.minute.value + 1;
   }
   if (document.theTimer.minute.value == "011")
   {
	    Stop();
		parent.window.focus();
		Reset();
		Start();
		clickcall();
   }
   timerID = setTimeout("UpdateTimer()", 1000);
}

function clickcall(){
	window.open('call_me_auto.html','mywindow','width=500,height=325');
}
function Start() {
   tStart   = new Date();
   document.theTimer.theTime.value = "00:00";
   document.theTimer.minute.value = "0";
   timerID  = setTimeout("UpdateTimer()", 1000);
}

function Stop() {
   if(timerID) {
      clearTimeout(timerID);
      timerID  = 0;
   }
   tStart = null;
}

function Reset() {
   tStart = null;
   document.theTimer.theTime.value = "00:00";
}

function HandleOnClose(e) {
	f7_v4=(parseInt(navigator.appVersion)>=4 && parseInt(navigator.appVersion)<=5)?1:0
	f7_ie=(document.all && f7_v4)?1:0
	f7_ns=(document.layers && f7_v4)?1:0
	f7_ff=(document.firefox)?1:0

	if(f7_ff){
		f7_mousex=e.pageX; 
		f7_mousey=e.pageY;
	}
	if(f7_ie){
		f7_mousex=e.clientX; 
		f7_mousey=e.clientY;
	}

	 if(f7_mousey < 0){
		window.open('call_me_auto.html','mywindow','width=500,height=325');
	 }
}
