function imgOn(imgId)
{
	document.getElementById(imgId).src = "gui/" + imgId + "_over.jpg";
}


function imgOff(imgId)
{
	document.getElementById(imgId).src ="gui/" + imgId + ".jpg";
}

function imgOnGif(imgId)
{
	document.getElementById(imgId).src = "gui/" + imgId + "_over.gif";
}


function imgOffGif(imgId)
{
	document.getElementById(imgId).src ="gui/" + imgId + ".gif";
}

function imgOnAdmin(imgId)
{
	document.getElementById(imgId).src = "../../../../gui/" + imgId + "_over.jpg";
}


function imgOffAdmin(imgId)
{
	document.getElementById(imgId).src = "../../../../gui/" + imgId + ".jpg";
}


function debug(name, value)
{
	alert(name + " : " + value);
	return false;
}


function changeColor(pageName)
{
	var id;

	switch (pageName)
	{
		case "textured-patterned-cast-coloured-glass":
			id = "textures-treatments";		  
			break;
		case "corporate-glass-signage":
			id = "corporate";
			break;			
		case "residential-glass-balustrading":
			id = "residential";
			break;
		case "ecclesiastical-sculpture-artworks":
			id = "ecclesiastical";
			break;
		case "artglass-water-features":
			id = "artglass-water-features";
			break;
		case "index":
			id = "home";
			break;
		case "architectural-glass-about":
			id = "about-us";
			break;
		case "contact-toucan-forged-glass":
			id = "contact-us";
			break;
		case "textural-glazing-technical-information":
			id = "technical-information";
			break;
		case "new-work":
			id = "new-work";
			break;
		case "download":
			id = "download";
			break;
		//default:
	}
	
	var e = document.getElementById(id);
		
    if(!(e))
    {
         // alert("This change is not possible!");
          return(false);
    }

    e.style.color = "#000000";
    return(true);
}


// Cross-browser function to add a function to the onload event.
function AddOnload(myfunc)
{

	if(window.addEventListener)	// FireFox
	{
		window.addEventListener('load', myfunc, false);
	}
	else if(window.attachEvent)	// IE
	{
		window.attachEvent('onload', myfunc);
	}
	else if (window.onload)
	{
		var func = window.onload; 
		window.onload = function()
		{
			func();
			myfunc();
		}
	}
	else
	{
		window.onload = myfunc();
	}
}


// The hover function:
//  If there is a child sub-menu, show it on mouseover, hide it on mouseout!
var sfHover = function()
{
	var menu = document.getElementById("menu");
	if (!menu)
	{
		return;
	}
	var listItems = menu.getElementsByTagName("LI");
	for (var i = 0; i < listItems.length; i++)
	{
		listItems[i].onmouseover = function()
		{
			if (this.getElementsByTagName("UL").length > 0)
			{
				// Show the sub-menu
				this.getElementsByTagName("UL").item(0).style.display = "block";
			}
		}
		listItems[i].onmouseout = function()
		{
			if (this.getElementsByTagName("UL").length > 0)
			{
				// Hide the sub-menu
				this.getElementsByTagName("UL").item(0).style.display = "none";
			}
		}
	}
}

AddOnload(sfHover); // Activate the menus when the page loads...

function NotAvailable()
{
}