var baseurl="http://www.peoriaaz.gov/"; 

// ------- 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") {
 
   setTimeout("loadingpage();",30); // 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() 
{    
 //leaving site alert
		links = document.getElementsByTagName('a');
 		 
		for(i=0; i<links.length; i++)
			{  
		
		if (String(document.links[i].href).search(/peoriaaz|peoriaed|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 
        
}   
// ------- END loadingpage function - All Onload calls go here -------------   

//<!-- 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=1,width=415,height=280,left = 425,top = 297');");
}
// End -->

/*window.onload=loadingpage;*/




function blocking(nr)
{

	var allHTMLTags = new Array();
	
	//Create Array of All HTML Tags
	var allHTMLTags=document.getElementsByTagName("*");
	
	//Loop through all tags using a for loop
	for (i=0; i<allHTMLTags.length; i++) {
	
		//Get all tags with the specified class name.
		//if (allHTMLTags[i].className=="dropdown") {
		
		//	allHTMLTags[i].style.display='none';
		
		//}
				//if (allHTMLTags[i].className=="sidearrow") {
		
			//allHTMLTags[i].src= baseurl +'images/Base/SidenavArrow1.gif';
		
		//}
		
	}


	if (document.layers)
	{
		
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		document.layers[nr].display = current;
		
	}
	//else if (document.all)
	//{
	//alert(nr);
	//	current = (document.all[nr].style.display == 'none') ? 'block' : 'none';
	//	document.all[nr].style.display = current;
		
	//}
	else if (document.getElementById)
	{
		
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		document.getElementById(nr).style.display = vista;
		
	}
	
}
function blockinga(nr)
{

	var allHTMLTags = new Array();
	
	//Create Array of All HTML Tags
	var allHTMLTags=document.getElementsByTagName("*");
	
	//Loop through all tags using a for loop
	for (i=0; i<allHTMLTags.length; i++) {
	
		//Get all tags with the specified class name.
		//if (allHTMLTags[i].className=="dropdowna") {
		
		//	allHTMLTags[i].style.display='none';
		
		//}
		
					///	if (allHTMLTags[i].className=="sidearrowa") {
		
			///allHTMLTags[i].src= baseurl +'images/Base/SidenavArrow1a.gif';
		
		//}
	}



	if (document.layers)
	{
		
		current = (document.layers[nr].display == 'none') ? 'block' : 'none';
		document.layers[nr].display = current;
		
	}

	else if (document.getElementById)
	{
		
		vista = (document.getElementById(nr).style.display == 'none') ? 'block' : 'none';
		document.getElementById(nr).style.display = vista;
		
	}
	

	
}


function arrowswitch(ar) {

		current = (document[ar].src == baseurl +'images/Base/SidenavArrow2.gif') ? baseurl +'images/Base/SidenavArrow1.gif' : baseurl +'images/Base/SidenavArrow2.gif';
		document[ar].src = current;

}

function arrowswitcha(ar) {

		current = (document[ar].src == baseurl +'images/Base/SidenavArrow2a.gif') ? baseurl +'images/Base/SidenavArrow1a.gif' : baseurl +'images/Base/SidenavArrow2a.gif';
		document[ar].src = current;

}


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';
}

  function checkKeycode(e) {
               var keycode;
               if (window.event) // IE
                    keycode = e.keyCode;
               else if (e.which) // Netscape/Firefox/Opera
                    keycode = e.which;
               if (keycode==13) 
                  CallSearch();
           }
         
           //document.onkeydown = checkKeycode;
         
function CallSearch()
           {
           
               var objsearchText = document.getElementById('txtSearchText3');
               var searchText;
               if ((objsearchText!=null))
               {
                   searchText = objsearchText.value;
                   searchText = searchText.replace(/>/gi, " >");
                   searchText = searchText.replace(/</gi, "< ");
                   objsearchText.value = searchText;
               }
               window.location=baseurl +'SearchPage4.aspx?searchtext=' + searchText;
 
               //+ "&folderid=0&searchfor=all&orderby=id&orderdirection=ascending";
               //Load the page with the websearch server control in the bottom frame using Javascript
               //Set websearch properties using querystring parameters
               //Properties set here- search text,Orderby, FolderId, and SearchFor
               //SearchFor can be a value from all/html/documents/images/multimedia/discussionForum
               //Orderby can be one of these - editor,id,rank,title,datecreated,datemodified
               //OrderDirection can be ascending or descending
           }
           
        
function cleartext(obj)  {        
        
        obj.value = "";
        
    }
function new_window(url) { 

window.open(url,"Link","toolbar=0,location=0,directories=0,status=0,menubar=0,scrollbars=1,resizable=1,width=300,height=250,left=40,top=50"); 

} 
function myprint()
{
window.print();
}

  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";
    }
}

   function displaydesc(which, descriptionarray, container){
if (document.getElementById)
document.getElementById(container).innerHTML=descriptionarray[which.selectedIndex]
}

function jumptolink(what){
var selectedopt=what.options[what.selectedIndex]
if (document.getElementById && selectedopt.getAttribute("target")=="newwin")
window.open(selectedopt.value)
else
window.location=selectedopt.value
}


    var descArray = new Array() 
descArray [1]="Welcome, City of Peoria employee. Click the Continue button to proceed"
descArray [2]="You are not eligible to apply for City of Peoria internal positions. Click the Continue button to return to the main page"
    function doThis(ths) 
    { 
        var selInd2 = ths.selectedIndex; 
        //alert(selInd); 
        document.getElementById('msgDiv').innerHTML=descArray[selInd2];
 } 

