function fetchDate() {
	var dow = ["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"];
	var mth = ["January","February","March","April","May","June","July","August","September","October","November","December"];
	today = new Date();
	var theDate = "<span class='datefont'>" + dow[today.getDay()] + ", ";
	theDate += mth[today.getMonth()] + " " + today.getDate() + ", " + today.getFullYear() + "</span>";
	return theDate;
}
function fetchTime() {
	today = new Date();
	var thetime = "<span class='datefont'>";
	thetime += (today.getHours() < 10) ? "0" + today.getHours() : today.getHours();
	thetime += (today.getMinutes() < 10) ? ":0" + today.getMinutes() : ":" + today.getMinutes();
	thetime += (today.getSeconds() < 10) ? ":0" + today.getSeconds() : ":" + today.getSeconds();
	thetime += "</span>";
	return thetime;
}
function popWin(fileName,winHeight,winWidth,winScroll) {
  if ( arguments.length < 3 ) winWidth = 431;
  if ( arguments.length < 4 ) winScroll = 0;
  openParms = "toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars="
  openParms += winScroll + ",resizable=1,width="
  openParms += winWidth + ",height="+winHeight
  windowName = "popWin";
  window.open(fileName,windowName,openParms)
}
function addToFav() {
	if ((navigator.platform != "MacPPC")
   && (navigator.appName == "Microsoft Internet Explorer")
   && (navigator.appVersion >= "4")) {
		window.external.AddFavorite(location.href,document.title);
	}
}
function openFull(theURL) {
  window.open(theURL,"fswindow","fullscreen=1,scrollbars=auto");
}
var myWindow;
var popImage;
function openImgWindow(theURL,imgName) {
  var winName = "MBCwin";
  var features = "toolbar=no,location=no,status=no,menubar=no,scrollbars=no,resizable=yes,width=200,height=200"
  popImage = imgName;
  myWindow = window.open(theURL,winName,features);
  setTimeout("myWindow.document.images.popImage.src=popImage;",3000);
}
function isValidEmail(emailAddr) {
  if (window.RegExp) {
    var reg1str = "(@.*@)|(\\.\\.)|(@\\.)|(\\.@)|(^\\.)";
    var reg2str = "^.+\\@(\\[?)[a-zA-Z0-9\\-\\.]+\\.([a-zA-Z]{2,3}|[0-9]{1,3})(\\]?)$";
    var reg1 = new RegExp(reg1str);
    var reg2 = new RegExp(reg2str);
    if (!reg1.test(emailAddr) && reg2.test(emailAddr)) return true;
  } else if (emailAddr.indexOf("@") > 0) return true;
  return false;
}
/* --- start of floating Ad --- */
var popDelay = 3000;
var closeDelay = 15000;
var posLeft = 50;
var posTop = 300;
function showAd() {
  document.all('floatAd').style.left = posLeft;                	
  document.all('floatAd').style.top = posTop;                	
	setTimeout("document.all('floatAd').style.visibility = 'Visible'; initDrag();",popDelay);
	setTimeout("document.all('floatAd').style.visibility = 'Hidden';",popDelay + closeDelay);
}
function initDrag() {
  bMoving = false;
  document.onmousedown = startMove;
  document.onmousemove = moveObj;
  document.onmouseup = new Function("bMoving = false");
}
function startMove() {
  if(event.srcElement.className != "floatHandle") return;
  bMoving = true;
  ob = floatAd;
  xdif = event.clientX-floatAd.style.pixelLeft;
  ydif = event.clientY-floatAd.style.pixelTop;
}
function moveObj() {
  if(!bMoving) return true;
  if(event.button != 1) return true;
  ob.style.pixelLeft = event.clientX - xdif;
  ob.style.pixelTop = event.clientY - ydif;
  return false;
}
/* --- End of floating Ad --- */
