<!--
//preload images

var nav_layers = new Array(0,'ulmn_her','ulmn_soc','ulmn_pub','ulmn_hea','ulmn_gov','ulmn_new');

function mn_ShowHide(id_ul) {
	for (i=1; i<7; i++) { document.getElementById(nav_layers[i]).style.display = 'none'; }
	if (id_ul > 0) { document.getElementById(nav_layers[id_ul]).style.display = 'block'; }
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_findObj(n, d) { //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  var newWindow = window.open(theURL,winName,features);
  newWindow.focus();
}

function MM_showHideLayers() { //v6.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v=='hide')?'hidden':v; }
    obj.visibility=v; }
}

// MouseOver
function imgOn(context,menu,name) {
	if (document.images) { document[name].src = "http://www.peelregion.ca/images/" + context + "/" + menu + "/" + name + "_on.gif"; }
}

// MouseOut
function imgOff(context,menu,name) {
	if (document.images) { document[name].src = "http://www.peelregion.ca/images/" + context + "/" + menu + "/" + name + ".gif"; }
}

function popupSurvey() {

// If you want to kill the pop-up, comment out the lines below
// Pop-up survey commented out on July 30th, 2003 by Geoff

//	var gh = GetCookie('evergreen');

//	if (gh == null) {
//		var winl = (screen.width - 450);
//		var wint = 25;
//		winprops = 'height=450,width=425,top='+wint+',left='+winl+',toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars,resizable=yes'
//		win = window.open('/rop-survey.htm', 'exitsurvey', winprops)
//		if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
//	}

// If you want to kill the pop-up, comment out the lines above
}

function popUpWindow(mypage, myname, w, h, scroll) {
	var winl = (screen.width - w) / 2;
	var wint = (screen.height - h) / 2;
	winprops = 'height='+h+',width='+w+',top='+wint+',left='+winl+',toolbar = no, location = no, directories = no, status = no, menubar = no, scrollbars = '+scroll+', resizable = no';
	win = window.open(mypage, myname, winprops)
	if (parseInt(navigator.appVersion) >= 4) { win.window.focus(); }
}

function GetCookie (name) {  
	var arg = name + "=";  
	var alen = arg.length;  
	var clen = document.cookie.length;  
	var i = 0;  
	while (i < clen) {    
		var j = i + alen;    
	if (document.cookie.substring(i, j) == arg)      
		return getCookieVal (j);    
		i = document.cookie.indexOf(" ", i) + 1;    
	if (i == 0) break;   
	}  
	return null;
}

function getCookieVal(offset) {
	var endstr = document.cookie.indexOf (";", offset);
	if (endstr == -1)
	endstr = document.cookie.length;
	return unescape(document.cookie.substring(offset, endstr));
}

function validateSearch(theField) {
    var x = theField.value;
    if (x.length == 0) {
        alert("You have not entered a search string!");
        return false;
    } else if (x == "Search") {
        alert("Please enter a search string");
        return false;
    }
    return true;
}


// meningitis/clinics
site = "http://www.peelregion.ca/health/meningitis/clinics"; // Do not include the final "/"
function combineMenus(frm, menu1, menu2) {
	with (frm) {
		str = menu1.options[menu1.selectedIndex].value;
		url = site + "/" + str + ".htm";
		window.location.href = url;
	   }
}

//Specify affected tags. Add or remove from list:
var tgs = new Array('div','td','tr','p','h1','h2','h3','h4','h5','h6','li','a');

//Specify spectrum of different font sizes:
var szs = new Array( 'xx-small','x-small','small','medium','large','x-large','xx-large' );
var startSz = 2;

function ts( trgt,inc ) {
	if (!document.getElementById) return
	var e = document,cEl = null,sz = startSz,i,j,cTags;
	
	sz += inc;
	if ( sz < 0 ) sz = 0;
	if ( sz > 6 ) sz = 6;
	startSz = sz;
		
	if ( !( cEl = e.getElementById( trgt ) ) ) cEl = e.getElementsByTagName( trgt )[ 0 ];

	cEl.style.fontSize = szs[ sz ];

	for ( i = 0 ; i < tgs.length ; i++ ) {
		cTags = cEl.getElementsByTagName( tgs[ i ] );
		for ( j = 0 ; j < cTags.length ; j++ ) cTags[ j ].style.fontSize = szs[ sz ];
	}
	if(document.getElementById('breadcrumbs')) document.getElementById('breadcrumbs').style.fontSize = "x-small";
	if(document.getElementById('revised')) document.getElementById('revised').style.fontSize = "x-small";
}

function toggleElem(elem) {
	//alert(elem);
	var item = document.getElementById(elem);
	if (item) item.style.display=(item.style.display=='none')?'block':'none';
}

//this is for google analytics========================================================
 var _gaq = _gaq || [];
  _gaq.push(['_setAccount', 'UA-3281846-1']);
  _gaq.push(['_trackPageview']);

  (function() {
    var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
    ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
  })();

// -->

