/* Date-n-Data.js  output: |Date|Time|OS: os|Browser: browser|Color Depth: ##-bit|  */
/*                 last update: 13-Mar-2005 by: Prof. Michael P. Harris             */
/*    files used:  images/infobar_div.gif   images/infobar_bg.gif   images/1px.gif  */
/*    defined id:  DnD {id=DnD must exist at display pos in the calling HTML page}  */

var idiv = '&nbsp;&nbsp;<img src="./images/infobar_div.gif" '
         + 'width=2 height=16 border=0 align="absbottom">&nbsp;&nbsp;';
var ibg  = '<img src="./images/infobar_bg.gif" '
         + 'width=10 height=23 border=0 align="absbottom">';

var wbID     = "";

function DnDinit() {
wbID = (navigator.userAgent.indexOf("Opera") != -1 && document.getElementById)
	 ? "op": (navigator.userAgent.indexOf("Konqueror") != -1 && document.getElementById)
	 ? "ko": (document.all)
	 ? "ie": (document.layers)
	 ? "nn": (!document.all && document.getElementById)
	 ? "mo": "";
if(wbID != "") { if(wbID != "op") dateNdata(); }
}

function wbWnH(wbW,wbH) {
var wbWidth;
var wbHeight;
if (typeof(window.innerWidth) == 'number') {
			  wbWidth   = window.innerWidth;
			  wbHeight  = window.innerHeight; }
else if(document.documentElement &&
	   (document.documentElement.clientWidth ||
		document.documentElement.clientHeight)) {
			  wbWidth  = document.documentElement.clientWidth;
			  wbHeight = document.documentElement.clientHeight; }
	else if(document.body && (document.body.clientWidth ||
			document.body.clientHeight)) {
			  wbWidth  = document.body.clientWidth;
			  wbHeight = document.body.clientHeight; }
return(wbWidth,wbHeight)
}

function dateNdata() {
var wbW = "";
var wbH = "";
var ampm;
var Hours;
var Mins;
var time   = new Date();
var days   = new Array(
		     'Sunday','Monday','Tuesday','Wednesday','Thursday','Friday','Saturday');
var months = new Array(
			 'Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec');

if(navigator.userAgent.indexOf('IRIX')      != -1)  var OpSys = "Irix";
else if((navigator.userAgent.indexOf('Win') != -1)  &&
		(navigator.userAgent.indexOf('95')  != -1)) var OpSys = "Windows 95";
else if((navigator.userAgent.indexOf('Win') != -1)  &&
		(navigator.userAgent.indexOf('98')  != -1)) var OpSys = "Windows 98";
else if((navigator.userAgent.indexOf('Win') != -1)  &&
		(navigator.userAgent.indexOf('5.1') != -1)) var OpSys = "Windows XP";
else if((navigator.userAgent.indexOf('Win') != -1)  &&
		(navigator.userAgent.indexOf('NT')  != -1)) var OpSys = "Windows NT";
else if (navigator.userAgent.indexOf('Mac') != -1)  var OpSys = "Macintosh";
     else 	   										var OpSys = "Other";

<!-- Time & Date calculations -->
day   = days[time.getDay()];
nday  = time.getDate();
month = months[time.getMonth()];
year  = eval(time.getYear());
Hours = time.getHours();
Mins  = time.getMinutes();
<!-- correct Time & Date variables for display -->
if(year  < 1900) year   = 1900 + eval(year);
if(Hours >=  12) ampm   = " P.M."; else ampm = " A.M.";
if(Hours >   12) Hours -= 12;
if(Hours ==   0) Hours  = 12;
if(Mins  <   10) Mins   = "0" + Mins;

bversion = navigator.appVersion.split("[");
if(wbID == "op") {
   bversion    = navigator.appVersion.split("(");
   bversion[1] = "Opera " + bversion[0]; }
info = navigator.appVersion.split(";");
if(wbID == "mo") {
   nnbrws = navigator.userAgent.split(";");
   if(nnbrws[4]) {
      if(nnbrws[4].match("Netscape")) {
         nnbrws  = nnbrws[4].split("Netscape");
         info[1] = "Netscape " + nnbrws[1]; }
      else {
         nnbrws  = nnbrws[4].split(")");
         info[1] = "Mozilla " + nnbrws[0]; } } }

if(wbID == "mo" || wbID == "op") DnD=document.getElementById("DnD");
if(wbID == "nn")                 DnD=document.layers['nDnD'];
if(wbID == "ie" || wbID == "mo") {
   DnD.innerHTML = '<img src="./images/1px.gif" width=1 height=1 align="absbottom" '
                 + 'vspace=10 border=0><img src="./images/infobar_div.gif" border=0 '
                 + 'width=2 height=16 align="absbottom">&nbsp;InfoBAR:&nbsp;'+ idiv
                 + day + ',&nbsp;' + nday + '-' + month + '-' + year + idiv + Hours
                 + ':' + Mins + ampm + idiv + 'OS:&nbsp;' + OpSys + idiv + 'Browser:'
                 + '&nbsp;' + info[1] + idiv + 'Color Depth:&nbsp;'
                 + screen.colorDepth + '-bit' + idiv; }
else { if(wbID == "nn") {
          DnD.document.write('<span class="time">&nbsp;InfoBAR:&nbsp;' + idiv + day
                            + ',&nbsp;'	+ nday + '-' + month + '-' + year + idiv
                            + Hours + ':' + Mins + ampm + idiv + 'OS:&nbsp;' + OpSys
                            + idiv + wbID + idiv + 'Browser:&nbsp;' + navigator.appName
                            + '&nbsp;' + bversion[0] + idiv + 'Color Depth:&nbsp;'
                            + screen.pixelDepth + '-bit' + idiv + '</span>'); }
       else {
          DnD.document.write('<span class="time" style="position:relative;top:2px">'
          					+ '&nbsp;InfoBAR:&nbsp;' + idiv + day + ',&nbsp;' + nday
          					+ '-' + month + '-' + year + idiv + Hours + ':' + Mins
          					+ ampm + idiv +'OS:&nbsp;' + OpSys + idiv + wbID + idiv
          					+ 'Browser:&nbsp;' + navigator.appName + '&nbsp;'
          					+ bversion[0] + idiv + 'Color Depth:&nbsp;'
          					+ screen.pixelDepth + '-bit' + idiv + '</Span>'); }
     }
DnD.document.close();
}

function policy() {
polwin=window.open('http://www.delmar.edu/Courses/bgsound/SWF/MSLicense.swf','polwin','top=100,left=140,status=0,resizable=1,width=500,height=500');
}
