// JavaScript Document
function detectBrowser() {
	if (!navigator.cookieEnabled) {
		document.write ('<div class="error">Your browser does not support Cookies</div>');
	}
	if (navigator.appName != "Microsoft Internet Explorer") {
		document.write ('<div class="errorBig">In order to use all Content Management System functions, please use Microsoft Internet Explorer browser.</div>');
	}
}

function showConfirm(msg, redirectUrl) {
	var r = confirm(msg);
	if (r == true) {
		location.href = redirectUrl;
	}
	else {
		
	}
}

function openPopup(url, wname, w, h) {
	t = screen.height/2 - h/2;
	l = screen.width/2 - w/2;
	popupw = window.open(url,wname,'toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes,width='+w+',height='+h+',top='+t+',left='+l);
	popupw.focus();
	res_h = parseInt(h) + 35;
	res_w = parseInt(w) + 10;
	popupw.resizeTo(res_w,res_h);
	//alert(url);
}



var clockID = 0;

function UpdateClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }

   var tDate = new Date();

   document.getElementById('TheClock').innerHTML = "" 
                                   + (tDate.getHours() < 10 ? '0'+tDate.getHours() : tDate.getHours()) + ":" 
                                   + (tDate.getMinutes() < 10 ? '0'+tDate.getMinutes() : tDate.getMinutes());
   
   clockID = setTimeout("UpdateClock()", 1000);
}
function StartClock() {
   clockID = setTimeout("UpdateClock()", 500);
}

function KillClock() {
   if(clockID) {
      clearTimeout(clockID);
      clockID  = 0;
   }
}
