/* INSTRUCTIONS

DIV ROLLOVER CLASS SWAP FUNCTION

In the CSS Create a Class

.divname{
	
	}
	
Next create a class with the same name, with _hover

.divname_hover{
	
	}

In the HTML

<div id="divname" class="divname"></div>


Add all the div ids to the divarray below.

Thats it.



*/



window.onload=initAll;
function initAll(){
	
var divarray=Array("index","about-us","services","projects","join-our-team","contact");
	// Current Page Reference
// copyright Stephen Chapman, 1st Jan 2005
// you may copy this function but please keep the copyright notice with it
function getURL(uri) {
uri.dir = location.href.substring(0, location.href.lastIndexOf('\/'));
uri.dom = uri.dir; if (uri.dom.substr(0,7) == 'http:\/\/') uri.dom = uri.dom.substr(7);
uri.path = ''; var pos = uri.dom.indexOf('\/'); if (pos > -1) {uri.path = uri.dom.substr(pos+1); uri.dom = uri.dom.substr(0,pos);}
uri.page = location.href.substring(uri.dir.length+1, location.href.length+1);
pos = uri.page.indexOf('?');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
pos = uri.page.indexOf('#');if (pos > -1) {uri.page = uri.page.substring(0, pos);}
uri.ext = ''; pos = uri.page.indexOf('.');if (pos > -1) {uri.ext =uri.page.substring(pos+1); uri.page = uri.page.substr(0,pos);}
uri.file = uri.page;
if (uri.ext != '') uri.file += '.' + uri.ext;
if (uri.file == '') uri.page = 'index';
uri.args = location.search.substr(1).split("?");
return uri;
}

var uri = new Object();
getURL(uri);
                  

page=getURL(window.location);


if(page.page=="index"){
var current="index";
var addarray = Array("servicesbox1","newsbox1","newsbox2");
for(i=0;i<addarray.length;i++){
divarray.push(addarray[i]);
	
	}
	}
	
if(page.page=="about-us"){
var current="about-us";
var addarray = Array("newsbox1","newsbox2");
for(i=0;i<addarray.length;i++){
divarray.push(addarray[i]);
	
	}
	}
	
if(page.page=="services"){
var current="services";
var addarray = Array("newsbox1","newsbox2");
for(i=0;i<addarray.length;i++){
divarray.push(addarray[i]);
	
	}
	}
	
if(page.page=="projects"){
var current="projects";
var addarray = Array("newsbox1","newsbox2");
for(i=0;i<addarray.length;i++){
divarray.push(addarray[i]);
	
	}
	}
	
if(page.page=="join-our-team" || page.page=="scholarships" || page.page=="kelowna-careers" || page.page=="kamloops-careers"){
var current="join-our-team";
	}
if(page.page=="contact"){
var current="contact";
	}
if(page.page=="engineering" || page.page=="planning" || page.page=="urban-design" || page.page=="services-learn-more"){
var current="services";
	}
if(page.page=="site-development" || page.page=="rain-water-management" || page.page=="transportation" || page.page=="waste-water-management"  || page.page=="pump-stations-resevoirs"  || page.page=="hillside-developments"  || page.page=="planning-project"  || page.page=="urban-design-project" || page.page=="project-details" || page.page=="archived-projects"){
var current="projects";
	}
if(page.page=="partners-team" || page.page=="history" || page.page=="media" || page.page=="the-future" || page.page=="media-archive" || page.page=="professional-memberships" || page.page=="key-personnel"){
var current="about-us";
	}


var myimages = new Array();
function preloading(){
for (x=0; x<preloading.arguments.length; x++){
myimages[x] = new Image();
myimages[x].src = "images/menu/"+preloading.arguments[x];
}
}
preloading("contactus_over.gif","joinourteam_over.gif","projects_over.gif","services_over.gif","aboutus_over.gif","home_over.gif");

// EDIT THIS CONTENT ONLY //
// DO NOT EDIT BELOW //
for(i=0;i<divarray.length;i++){
anchor = document.getElementById(divarray[i]);
if(divarray[i]!=current){
anchor.onmouseover = function(event){ anchorMouseover(this,event) };
anchor.onmouseout = function(event){ anchorMouseout(this,event) };
}
else{
anchor.className=current+"_hover";
	}
}}
function anchorMouseover(anchor,event)
{
	anchor.className=anchor.id+"_hover";}
function anchorMouseout(anchor,event)
{anchor.className=anchor.id;}


