// ------- Call loadingpage function after page load - This allows workarea to work -------------
// for Internet Explorer (using conditional comments)
/*@cc_on @*/
/*@if (@_win32)

document.write("<script id=__ie_onload defer src=javascript:void(0)><\/script>");
var script = document.getElementById("__ie_onload");
script.onreadystatechange = function() {

  if (this.readyState == "complete") {
 //alert("page loaded");

    setTimeout("loadingpage();",300); // call the onload handler
  }
};
/*@end @*/
////////////////////////////////////////////////////////////////////
//if (/WebKit/i.test(navigator.userAgent)) { // sniff
//  var _timer = setInterval(function() {
//    if (/loaded|complete/.test(document.readyState)) {
//      clearInterval(_timer);
//      loadingpage(); // call the onload handler
//    }
//  }, 10);
//}

//if (document.addEventListener) {
//       document.addEventListener("DOMContentLoaded", loadingpage, false);
//   }
//////////////////////////////////////////////////////////////////////   
   
  

 
   
// ---------------------------------------------------------------------   
// ------- loadingpage function - All Onload calls go here -------------   
// --------------------------------------------------------------------- 
function loadingpage() 
{  

//runSlideShow();

        //var txt= document.getElementById("CalList").value;
        //alert(txt);

var CalCk=getQueryVariable('Cal');
//alert(CalCk);
//if (CalCk!==1){toggleBox('CalMonth','CalList',0,1);} else {toggleBox('CalMonth','CalList',1,0);}
//if (CalCk=='undefined'){toggleBox('CalMonth','CalList',0,1);} else {toggleBox('CalMonth','CalList',1,0);}
if (CalCk==null){toggleBox('CalMonth','CalList',1,0);} else {toggleBox('CalMonth','CalList',0,1);}
   
// leaving site alert
		links = document.getElementsByTagName('a');
 		 
		for(i=0; i<links.length; i++)
		{  
		
		if (String(document.links[i].href).search(/peoria|mailto|javascript/i)== -1) {
  			links[i].onclick = function() {alert('You are now leaving the City of Peoria, AZ Website. -  This link will open in a new window');}
  			links[i].target ='_blank'
 			}
 		if (String(document.links[i].href).search(/chamber/i)> 0) {
 		links[i].onclick = function() {alert('You are now leaving the City of Peoria, AZ Website. -  This link will open in a new window');}
  			links[i].target ='_blank'
 		}
	}  
	// -leaving Site end 

 

var CookieCK=document.cookie.length;
//alert(CookieCK);

      if(CookieCK>0){
      setDefaultFontSize();
            
      }else{
           changeFont('small_font'); }



}  
// ---------------------------------------------------------------------  
// ------- END loadingpage function - All Onload calls go here -------------   
// --------------------------------------------------------------------- 

function getQueryVariable(variable) {

  var query = window.location.search.substring(1);
  var vars = query.split("&");
 // alert(query);
  for (var i=0;i<vars.length;i++) {
    var pair = vars[i].split("=");
    if (pair[0] == variable) {
    //alert('Query Variable ' + variable + ' found');
      return pair[1];
    }
  } 
  //alert('Query Variable ' + variable + ' not found');
}




/*window.onload=loadingpage;


/*******************************************************************
* JavaScript/CSS Font Size Changer (Persistent Between Pages)
* (c) DB Design, All rights are reserved
* http://phpscriptindex.com, phpsales@gmail.com
********************************************************************
* Script will allow user to visually change font size. Font size 
* will persist thru page change using a cookie.
********************************************************************
* Directions: Change fontElementId var to the element id you wish to
* allow users to change font sizes. 
********************************************************************
* Tip: Next span element inside normal div to inherit parent style
* but enable use to change font size.
*******************************************************************
* FireFox 2.0.0.3 Tested
* MS IE 7 Tested
* Netscape 8.1.2 Tested
* Opera 9.1 Tested
******************************************************************/
var X = 6;

//DO NOT MODIFY BELOW

/* Module Change Font (string) */
function changeFont(fontClass){
 
	for(var i=1; i<7; i++){
		var element = document.getElementById("content"+i);
		if( element ) element.className = fontClass;
		setCookie("fontSize", fontClass, 5);

		
	}
}		

/* Module Set Default Font Size (void) */
function setDefaultFontSize(){
	var fontSize = getCookie("fontSize");
	
	if(fontSize){
		for(var i=1; i<X; i++){
			var element = document.getElementById("content"+i);
			//alert(fontSize);
			if( element ) element.className = fontSize;
		}
	}
	else {
		for(var i=1; i<X; i++){
			var element = document.getElementById("content"+i);
			if( element ) element.className = "default_font";
		}
	}	
}

/* Module Set Cookie (string, string, int) -- http://www.w3schools.com/js/js_cookies.asp */
function setCookie(c_name,value,expiredays){
	var exdate=new Date();
	exdate.setDate(exdate.getDate()+expiredays);
	document.cookie=c_name+ "=" +escape(value)+ ((expiredays==null) ? "" : ";expires="+exdate.toGMTString());
}
/* Module Get Cookie (string) -- http://www.w3schools.com/js/js_cookies.asp */
function getCookie(c_name){
	if(document.cookie.length>0){
		c_start=document.cookie.indexOf(c_name + "=");
		if (c_start!=-1){ 
			c_start=c_start + c_name.length+1;
			c_end=document.cookie.indexOf(";",c_start);
			if (c_end==-1) c_end=document.cookie.length;
			return unescape(document.cookie.substring(c_start,c_end));
		}
	}
	return false;
}


<!-- Toggle Calendars

function toggleBox(szDivID,szDivIDS, iState, iStateS) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
       document.layers[szDivIDS].visibility = iStateS ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        //var txt= document.getElementById(szDivID).value;
       //alert(txt);
       if( obj )  obj.style.visibility = iState ? "visible" : "hidden";
        var objS = document.getElementById(szDivIDS);
        if( objS ) objS.style.visibility = iStateS ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
        document.all[szDivIDS].style.visibility = iStateS ? "visible" : "hidden";
    }
}
// -->




<!-- Begin Quicklinks Rollovers

image1 = new Image();
image1.src = ".Images/Quicklinks/LBHowDo2.gif";

image2 = new Image();
image2.src = "Images/Quicklinks/LBCouncil2.gif";

image3 = new Image();
image3.src = "Images/Quicklinks/LBVisit2.gif";

image4 = new Image();
image4.src = "Images/Quicklinks/LBOnlineServ2.gif";

image5 = new Image();
image5.src = "Images/Quicklinks/LBLinks2.gif";

image6 = new Image();
image6.src = "Images/Quicklinks/LBChan11B.gif";

image7 = new Image();
image7.src = "Images/Quicklinks/LBAmerica2.gif";


// End -->



// (C) 2000 www.CodeLifter.com
// http://www.codelifter.com
// Free for all users, but leave in this  header
// NS4-6,IE4-6
// Fade effect only in IE; degrades gracefully

// =======================================
// set the following variables
// =======================================

// Set slideShowSpeed (milliseconds)
var slideShowSpeed = 3000

// Duration of crossfade (seconds)
var crossFadeDuration = 3

// Specify the image files
var Pica = new Array()
var Picb = new Array()
var Picc = new Array()
 // don't touch this
// to add more images, just continue
// the pattern, adding to the array below

Pica[0] = 'Images/Rotate/Image1a.jpg'
Pica[1] = 'Images/Rotate/Image2a.jpg'
Pica[2] = 'Images/Rotate/Image3a.jpg'
Pica[3] = 'Images/Rotate/Image4a.jpg'
Picb[0] = 'Images/Rotate/Image1b.jpg'
Picb[1] = 'Images/Rotate/Image2b.jpg'
Picb[2] = 'Images/Rotate/Image3b.jpg'
Picb[3] = 'Images/Rotate/Image4b.jpg'
Picc[0] = 'Images/Rotate/Image1c.jpg'
Picc[1] = 'Images/Rotate/Image2c.jpg'
Picc[2] = 'Images/Rotate/Image3c.jpg'
Picc[3] = 'Images/Rotate/Image4c.jpg'

// =======================================
// do not edit anything below this line
// =======================================

var t
var j = 0
var k = 0
var l = 0
var pa = Pica.length
var pb = Picb.length
var pc = Picc.length

var preLoada = new Array()
var preLoadb = new Array()
var preLoadc = new Array()
for (i = 0; i < pa; i++){
   preLoada[i] = new Image()
   preLoadb[i] = new Image()
   preLoadc[i] = new Image()
   preLoada[i].src = Pica[i]
   preLoadb[i].src = Picb[i]
   preLoadc[i].src = Picc[i]
}

function runSlideShowa(){
   if (document.all){
   document.images.SlideShowa.style.zIndex=1
      document.images.SlideShowa.style.filter="blendTrans(duration=2)"
      document.images.SlideShowa.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShowa.filters.blendTrans.Apply()     
   }
   document.images.SlideShowa.src = preLoada[j].src
   if (document.all){
      document.images.SlideShowa.filters.blendTrans.Play()
   }
   j = j + 1
   if (j > (pa-1)) j=0
   t = setTimeout('runSlideShowa()', 5868)
}

function runSlideShowb(){
   if (document.all){
   document.images.SlideShowb.style.zIndex=1
      document.images.SlideShowb.style.filter="blendTrans(duration=2)"
      document.images.SlideShowb.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShowb.filters.blendTrans.Apply()     
   }
   document.images.SlideShowb.src = preLoadb[k].src
   if (document.all){
      document.images.SlideShowb.filters.blendTrans.Play()
   }
   k = k + 1
   if (k > (pb-1)) k=0
   t = setTimeout('runSlideShowb()', 5297)
}

function runSlideShowc(){
   if (document.all){
   document.images.SlideShowc.style.zIndex=1
      document.images.SlideShowc.style.filter="blendTrans(duration=2)"
      document.images.SlideShowc.style.filter="blendTrans(duration=crossFadeDuration)"
      document.images.SlideShowc.filters.blendTrans.Apply()     
   }
   document.images.SlideShowc.src = preLoadc[l].src
   if (document.all){
      document.images.SlideShowc.filters.blendTrans.Play()
   }
   l = l + 1
   if (l > (pc-1)) l=0
   t = setTimeout('runSlideShowc()', 4265)
}



<!-- Begin
function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "', 'toolbar=0,scrollbars=0,location=0,statusbar=0,menubar=0,resizable=0,width=415,height=280,left = 425,top = 297');");
}
// End -->



function ShowWeather( whichLayer )
{
  var elem, vis;
  if( document.getElementById ) // this is the way the standards work
    elem = document.getElementById( whichLayer );
  else if( document.all ) // this is the way old msie versions work
      elem = document.all[whichLayer];
  else if( document.layers ) // this is the way nn4 works
    elem = document.layers[whichLayer];
  vis = elem.style;
  // if the style.display value is blank we try to figure it out here
  if(vis.display==''&&elem.offsetWidth!=undefined&&elem.offsetHeight!=undefined)
    vis.display = (elem.offsetWidth!=0&&elem.offsetHeight!=0)?'block':'none';
  vis.display = (vis.display==''||vis.display=='block')?'none':'block';
}

