function openwindow(url,width,height)
{
	window.open(url,"","toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=yes, resizable=yes, copyhistory=no, width=" + width + ", height=" + height)
}

function showDialog(url, width, height)
	{
	return showWindow(url, false, false, false, false, false, false, true, true, width, height, 0, 0);
	}

	function showWindow(url, isStatus, isResizeable, isScrollbars, isToolbar, isLocation, isFullscreen, isTitlebar, isCentered, width, height, top, left)
	{
		if (isCentered)
		{
			top = (screen.height - height) / 2;
			left = (screen.width - width) / 2;
		}

		open(url, '_blank', 'status=' + (isStatus ? 'yes' : 'no') + ','
		+ 'resizable=' + (isResizeable ? 'yes' : 'no') + ','
		+ 'scrollbars=' + (isScrollbars ? 'yes' : 'no') + ','
		+ 'toolbar=' + (isToolbar ? 'yes' : 'no') + ','
		+ 'location=' + (isLocation ? 'yes' : 'no') + ','
		+ 'fullscreen=' + (isFullscreen ? 'yes' : 'no') + ','
		+ 'titlebar=' + (isTitlebar ? 'yes' : 'no') + ','
		+ 'height=' + height + ',' + 'width=' + width + ','
		+ 'top=' + top + ',' + 'left=' + left);
}

function changeto(ID,stt, n){
	for (i=1; i<n; i++){
		document.getElementById('tab_'+ ID + '_' + i).className='TieuDeBoxTab_off';	
	}
	document.getElementById('tab_'+ ID + '_' + n).className='TieuDeBoxLastTab_off';
	
	for (j=1; j<n+1; j++){
		document.getElementById('tabcontent' + ID + '_' + j).style.display='none';
	}
	
	document.getElementById('tabcontent' + ID + '_' + stt).style.display='';
	
	if (stt==n)
	{
		document.getElementById('tab_'+ ID + '_'+n).className='TieuDeBoxLastTab_on';
	}
	else
	{
		document.getElementById('tab_'+ ID + '_'+stt).className='TieuDeBoxTab_on';
	}
}


// Clock

var clockID = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();

   document.theClock.theTime.value = "" 
                                   + tDate.getHours() + ":" 
                                   + tDate.getMinutes() + ":" 
                                   + tDate.getSeconds();
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}

