// JavaScript Document

function writeDate()
{
  today = new Date();
  caDay = new Array("Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday");
  caMon = new Array("January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December");

  iDate = today.getDate();
  iDay  = today.getDay();
  iMon  = today.getMonth();
  iYear = today.getFullYear();

  document.write( caDay[iDay] + '  ' + caMon[iMon] + ' ' + iDate + ', ' + iYear );
}

function writeBanner()
{
	document.write("<MAP name=\"map1\">\n");
	document.write("<AREA shape=RECT alt=\"Organization Chart of the Utah Department of Health\" coords=573,3,662,14 href=\"http://health.utah.gov/html/div_offices.html\">\n");
	document.write("<AREA shape=RECT alt=\"General information about the Utah Department of Health\" coords=482,3,561,14 href=\"http://health.utah.gov/html/utah_doh.html\">\n");
	document.write("<AREA shape=RECT alt=\"List of important contacts in the Utah Department of Health\" coords=379,3,471,14 href=\"http://health.utah.gov/html/contact_us.html\">\n");
	document.write("<AREA shape=RECT alt=\"Alphabetical list of services, programs, and related links\" coords=283,3,372,15 href=\"http://health.utah.gov/alphalist.html\">\n");
	document.write("<AREA shape=RECT alt=\"Links to public health data sites\" coords=192,3,269,15 href=\"http://health.utah.gov/html/health_data.html\">\n");
	document.write("<AREA shape=RECT alt=\"News releases, media, marketing and public information\" coords=141,2,182,15 href=\"http://health.utah.gov/html/press_releases.html\">\n");
	document.write("<AREA shape=RECT alt=\"Utah Department of Health Internet site Home page\" coords=2,3,130,33 href=\"http://health.utah.gov/\">\n");
	document.write("<AREA shape=RECT alt=\"General Mailing Address: PO Box 141010, Salt Lake City, Utah, 84114-1010\" coords=148,22,466,31>\n");
	document.write("<AREA shape=RECT alt=\"General Phone Number: 801/538/6101\" coords=493,22,661,31>\n");
	document.write("</MAP>\n");
	document.write("<IMG src=\"http://health.utah.gov/UDOHbanner.gif\" alt=\"Internet Site navigation banner\" width=755 height=35 border=0 useMap=../Admin/include/%22#map1/%22>\n");
}

function writeModified()
{
	date = document.lastModified;
	//iDay = date.getDay();
	document.write("<br>Page last modified:"+date+" \n");
}

function writeFooter()
{
  now = new Date();
  iYear = now.getFullYear();
  document.write( '<strong>© Copyright '+ iYear + ', Utah Department of Health</strong>. All rights reserved.<br>\n');
}

function writeFooter2(comp, email)
{
  now = new Date();
  iYear = now.getFullYear();

  //document.write( '<strong>© Copyright '+ iYear + ', '+comp+'</strong>. All material found on this site are copyrighted.<BR>No material may be reproduced or reused without explicit permission from <strong>'+comp+'</strong>.');
  document.write( '<strong>© Copyright '+ iYear + ', '+comp+'</strong>. All rights reserved.<br>\n');
  if(email != undefined)
  	document.write( '<a href='+email+' onMouseOut=\"window.status=\' \';return true\" onMouseOver=\"window.status=\'Comments or Questions?!! Send me an E-mail\'; return true\">'+email+'</a>' );
}

function OpenImg(pic)                                                       
{                    
	var pics = true;                                      
    pics=window.open( '', 'pics', "width=384,height=288,toolbar=no,location=no,menubar=no,scrollbars=no,resizable=no,maximize=no,titlebar=no");
    pics.moveTo(0,0);
	pics.document.write("<html><head><title>SonicFuzion</title></head>\n");
    pics.document.write("<body bgcolor='#FFFFFF' text=#FFFFFF link=#FFCC33 vlink=#CCCCCC vspace=0 hspace=0 marginheight=0 marginwidth=0 leftmargin=0 topmargin=0 onLoad=\"setTimeout('window.close()',10000)\">\n");
    pics.document.write("<script language=JavaScript>setTimeout('document.close()',1000)</script>\n");
    pics.document.write("<center><img src='../Admin/include/images/%22%2Bpic%2B%22' alt='Expanded View' border='0' width='384' height='288'></center>\n");
    pics.document.write("</body></html>");
}

function openWin(content)
{
	wins=window.open('','wins',"width=320,height=240,toolbar=no,location=no,menubar=no,scrollbars=auto,resizable=no,maximize=no,titlebar=no");
	wins.document.write("<html><head><style>body{font-size:12px; font-family: arial,verdana,helvetica,geneva; color:#000000; background: white;}</style></head><body>");
	wins.document.write(content);
	wins.document.write("</body></html>");
}

function openPage(url)
{
	wins=window.open(url,'wins',"width=600,height=800,toolbar=no,location=no,menubar=no,scrollbars=auto,resizable=no,maximize=no,titlebar=no");
}


function ClearAll()
{
	var ml = document.form1;
	var len = ml.elements.length;
	for (var i = 0; i < len; i++) {
	    var e = ml.elements[i];
	    if (e.name == "delItem") {
		e.checked = false;
	    }
	}
	ml.toggleAll.checked = false;
}

function Delete()
{        
	ml = document.form1;
	len = ml.elements.length;

	x = 0;
	for(var i = 0 ; i < len ; i++) {
	    if (ml.elements[i].name == "delItem" && ml.elements[i].checked) {
		x++;
	    }
	}
	if (x) {
	    if (!confirm("Are you sure you want to delete "+x+" rows?")) {
		ClearAll();
		return;
	    }
	}
	var ml=document.form1;
	ml.submit();
}

function showMsg(layerName) {
	newsLayer = document.getElementById(layerName).style;
	if( newsLayer.visibility == "hidden")	
		newsLayer.visibility = "visible";
	else
		newsLayer.visibility = "hidden";
	
	return true;
}

function preloadImages()
{
  if(document.images)
  {
    if(!document.imageArray) document.imageArray = new Array();
    var i,j = document.imageArray.length, args = preloadImages.arguments;
    
    for(i=0; i<args.length; i++)
    {
      if (args[i].indexOf("#")!=0)
      {
        document.imageArray[j] = new Image;
        document.imageArray[j++].src = args[i];
      }
    }
  }
}
