function menuOn()
{
	var strLocation = window.location.toString();
	var strFolders = strLocation.split("/");
	var strFolder = strFolders[strFolders.length-2]

	var objImageName = "i" + strFolder.substring(0,1).toUpperCase() + strFolder.substring(1,strFolder.length);	

	if(document.getElementById(objImageName))
	{
		var objImage = document.getElementById(objImageName);
		
		if (objImage.src.indexOf("off.gif") > -1)
		{
			var strImageOnSrc = objImage.src.substring(0,objImage.src.length-7) + "on.gif";
			objImage.src = strImageOnSrc;
		}		
	}
}

//constructor:
function ImageSwapObject(onPath,offPath,imgName,imgPath)
{
	if(document.images){
		this.on=new Image();
		this.on.src="../images/"+ imgPath + "/" + onPath;
		this.off=new Image();
		this.off.src="../images/"+imgPath + "/" + offPath;
		this.imageName=imgName;
	}
}


//force prototype creation:
new ImageSwapObject("on","off","name","path");

//functions:
function ImageSwapObject_turnOn()
{
	if(document.images){
		if(!document.layers){
			document.images[this.imageName].src=this.on.src;
		}
		else{
			document.images[this.imageName].src=this.on.src;
		}
		menuOn();
	}
}

function ImageSwapObject_turnOff()
{
	if(document.images){
		if(!document.layers){
			document.images[this.imageName].src=this.off.src;
		}
		else{
			document.images[this.imageName].src=this.off.src;
		}
		menuOn();
	}
}

//turn functions into methods:
ImageSwapObject.prototype.turnOn=ImageSwapObject_turnOn;
ImageSwapObject.prototype.turnOff=ImageSwapObject_turnOff;


//create objects:
//top menu items
var m;

//top menu items
mIdea = new ImageSwapObject("ideaon.gif","ideaoff.gif","iIdea","menu");
mRoots = new ImageSwapObject("rootson.gif","rootsoff.gif","iRoots","menu");
mResources = new ImageSwapObject("resourceson.gif","resourcesoff.gif","iResources","menu");
mClientArea = new ImageSwapObject("clientareaon.gif","clientareaoff.gif","iClientArea","menu");
mContact = new ImageSwapObject("contacton.gif","contactoff.gif","iContact","menu");